|
|
|
abstract [The PNG file format interface.] ; eol [PNG is a clear, highly recommended file format.] ; eol highlight "warning: " ; [reading is not available yet.]
method f open stream options h -> status arg_rw ImageWriteFilterPng f ; arg_rw Stream stream ; arg
|
|
abstract [The PNG file format interface.] ; eol [PNG is a clear, highly recommended file format.] ; eol highlight "warning: " ; [reading is not available yet.]
method f open stream options h -> status arg_rw ImageWriteFilterPng f ; arg_rw Stream stream ; arg
|
|
|
|
if h:gamut:name<>"rgb" and h:gamut:name<>"rgba" and h:gamu
|
|
var Int psize := h:gamut pixel_size if psize<>1 and psize<>3 and psize<>4 # h:gamut:name<>"rgb" and h:gamut:name<>"rgba" and h:gamut:name<>"grey"
|
|
return failure:"Only RGB images are currently supported f line_size := h:pixel_size*h:size_x f stream :> stream stream raw_write8 137 stream raw_write8 80 stream raw_write8 78 stream raw_write8 71 stream raw_write8 13 stream raw_write8 10 stream raw_write8 26 stream raw_write8 10
stream raw_write32 PNGHeader:size stream writechars "IHDR" var PNGHeader hdr hdr size_x := h size_x hdr size_y := h size_y hdr depth := 8
|
|
return failure:"Only RGB images are currently supported f line_size := h:pixel_size*h:size_x f stream :> stream stream raw_write8 137 stream raw_write8 80 stream raw_write8 78 stream raw_write8 71 stream raw_write8 13 stream raw_write8 10 stream raw_write8 26 stream raw_write8 10
stream raw_write32 PNGHeader:size stream writechars "IHDR" var PNGHeader hdr hdr size_x := h size_x hdr size_y := h size_y hdr depth := 8
|
|
|
|
hdr color := shunt h:gamut:name="grey" 0 h:gamut:name="rgb
|
|
hdr color := shunt psize=1 0 psize=3 2 psize=4 6 0
|
|
hdr compression := 0 hdr filter := 0 hdr interlace := 0 stream raw_write addressof:hdr PNGHeader:size (var PNG_CRC table) init ; table update "IHDR":characters table update addressof:hdr PNGHeader:size stream raw_write32 table:terminate
image_record_filters ".png" ImageReadFilterPng false ImageWr
|
|
hdr compression := 0 hdr filter := 0 hdr interlace := 0 stream raw_write addressof:hdr PNGHeader:size (var PNG_CRC table) init ; table update "IHDR":characters table update addressof:hdr PNGHeader:size stream raw_write32 table:terminate
image_record_filters ".png" ImageReadFilterPng false ImageWr
|