Struct spng::raw::RawContext[][src]

pub struct RawContext<R> { /* fields omitted */ }
Expand description

Implementations

Set how chunk CRC errors should be handled for critical and ancillary chunks.

Get image width and height limits.

Returns (width, height)

Set image width and height limits, these may not be larger than (2^31)-1.

Get chunk size and chunk cache limits.

Returns (chunk_size, cache_size)

Set chunk size and chunk cache limits, the default chunk size limit is (2^31)-1, the default chunk cache limit is SIZE_MAX.

Get the image header.

Get the image palette.

Get the image transparency.

Get primary chromacities and white point as floating point numbers.

Get primary chromacities and white point in the PNG’s internal representation.

Get the image gamma.

Get the ICC profile.

Note

ICC profiles are not validated.

Get the significant bits.

Get the sRGB rendering intent.

Get text information.

Note

Due to the structure of PNG files it is recommended to call this function after decode_image.

Get the image background color.

Get the image histogram.

Get physical pixel dimensions.

Get the suggested palettes.

Get the modification time.

Note

Due to the structure of PNG files it is recommended to call this function after decode_image.

Get the image offset.

Get the EXIF data.

Note

Due to the structure of PNG files it is recommended to call this function after decode_image.

Get the current, to-be-decoded row’s information.

Returns unknown chunk information.

Note

Due to the structure of PNG files it is recommended to call this function after decode_image.

Calculates decoded image buffer size for the given output format.

PNG data must have been set prior with set_png_stream or set_png_buffer.

Decodes the PNG file and writes the image to out. The image is converted from any PNG format to the destination format out_format. Interlaced images are deinterlaced and 16-bit images are converted to host-endian.

The out buffer must have a length greater or equal to the size returned by decoded_image_size with the same out_format.

If the SPNG_DECODE_PROGRESSIVE flag is set, the context will be initialied with out_format for progressive decoding. The image is not immediately decoded and the out buffer is ignored.

The SPNG_DECODE_TRNS flag is ignored if the PNG has an alpha channel or does not contain a TRNS chunk. It is also ignored for gray 1/2/4-bit images.

The function may only be called once per context.

Decodes and deinterlaces a scanline to out.

This function requires the decoder to be initialized by calling decode_image with the SPNG_DECODE_PROGRESSIVE flag set.

The widest scanline is the decoded image size divided by ihdr.height.

For the last scanline and subsequent calls the return value is SPNG_EOI.

If the image is not interlaced this function’s behavior is identical to decode_scanline.

Decodes a scanline to out.

This function requires the decoder to be initialized by calling decode_image with the SPNG_DECODE_PROGRESSIVE flag set.

The widest scanline is the decoded image size divided by ihdr.height.

For the last scanline and subsequent calls the return value is SPNG_EOI.

Set the input png stream reader. The input buffer or stream may only be set once per context.

Set the input png buffer. The input buffer or stream may only be set once per context.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.