Sha256: 813d5fac29a080971b71384b2fd1b6d439800bea52d8ade2e17bb29e5d0b92bf

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

#ifndef OILY_PNG_PNG_DECODING_H
#define OILY_PNG_PNG_DECODING_H

#define UNFILTER_BYTE(byte, adjustment)  byte = (BYTE) (((byte) + (adjustment)) & 0x000000ff)

#define ADD_PIXEL_FROM_PALLETE(pixels, decoding_palette, palette_entry) \
    if (RARRAY_LEN(decoding_palette) > (palette_entry)) { \
      rb_ary_push(pixels, rb_ary_entry(decoding_palette, (palette_entry))); \
    } else { \
      rb_raise(rb_eRuntimeError, "The decoding palette does not have %d entries!", (palette_entry)); \
    }
    
#define ADD_PIXEL_FROM_RGBA(pixels, r, g, b, a) rb_ary_push(pixels, UINT2NUM(BUILD_PIXEL(r,g,b,a)));


typedef void(*scanline_decoder_func)(VALUE, BYTE*, long, long, VALUE);

/*
  Decodes an image pass from the given byte stream at the given position.
  A normal PNG will only have one pass that consumes the entire stream, while an
  interlaced image requires 7 passes which are loaded from different starting positions.
  
  This function shouild replace ChunkyPNG::Canvas::PNGDecoding.decode_png_image_pass
*/
VALUE oily_png_decode_png_image_pass(VALUE self, VALUE stream, VALUE width, VALUE height, VALUE color_mode, VALUE depth, VALUE start_pos);

#endif

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/oily_png/ext/oily_png/png_decoding.h
oily_png-1.2.0 ext/oily_png/png_decoding.h
oily_png-1.1.2 ext/oily_png/png_decoding.h
oily_png-1.1.1 ext/oily_png/png_decoding.h
oily_png-1.1.0 ext/oily_png/png_decoding.h
oily_png-1.0.3 ext/oily_png/png_decoding.h
oily_png-1.0.2 ext/oily_png/png_decoding.h
oily_png-1.0.1 ext/oily_png/png_decoding.h
oily_png-1.0.0 ext/oily_png/png_decoding.h
oily_png-1.0.0.rc2 ext/oily_png/png_decoding.h
oily_png-1.0.0.rc1 ext/oily_png/png_decoding.h