int tsmJPEGCompressTile ( unsigned char *tileBuffer, unsigned char *jpegBuffer, TileTspec *tile, int quality_level )

JPEG compress a raw tile in memory

Documentation

JPEG compress a raw tile in memory.

This function will accept two pointers to tile buffers that have already been allocated (e.g. with tsmMakeTileBuffer). The tileBuffer contains a raw bitmap, whilst the jpegBuffer will be filled by this function and will contain the JPEG compressed version of the raw data. The function returns the size of the JPEG compressed data that was written to jpegBuffer (in bytes).

A few things to note about this function:

N.B. this function outputs exactly the same JPEG files (size, data, tables, etc.) as the libtiff library routines. However this routine is slightly more efficient because it compresses the data in reverse order for you so you don't have to vertically flip the input buffer before compressing.

Returns:
the number of bytes written to the jpegBuffer, 0 = failure
Parameters:
tileBuffer - the tile buffer of raw data to read from
jpegBuffer - the tile buffer to be filled with JPEG data
tile - the tile tspec giving the image dimensions, etc.
quality_level - the quality level for the compression. This can take a value from 0 (most compression) to 100 (least compression). A good default value is 75.
Author:
Martin Reddy
Version:
6 November 1997
See Also:
tsmJPEGDecompressTile, tsmMakeTileBuffer, tsmSetJPEGQuality, TileTspec


TSMAPI_RELEASE 2.1 - Release Date: 2001/01/10 19:01:12

Back to tsmApi Home Page