Skip to content

Commit

Permalink
doc/guile-png.texi (<png-image>): Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
artyom-poptsov committed Jan 27, 2024
1 parent 2dab418 commit 457a0df
Showing 1 changed file with 89 additions and 6 deletions.
95 changes: 89 additions & 6 deletions doc/guile-png.texi
Original file line number Diff line number Diff line change
Expand Up @@ -307,19 +307,102 @@ filters from the image; this is useful for debugging purposes
@subsection <png-image>

@deftp {Class} <png-image> @
[#:chunks='()] @
[#:data=(make <bytevector> 0)] @
[#:data-chunk-size=256]
[#:data=(make-bytevector 0)] @
[#:data-chunk-size=256] @
[#:width=0] @
[#:height=0] @
[#:bit-depth=8] @
[#:color-type=0] @
[#:compression-method=0] @
[#:filter-method=0] @
[#:interlace-method=0] @
[#:palette=0] @
[#:chunks='()]

This class represents a decompressed PNG image.

Constructor parameters:

@table @asis
@item #:data (data <bytevector>)
@table @code
@item #:data
Value type: @code{<bytevector>}

The image data as a continuous @code{<bytevector>}.
@item #:data-chunk-size (size <number>)
@item #:data-chunk-size
Value type: @code{<number>}

The data chunk size that will be used for image encoder.
@item #:width
Value type: @code{<number>}

The image width.
@item #:height
Value type: @code{<number>}

The image height.
@item #:bit-depth
Value type: @code{<number>}
@item #:color-type
Value type: @code{<number>} | @code{<symbol>}

Color type is a single-byte integer that describes the interpretation of the
image data. Color type codes represent sums of the following values: 1
(palette used), 2 (color used), and 4 (alpha channel used). Valid values are
0, 2, 3, 4, and 6.

The value can be either a number (the color type according to RFC) or a
symbol. The symbol mapping is as follows:
@table @asis
@item 0
@code{grayscale}
@item 2
@code{rgb}
@item 3
@code{indexed}
@item 4
@code{grayscale+alpha}
@item 6
@code{rgb+alpha}
@end table

@item #:compression-method
Value type: @code{<number>}

Compression method is a single-byte integer that indicates the method used to
compress the image data. At present, only compression method 0
(deflate/inflate compression with a 32K sliding window) is defined.

@item #:filter-method
Value type: @code{<number>}

Filter method is a single-byte integer that indicates the preprocessing method
applied to the image data before compression. At present, only filter method
0 (adaptive filtering with five basic filter types) is defined.

@item #:interlace-method
Value type: @code{<number>}

Interlace method is a single-byte integer that indicates the transmission
order of the image data. Two values are currently defined: 0 (no interlace)
or 1 (Adam7 interlace).

@item #:palette
Value type: @code{<vector>} of @code{<bytevector>}

A vector of PNG image palette entries, each a three-byte bytevector in the
form:

@table @asis
@item Red: 1 byte (0 = black, 255 = red)
@item Green: 1 byte (0 = black, 255 = green)
@item Blue: 1 byte (0 = black, 255 = blue)
@end table

@item #:chunks
Value type: @code{<list>} of @code{<png-chunk>}

Extra PNG chunks.

@end table

@end deftp
Expand Down

0 comments on commit 457a0df

Please sign in to comment.