| synopsis || arguments || next |

kdu_roi_graphics::kdu_roi_graphics

kdu_roi_graphics( kdu_codestream codestream, char * fname, float threshold)

[Declared in "../apps/kdu_compress/roi_sources.h"]

Go to class description.


Synopsis

Accepts the name of a monochrome image file and a single threshold. The image represented by this file is stretched (interpolated) or shrunk (decimated) to match the geometry of the actual image being compressed (as represented by the codestream) and its sample values are thresholded. Locations where the threshold is exceeded are deemed to belong to the foreground, while the remainder is interpreted as background.

Note that the mask image (the one being thresholded) is read incrementally, buffering the smallest amount of data required to satisfy the demand for ROI information, which filters through from the leaves of the compression tree ( kdu_encoder objects) all the way up through the DWT analysis system.


Arguments

codestream [kdu_codestream]

Master interface to the internal code-stream management machinery associated with the image being compressed.

fname [char *]

Name of the mask image, to be opened and used to determine the foreground region. Currently, only binary PGM files are accepted, although it would be trivial to add support for other file formats. Note that the dimensions of the mask image are arbitrary. The width and the height are independently stretched to the dimensions of the image which is actually being compressed.

threshold [float]

Foreground threshold, expressed as a normalized quantity in the range 0 to 1, where 0 means black and 1 means white. Foreground locations must have sample values which strictly exceed the threshold, meaning that a threshold of 0 will produce foreground everywhere the mask image's samples are non-zero, while a threshold of 1 will produce an empty foreground.


| top || synopsis || arguments || next |