The OpenD Programming Language

gamut.codecs.jpegload

Loads a JPEG image from a memory buffer or a file. req_comps can be 1 (grayscale), 3 (RGB), or 4 (RGBA). On return, width/height will be set to the image's dimensions, and actual_comps will be set to the either 1 (grayscale) or 3 (RGB). Requesting a 8 or 32bpp image is currently a little faster than 24bpp because the jpeg_decoder class itself currently always unpacks to either 8 or 32bpp. JPEG image loading.

Members

Aliases

JpegStreamReadFunc
alias JpegStreamReadFunc = int function(void* pBuf, int max_bytes_to_read, bool* pEOF_flag, void* userData)

Input stream interface. This function is called when the internal input buffer is empty.

Functions

decompress_jpeg_image_from_stream
ubyte[] decompress_jpeg_image_from_stream(JpegStreamReadFunc rfn, void* userData, int width, int height, int actual_comps, float pixelAspectRatio, float dotsPerInchY, int req_comps)

decompress JPEG image, what else? you can specify required color components in req_comps (3 for RGB or 4 for RGBA), or leave it as is to use image value. Returns pixelAspectRatio and dotsPerInchY, -1 if not available.

Meta