Grok 10.0.5
|
#include <TileCache.h>
Public Member Functions | |
GrkImage () | |
bool | subsampleAndReduce (uint32_t reduce) |
bool | allocCompositeData (void) |
Allocate data for tile compositing. | |
bool | supportsStripCache (CodingParams *cp) |
void | copyHeader (GrkImage *dest) |
Copy only header of image and its component header (no data are copied) if dest image have data, they will be freed. | |
void | transferDataTo (GrkImage *dest) |
Transfer data to dest for each component, and null out "this" data. | |
void | transferDataFrom (const Tile *tile_src_data) |
GrkImage * | duplicate (const Tile *tile_src) |
Create new image and transfer tile buffer data. | |
bool | composite (const GrkImage *src) |
bool | compositeInterleaved (const GrkImage *src) |
Interleave image data and copy to interleaved composite image. | |
bool | compositeInterleaved (const Tile *src, uint32_t yBegin, uint32_t yEnd) |
Interleave strip of tile data and copy to interleaved composite image. | |
bool | greyToRGB (void) |
bool | convertToRGB (bool wholeTileDecompress) |
bool | applyColourManagement (void) |
Convert to sRGB. | |
bool | applyICC (void) |
bool | validateICC (void) |
void | convertPrecision (void) |
bool | execUpsample (void) |
void | all_components_data_free (void) |
void | postReadHeader (CodingParams *cp) |
void | validateColourSpace (void) |
bool | isSubsampled () |
bool | validateZeroed (void) |
bool | applyColour (void) |
bool | apply_palette_clr (void) |
bool | check_color (void) |
void | apply_channel_definition (void) |
void | allocPalette (uint8_t num_channels, uint16_t num_entries) |
uint32_t | width (void) const |
uint32_t | height (void) const |
void | print (void) const |
bool | componentsEqual (bool checkPrecision) |
bool | componentsEqual (uint16_t firstNComponents, bool checkPrecision) |
Static Public Member Functions | |
static GrkImage * | create (grk_image *src, uint16_t numcmpts, grk_image_comp *cmptparms, GRK_COLOR_SPACE clrspc, bool doAllocation) |
Create image. | |
static bool | allocData (grk_image_comp *imageComp, bool clear) |
Allocate data for single image component. | |
static bool | allocData (grk_image_comp *imageComp) |
Private Member Functions | |
~GrkImage () | |
std::string | getColourSpaceString (void) |
std::string | getICCColourSpaceString (cmsColorSpaceSignature color_space) |
bool | isValidICCColourSpace (uint32_t signature) |
bool | needsConversionToRGB (void) |
bool | isOpacity (uint16_t compno) |
bool | compositePlanar (const GrkImage *srcImg) |
Copy planar image data to planar composite image. | |
bool | generateCompositeBounds (const grk_image_comp *srcComp, uint16_t destCompno, grk_rect32 *destWin) |
bool | generateCompositeBounds (grk_rect32 src, uint16_t destCompno, grk_rect32 *destWin) |
bool | allComponentsSanityCheck (bool equalPrecision) |
return false if : | |
grk_image * | createRGB (uint16_t numcmpts, uint32_t w, uint32_t h, uint8_t prec) |
void | sycc_to_rgb (int32_t offset, int32_t upb, int32_t y, int32_t cb, int32_t cr, int32_t *out_r, int32_t *out_g, int32_t *out_b) |
bool | sycc444_to_rgb (void) |
bool | sycc422_to_rgb (bool oddFirstX) |
bool | sycc420_to_rgb (bool oddFirstX, bool oddFirstY) |
bool | color_sycc_to_rgb (bool oddFirstX, bool oddFirstY) |
bool | color_cmyk_to_rgb (void) |
bool | color_esycc_to_rgb (void) |
bool | cieLabToRGB (void) |
bool | componentsEqual (grk_image_comp *src, grk_image_comp *dest, bool checkPrecision) |
void | scaleComponent (grk_image_comp *component, uint8_t precision) |
Static Private Member Functions | |
static void | single_component_data_free (grk_image_comp *comp) |
static void | copyComponent (grk_image_comp *src, grk_image_comp *dest) |
Private Attributes | |
friend | GrkObjectWrapperImpl< GrkImage > |
Additional Inherited Members | |
![]() | |
grk_object | obj |
uint32_t | x0 |
XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area. | |
uint32_t | y0 |
YOsiz: vertical offset from the origin of the reference grid to the top side of the image area. | |
uint32_t | x1 |
Xsiz: width of the reference grid. | |
uint32_t | y1 |
Ysiz: height of the reference grid. | |
uint16_t | numcomps |
number of components in the image | |
GRK_COLOR_SPACE | color_space |
bool | paletteApplied_ |
bool | channelDefinitionApplied_ |
bool | has_capture_resolution |
double | capture_resolution [2] |
bool | has_display_resolution |
double | display_resolution [2] |
GRK_SUPPORTED_FILE_FMT | decompressFormat |
bool | forceRGB |
bool | upsample |
grk_precision * | precision |
uint32_t | numPrecision |
bool | hasMultipleTiles |
bool | splitByComponent |
uint16_t | decompressNumComps |
uint32_t | decompressWidth |
uint32_t | decompressHeight |
uint8_t | decompressPrec |
GRK_COLOR_SPACE | decompressColourSpace |
grk_io_buf | interleavedData |
uint32_t | rowsPerStrip |
uint32_t | rowsPerTask |
uint64_t | packedRowBytes |
grk_image_meta * | meta |
grk_image_comp * | comps |
grk::GrkImage::GrkImage | ( | ) |
References obj, grk::singleTileRowsPerStrip, and grk::_grk_object::wrapper.
|
private |
References comps, grk::grk_aligned_free(), and grk::grk_object_unref().
|
private |
return false if :
References comps, grk::GRK_ERROR(), GRK_MAX_SUPPORTED_IMAGE_PRECISION, grk::GRK_WARN(), and numcomps.
bool grk::GrkImage::allocCompositeData | ( | void | ) |
Allocate data for tile compositing.
References comps, grk::GRK_ERROR(), and numcomps.
|
static |
|
static |
Allocate data for single image component.
imageComp | image component |
References data, grk::_grk_image_comp::data, grk::grk_aligned_malloc(), grk::grk::GRK_ERROR(), grk::grk_make_aligned_width(), grk::_grk_image_comp::h, grk::_grk_image_comp::stride, and grk::_grk_image_comp::w.
void grk::GrkImage::allocPalette | ( | uint8_t | num_channels, |
uint16_t | num_entries ) |
void grk::GrkImage::apply_channel_definition | ( | void | ) |
References comps, grk::GRK_CHANNEL_ASSOC_WHOLE_IMAGE, grk::GRK_CHANNEL_TYPE_COLOUR, grk::GRK_WARN(), and numcomps.
bool grk::GrkImage::apply_palette_clr | ( | void | ) |
References compno, comps, data, grk::grk_aligned_free(), grk::GRK_ERROR(), h, numcomps, and w.
bool grk::GrkImage::applyColour | ( | void | ) |
bool grk::grk::GrkImage::applyColourManagement | ( | void | ) |
Convert to sRGB.
References grk::GRK_CLRSPC_CUSTOM_CIE, grk::GRK_CLRSPC_DEFAULT_CIE, grk::GRK_ERROR(), grk::GRK_FMT_BMP, grk::GRK_FMT_JPG, grk::GRK_FMT_PNG, grk::GRK_FMT_TIF, grk::GRK_FMT_UNK, and grk::GRK_WARN().
bool grk::GrkImage::applyICC | ( | void | ) |
References comps, grk::_grk_image_comp::data, dx, dy, grk::GRK_CLRSPC_GRAY, grk::GRK_CLRSPC_SRGB, grk::GRK_WARN(), h, numcomps, and w.
bool grk::GrkImage::check_color | ( | void | ) |
|
private |
|
private |
|
private |
|
private |
References comps, dx, dy, grk::GRK_CLRSPC_SRGB, grk::GRK_WARN(), and numcomps.
bool grk::GrkImage::componentsEqual | ( | bool | checkPrecision | ) |
References numcomps.
|
private |
References grk::_grk_image_comp::dx, grk::_grk_image_comp::dy, grk::_grk_image_comp::h, grk::_grk_image_comp::prec, grk::_grk_image_comp::sgnd, grk::_grk_image_comp::stride, grk::_grk_image_comp::type, grk::_grk_image_comp::w, grk::_grk_image_comp::x0, grk::_grk_image_comp::Xcrg, grk::_grk_image_comp::y0, and grk::_grk_image_comp::Ycrg.
bool grk::GrkImage::componentsEqual | ( | uint16_t | firstNComponents, |
bool | checkPrecision ) |
bool grk::GrkImage::composite | ( | const GrkImage * | src | ) |
bool grk::GrkImage::compositeInterleaved | ( | const GrkImage * | src | ) |
Interleave image data and copy to interleaved composite image.
src | source image |
References comps, grk::_grk_image::comps, grk::GRK_FMT_PXM, grk::GRK_FMT_TIF, grk::GRK_WARN(), grk::grk::grk_rect< T >::height(), grk::_grk_image::numcomps, grk::grk::grk_rect< T >::width(), grk::grk::grk_rect< T >::x0, and grk::grk::grk_rect< T >::y0.
bool grk::GrkImage::compositeInterleaved | ( | const Tile * | src, |
uint32_t | yBegin, | ||
uint32_t | yEnd ) |
Interleave strip of tile data and copy to interleaved composite image.
srcImg | source image |
References comps, grk::grk::Tile::comps, grk::GRK_FMT_PXM, grk::GRK_FMT_TIF, grk::GRK_WARN(), grk::grk::grk_rect< T >::height(), grk::grk::Tile::numcomps_, grk::grk::grk_rect< T >::width(), grk::grk::grk_rect< T >::x0, grk::grk::grk_rect< T >::y0, yBegin, and yEnd.
|
private |
Copy planar image data to planar composite image.
src | source image |
References compno, comps, grk::_grk_image::comps, grk::GRK_WARN(), grk::grk::grk_rect< T >::height(), grk::_grk_image::numcomps, grk::grk::grk_rect< T >::width(), grk::grk::grk_rect< T >::x0, and grk::grk::grk_rect< T >::y0.
void grk::GrkImage::convertPrecision | ( | void | ) |
References grk::clip(), compno, comps, grk::GRK_FMT_JPG, grk::GRK_FMT_PNG, grk::GRK_PREC_MODE_CLIP, grk::GRK_PREC_MODE_SCALE, grk::GRK_WARN(), and numcomps.
bool grk::GrkImage::convertToRGB | ( | bool | wholeTileDecompress | ) |
References grk::GRK_CLRSPC_CMYK, grk::GRK_CLRSPC_EYCC, grk::GRK_CLRSPC_SYCC, grk::GRK_ERROR(), grk::GRK_WARN(), numcomps, wholeTileDecompress, x0, and y0.
|
staticprivate |
References grk::_grk_image_comp::dx, grk::_grk_image_comp::dy, grk::_grk_image_comp::h, grk::_grk_image_comp::prec, grk::_grk_image_comp::sgnd, grk::_grk_image_comp::type, grk::_grk_image_comp::w, grk::_grk_image_comp::x0, grk::_grk_image_comp::Xcrg, grk::_grk_image_comp::y0, and grk::_grk_image_comp::Ycrg.
void grk::GrkImage::copyHeader | ( | GrkImage * | dest | ) |
Copy only header of image and its component header (no data are copied) if dest image have data, they will be freed.
Copy only header of image and its component header (no data copied) if dest image has data, it will be freed.
dest | the dest image |
References capture_resolution, grk::_grk_image::capture_resolution, grk::_grk_image::color_space, compno, comps, grk::_grk_image::comps, grk::_grk_image_comp::data, grk::_grk_image::decompressColourSpace, grk::_grk_image::decompressFormat, grk::_grk_image::decompressHeight, grk::_grk_image::decompressNumComps, grk::_grk_image::decompressPrec, grk::_grk_image::decompressWidth, display_resolution, grk::_grk_image::display_resolution, grk::_grk_image::forceRGB, grk::grk_object_ref(), has_capture_resolution, has_display_resolution, grk::_grk_image::hasMultipleTiles, grk::_grk_image::meta, grk::_grk_image::numcomps, numcomps, grk::_grk_image::numPrecision, grk::_grk_image_meta::obj, grk::_grk_image::packedRowBytes, grk::_grk_image::precision, grk::_grk_image::rowsPerStrip, grk::_grk_image::upsample, grk::_grk_image::x0, x0, grk::_grk_image::x1, x1, grk::_grk_image::y0, y0, grk::_grk_image::y1, and y1.
Referenced by grk::grk::Strip::Strip().
|
static |
Create image.
numcmpts | number of components |
cmptparms | component parameters |
clrspc | image color space |
doAllocation | true if data is to be allocated, otherwise false |
References grk::_grk_image::color_space, compno, grk::_grk_image::comps, grk::_grk_image::decompressColourSpace, grk::_grk_image::decompressFormat, grk::_grk_image::decompressHeight, grk::_grk_image::decompressNumComps, grk::_grk_image::decompressPrec, grk::_grk_image::decompressWidth, dx, grk::_grk_image_comp::dx, dy, grk::_grk_image_comp::dy, grk::_grk_image::forceRGB, grk::GRK_CHANNEL_ASSOC_COLOUR_1, grk::GRK_CHANNEL_ASSOC_COLOUR_2, grk::GRK_CHANNEL_ASSOC_COLOUR_3, grk::GRK_CHANNEL_ASSOC_UNASSOCIATED, grk::GRK_CHANNEL_TYPE_COLOUR, grk::GRK_CHANNEL_TYPE_UNSPECIFIED, grk::GRK_CLRSPC_CMYK, grk::grk::GRK_ERROR(), grk::_grk_image_comp::h, image, grk::_grk_image::numcomps, grk::_grk_image::numPrecision, grk::_grk_image::packedRowBytes, grk::_grk_image_comp::prec, grk::_grk_image::precision, grk::_grk_image::rowsPerStrip, grk::_grk_image_comp::sgnd, grk::_grk_image::upsample, grk::_grk_image_comp::w, grk::_grk_image_comp::x0, and grk::_grk_image_comp::y0.
|
private |
References compno, grk::GRK_CLRSPC_SRGB, grk::GRK_WARN(), h, and w.
Create new image and transfer tile buffer data.
src | tile source |
References grk::grk::TileComponentWindowBase< T >::bounds(), compno, grk::grk::Tile::comps, grk::grk::TileComponent::getWindow(), grk::grk::Tile::numcomps_, grk::grk::grk_rect< T >::x0, grk::grk::grk_rect< T >::x1, grk::grk::grk_rect< T >::y0, and grk::grk::grk_rect< T >::y1.
Referenced by grk::grk::TileProcessor::generateImage().
bool grk::GrkImage::execUpsample | ( | void | ) |
|
private |
|
private |
References comps, grk::grk::grk_rect< T >::intersection(), and grk::grk::grk_rect< T >::pan().
|
private |
|
private |
bool grk::GrkImage::greyToRGB | ( | void | ) |
References comps, grk::GRK_CLRSPC_GRAY, grk::GRK_CLRSPC_SRGB, and numcomps.
|
private |
References compno, comps, grk::GRK_CHANNEL_TYPE_OPACITY, grk::GRK_CHANNEL_TYPE_PREMULTIPLIED_OPACITY, and numcomps.
|
private |
|
private |
References grk::GRK_CLRSPC_CMYK, grk::GRK_CLRSPC_EYCC, grk::GRK_CLRSPC_SYCC, grk::GRK_FMT_TIF, and grk::GRK_FMT_UNK.
void grk::GrkImage::postReadHeader | ( | CodingParams * | cp | ) |
void grk::GrkImage::print | ( | void | ) | const |
|
private |
|
staticprivate |
References grk::_grk_image_comp::data, and grk::grk_aligned_free().
bool grk::GrkImage::subsampleAndReduce | ( | uint32_t | reduce | ) |
References grk::ceildiv(), grk::ceildivpow2(), compno, comps, grk::GRK_ERROR(), numcomps, x0, x1, y0, and y1.
bool grk::GrkImage::supportsStripCache | ( | CodingParams * | cp | ) |
References comps, cp, grk::GRK_FMT_PXM, grk::GRK_FMT_TIF, numcomps, and y0.
|
private |
References comps, grk::GRK_CLRSPC_SRGB, grk::grk_object_unref(), grk::GRK_WARN(), h, offset, and w.
|
private |
References comps, grk::GRK_CLRSPC_SRGB, grk::grk_object_unref(), grk::GRK_WARN(), h, numcomps, offset, w, and y.
|
private |
References comps, grk::GRK_CLRSPC_SRGB, grk::grk_object_unref(), h, numcomps, offset, w, and y.
|
private |
void grk::GrkImage::transferDataFrom | ( | const Tile * | tile_src_data | ) |
References compno, comps, grk::grk::Tile::comps, and numcomps.
Referenced by grk::grk::TileProcessor::decompressT2T1().
void grk::GrkImage::transferDataTo | ( | GrkImage * | dest | ) |
Transfer data to dest for each component, and null out "this" data.
Transfer data to dest for each component, and null out this data.
Assumption: "this" and dest have the same number of components
Assumption: this and dest have the same number of components
References compno, comps, grk::_grk_image::comps, grk::_grk_io_buf::data_, grk::_grk_image::interleavedData, grk::_grk_image::numcomps, and numcomps.
void grk::GrkImage::validateColourSpace | ( | void | ) |
References comps, dx, dy, grk::GRK_CLRSPC_SYCC, grk::GRK_CLRSPC_UNKNOWN, and numcomps.
bool grk::GrkImage::validateICC | ( | void | ) |
|
private |