lib/chunky_png/canvas/png_encoding.rb
# Encodes the canvas according to the PNG format specification with a given color
# mode and Adam7 interlacing.
#
# This method will split the original canvas in 7 smaller canvases and encode them
# one by one, concatenating the resulting strings.
#
# @param [Integer] color_mode The color mode to use for encoding.
# @param [Integer] bit_depth The bit depth of the image.
# @param [Integer] filtering The filtering method to use.
# @return [String] The PNG encoded canvas as string.
Encodes the canvas according to the PNG format specification with a given color
mode and Adam7 interlacing.

This method will split the original canvas in 7 smaller canvases and encode them
one by one, concatenating the resulting strings.
Encodes the canvas according to the PNG format specification with a given color mode and Adam7 interlacing . This method will split the original canvas in 7 smaller canvases and encode them one by one concatenating the resulting strings .
def encode_png_image_with_interlacing(color_mode, bit_depth = 8, filtering = ChunkyPNG::FILTER_NONE)
        stream = "".b
        0.upto(6) do |pass|
          subcanvas = self.class.adam7_extract_pass(pass, self)
          subcanvas.encoding_palette = encoding_palette
          subcanvas.encode_png_image_pass_to_stream(stream, color_mode, bit_depth, filtering)
        end
        stream
      end
def encode_png_image_with_interlacing ( color_mode , bit_depth = 8 , filtering = ChunkyPNG :: FILTER_NONE ) stream = "" . b 0 . upto ( 6 ) do | pass | subcanvas = self . class . adam7_extract_pass ( pass , self ) subcanvas . encoding_palette = encoding_palette subcanvas . encode_png_image_pass_to_stream ( stream , color_mode , bit_depth , filtering ) end stream end
Encodes the canvas according to the PNG format specification with a given color
mode and Adam7 interlacing.
Encodes the canvas according to the PNG format specification with a given color mode and Adam7 interlacing .
The PNG encoded canvas as string.
The PNG encoded canvas as string .
String
color_mode
<not_specific>
bit_depth
<not_specific>
filtering
<not_specific>
<not_specific>
filtering The filtering method to use.
filtering The filtering method to use .