lib/chunky_png/canvas/png_decoding.rb
# Decodes a scanline of a 1-bit, indexed image into a row of pixels.
# @param [String] stream The stream to decode from.
# @param [Integer] pos The position in the stream on which the scanline starts (including the filter byte).
# @param [Integer] width The width in pixels of the scanline.
# @param [ChunkyPNG::Palette] decoding_palette The palette to use to decode colors.
# @return [Array<Integer>] An array of decoded pixels.
Decodes a scanline of a 1-bit, indexed image into a row of pixels.
Decodes a scanline of a 1 - bit indexed image into a row of pixels .
def decode_png_pixels_from_scanline_indexed_1bit(stream, pos, width, decoding_palette)
        (0...width).map do |index|
          palette_pos = decode_png_extract_1bit_value(stream.getbyte(pos + 1 + (index >> 3)), index)
          decoding_palette[palette_pos]
        end
      end
def decode_png_pixels_from_scanline_indexed_1bit ( stream , pos , width , decoding_palette ) ( 0 ... width ) . map do | index | palette_pos = decode_png_extract_1bit_value ( stream . getbyte ( pos + 1 + ( index >> 3 ) ) , index ) decoding_palette [ palette_pos ] end end
Decodes a scanline of a 1-bit, indexed image into a row of pixels.
Decodes a scanline of a 1 - bit indexed image into a row of pixels .
An array of decoded pixels.
An array of decoded pixels .
Array<Integer>
stream
<not_specific>
pos
<not_specific>
width
<not_specific>
decoding_palette
<not_specific>
<not_specific>
decoding_palette The palette to use to decode colors.
decoding_palette The palette to use to decode colors .