Grok
9.7.5
|
#include <GrkImage.h>
Public Member Functions | |
GrkImage () | |
bool | subsampleAndReduce (uint32_t reduce) |
bool | allocCompositeData (CodingParams *cp) |
Allocate data for tile compositing. More... | |
bool | canAllocInterleaved (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. More... | |
void | transferDataTo (GrkImage *dest) |
Transfer data to dest for each component, and null out "this" data. More... | |
void | transferDataFrom (const Tile *tile_src_data) |
GrkImage * | duplicate (const Tile *tile_src) |
Create new image and transfer tile buffer data. More... | |
bool | composite (const GrkImage *srcImg) |
bool | compositeInterleaved (const GrkImage *srcImg) |
Copy image data to composite image. More... | |
bool | greyToRGB (void) |
bool | convertToRGB (bool wholeTileDecompress) |
bool | applyColourManagement (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 | alloc_palette (uint8_t num_channels, uint16_t num_entries) |
uint32_t | width (void) const |
uint32_t | height (void) const |
void | print (void) const |
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. More... | |
static bool | allocData (grk_image_comp *imageComp, bool clear) |
Allocate data for single image component. More... | |
static bool | allocData (grk_image_comp *imageComp) |
Private Member Functions | |
~GrkImage () | |
bool | needsConversionToRGB (void) |
bool | isOpacity (uint16_t compno) |
bool | compositePlanar (const GrkImage *srcImg) |
Copy image data to composite image. More... | |
bool | generateCompositeBounds (const grk_image_comp *srcComp, uint16_t compno, grk_rect32 *destWin, uint32_t *srcLineOffset) |
bool | generateCompositeBounds (uint16_t compno, grk_rect32 src, uint32_t src_stride, grk_rect32 *destWin, uint32_t *srcLineOffset) |
bool | allComponentsSanityCheck (bool equalPrecision) |
return false if : More... | |
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 | applyICC (void) |
bool | cieLabToRGB (void) |
bool | componentsEqual (grk_image_comp *src, grk_image_comp *dest) |
void | scaleComponent (grk_image_comp *component, uint8_t precision) |
Static Private Member Functions | |
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. More... | |
uint32_t | y0 |
YOsiz: vertical offset from the origin of the reference grid to the top side of the image area. More... | |
uint32_t | x1 |
Xsiz: width of the reference grid. More... | |
uint32_t | y1 |
Ysiz: height of the reference grid. More... | |
uint16_t | numcomps |
number of components in the image More... | |
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 | multiTile |
bool | splitByComponent |
uint16_t | decompressNumComps |
uint32_t | decompressWidth |
uint32_t | decompressHeight |
uint8_t | decompressPrec |
GRK_COLOR_SPACE | decompressColourSpace |
grk_serialize_buf | interleavedData |
uint32_t | rowsPerStrip |
uint64_t | packedRowBytes |
grk_image_meta * | meta |
grk_image_comp * | comps |
grk::GrkImage::GrkImage | ( | ) |
References _grk_image::obj, and _grk_object::wrapper.
Referenced by create(), and duplicate().
|
private |
void grk::GrkImage::all_components_data_free | ( | void | ) |
References _grk_image::comps, grk_image_single_component_data_free(), and _grk_image::numcomps.
Referenced by copyHeader(), execUpsample(), greyToRGB(), sycc420_to_rgb(), sycc422_to_rgb(), sycc444_to_rgb(), and ~GrkImage().
|
private |
return false if :
References _grk_image::comps, grk::GRK_ERROR(), GRK_MAX_SUPPORTED_IMAGE_PRECISION, grk::GRK_WARN(), and _grk_image::numcomps.
Referenced by applyICC(), cieLabToRGB(), color_cmyk_to_rgb(), and color_esycc_to_rgb().
void grk::GrkImage::alloc_palette | ( | uint8_t | num_channels, |
uint16_t | num_entries | ||
) |
References _grk_image::meta.
Referenced by grk::FileFormatDecompress::read_palette_clr().
bool grk::GrkImage::allocCompositeData | ( | CodingParams * | cp | ) |
Allocate data for tile compositing.
References allocData(), canAllocInterleaved(), _grk_image::comps, grk::GRK_ERROR(), _grk_image::multiTile, and _grk_image::numcomps.
|
static |
References allocData().
|
static |
Allocate data for single image component.
imageComp | image component |
References _grk_image_comp::data, grk::GRK_ERROR(), grk_image_single_component_data_free(), grk::grkAlignedMalloc(), grk::grkMakeAlignedWidth(), _grk_image_comp::h, _grk_image_comp::stride, and _grk_image_comp::w.
Referenced by allocCompositeData(), allocData(), apply_palette_clr(), applyICC(), create(), execUpsample(), and greyToRGB().
void grk::GrkImage::apply_channel_definition | ( | void | ) |
References _grk_color::channel_definition, _grk_image::channelDefinitionApplied_, _grk_image_meta::color, _grk_image::comps, _grk_channel_definition::descriptions, GRK_CHANNEL_ASSOC_WHOLE_IMAGE, GRK_CHANNEL_TYPE_COLOUR, grk::GRK_WARN(), _grk_image::meta, _grk_channel_definition::num_channel_descriptions, _grk_image::numcomps, and _grk_image_comp::type.
Referenced by applyColour().
bool grk::GrkImage::apply_palette_clr | ( | void | ) |
References allocData(), _grk_palette_data::channel_prec, _grk_image_meta::color, _grk_image::comps, grk::GRK_ERROR(), grk_image_single_component_data_free(), grk::grkAlignedFree(), _grk_image::meta, _grk_image::numcomps, _grk_color::palette, and _grk_image::paletteApplied_.
Referenced by applyColour().
bool grk::GrkImage::applyColour | ( | void | ) |
bool grk::GrkImage::applyColourManagement | ( | void | ) |
References applyICC(), cieLabToRGB(), _grk_image_meta::color, _grk_image::color_space, _grk_image::decompressFormat, _grk_image::forceRGB, GRK_BMP_FMT, GRK_CLRSPC_CUSTOM_CIE, GRK_CLRSPC_DEFAULT_CIE, grk::GRK_ERROR(), GRK_JPG_FMT, GRK_PNG_FMT, GRK_TIF_FMT, grk::GRK_WARN(), _grk_color::icc_profile_buf, and _grk_image::meta.
|
private |
References allComponentsSanityCheck(), allocData(), _grk_image_meta::color, _grk_image::color_space, _grk_image::comps, _grk_image_comp::data, _grk_image::forceRGB, GRK_CLRSPC_GRAY, GRK_CLRSPC_SRGB, grk::GRK_WARN(), _grk_image_comp::h, _grk_color::icc_profile_buf, _grk_color::icc_profile_len, _grk_image::meta, _grk_image::numcomps, _grk_image_comp::prec, _grk_image_comp::stride, and _grk_image_comp::w.
Referenced by applyColourManagement().
bool grk::GrkImage::canAllocInterleaved | ( | CodingParams * | cp | ) |
References _grk_image_meta::color, componentsEqual(), _grk_image::comps, _grk_image::decompressFormat, GRK_PXM_FMT, GRK_TIF_FMT, _grk_color::icc_profile_buf, isSubsampled(), _grk_image::meta, needsConversionToRGB(), _grk_image::numcomps, _grk_color::palette, _grk_image_comp::prec, _grk_image::precision, _grk_image::splitByComponent, grk::CodingParams::t_width, grk::CodingParams::ty0, _grk_image::upsample, and _grk_image::y0.
Referenced by allocCompositeData(), and postReadHeader().
bool grk::GrkImage::check_color | ( | void | ) |
|
private |
References allComponentsSanityCheck(), _grk_image_meta::color, _grk_image::color_space, _grk_image::comps, createRGB(), _grk_image_comp::data, GRK_CIE_D50, GRK_CIE_D65, GRK_CIE_D75, GRK_CIE_F11, GRK_CIE_F2, GRK_CIE_F7, GRK_CIE_SA, GRK_CIE_SC, GRK_CLRSPC_SRGB, GRK_DEFAULT_CIELAB_SPACE, GRK_ENUM_CLRSPC_CIE, grk_image_single_component_data_free(), grk_object_unref(), grk::GRK_WARN(), _grk_image_comp::h, _grk_color::icc_profile_buf, _grk_image::meta, _grk_image::numcomps, _grk_image_comp::prec, _grk_image_comp::stride, and _grk_image_comp::w.
Referenced by applyColourManagement().
|
private |
References allComponentsSanityCheck(), _grk_image::color_space, _grk_image::comps, _grk_image_comp::data, GRK_CLRSPC_SRGB, grk_image_single_component_data_free(), _grk_image_comp::h, _grk_image::numcomps, _grk_image_comp::prec, _grk_image_comp::stride, and _grk_image_comp::w.
Referenced by convertToRGB().
|
private |
|
private |
References _grk_image::color_space, _grk_image::comps, GRK_CLRSPC_SRGB, grk::GRK_WARN(), _grk_image::numcomps, sycc420_to_rgb(), sycc422_to_rgb(), and sycc444_to_rgb().
Referenced by convertToRGB().
|
private |
References _grk_image_comp::dx, _grk_image_comp::dy, _grk_image_comp::h, _grk_image_comp::prec, _grk_image_comp::sgnd, _grk_image_comp::stride, _grk_image_comp::type, _grk_image_comp::w, _grk_image_comp::x0, _grk_image_comp::Xcrg, _grk_image_comp::y0, and _grk_image_comp::Ycrg.
Referenced by canAllocInterleaved().
bool grk::GrkImage::composite | ( | const GrkImage * | srcImg | ) |
bool grk::GrkImage::compositeInterleaved | ( | const GrkImage * | srcImg | ) |
Copy image data to composite image.
srcImg | source image |
References _grk_image::comps, _grk_serialize_buf::data, _grk_image::decompressFormat, _grk_image::decompressNumComps, generateCompositeBounds(), GRK_PXM_FMT, GRK_TIF_FMT, grk::GRK_WARN(), grk::grk_rect< T >::height(), _grk_image::interleavedData, grk::grk_rect< T >::width(), grk::grk_rect< T >::x0, and grk::grk_rect< T >::y0.
Referenced by composite().
|
private |
Copy image data to composite image.
srcImg | source image |
References _grk_image::comps, generateCompositeBounds(), grk::GRK_WARN(), grk::grk_rect< T >::height(), _grk_image::numcomps, grk::grk_rect< T >::width(), grk::grk_rect< T >::x0, and grk::grk_rect< T >::y0.
Referenced by composite().
void grk::GrkImage::convertPrecision | ( | void | ) |
bool grk::GrkImage::convertToRGB | ( | bool | wholeTileDecompress | ) |
|
staticprivate |
References _grk_image_comp::dx, _grk_image_comp::dy, _grk_image_comp::h, _grk_image_comp::prec, _grk_image_comp::sgnd, _grk_image_comp::type, _grk_image_comp::w, _grk_image_comp::x0, _grk_image_comp::Xcrg, _grk_image_comp::y0, and _grk_image_comp::Ycrg.
Referenced by execUpsample(), and greyToRGB().
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 all_components_data_free(), _grk_image::capture_resolution, _grk_image::color_space, _grk_image::comps, _grk_image_comp::data, _grk_image::decompressColourSpace, _grk_image::decompressFormat, _grk_image::decompressHeight, _grk_image::decompressNumComps, _grk_image::decompressPrec, _grk_image::decompressWidth, _grk_image::display_resolution, _grk_image::forceRGB, grk_object_ref(), _grk_image::has_capture_resolution, _grk_image::has_display_resolution, _grk_image::meta, _grk_image::multiTile, _grk_image::numcomps, _grk_image::numPrecision, _grk_image_meta::obj, _grk_image::packedRowBytes, _grk_image::precision, _grk_image::rowsPerStrip, _grk_image::upsample, _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.
Referenced by grk::CodeStreamDecompress::decompressTile(), duplicate(), grk::CodeStreamCompress::init(), grk::CodeStreamDecompress::readHeader(), and 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 allocData(), _grk_image::decompressFormat, _grk_image_comp::dx, _grk_image_comp::dy, _grk_image::forceRGB, GRK_CHANNEL_ASSOC_COLOUR_1, GRK_CHANNEL_ASSOC_COLOUR_2, GRK_CHANNEL_ASSOC_COLOUR_3, GRK_CHANNEL_ASSOC_UNASSOCIATED, GRK_CHANNEL_TYPE_COLOUR, GRK_CHANNEL_TYPE_UNSPECIFIED, grk::GRK_ERROR(), GrkImage(), _grk_image_comp::h, _grk_image::numPrecision, _grk_image::packedRowBytes, _grk_image_comp::prec, _grk_image::precision, _grk_image::rowsPerStrip, _grk_image_comp::sgnd, _grk_image::upsample, _grk_image_comp::w, _grk_image_comp::x0, and _grk_image_comp::y0.
Referenced by createRGB().
|
private |
References create(), GRK_CLRSPC_SRGB, and grk::GRK_WARN().
Referenced by cieLabToRGB(), sycc420_to_rgb(), sycc422_to_rgb(), and sycc444_to_rgb().
Create new image and transfer tile buffer data.
tile_src_data | tile source data |
References grk::TileComponentWindowBuffer< T >::bounds(), grk::Tile::comps, copyHeader(), grk::TileComponent::getBuffer(), GrkImage(), grk::Tile::numcomps_, grk::grk_rect< T >::x0, grk::grk_rect< T >::x1, grk::grk_rect< T >::y0, and grk::grk_rect< T >::y1.
Referenced by grk::TileProcessor::generateImage().
bool grk::GrkImage::execUpsample | ( | void | ) |
|
private |
References _grk_image_comp::h, _grk_image_comp::stride, _grk_image_comp::w, _grk_image_comp::x0, and _grk_image_comp::y0.
Referenced by compositeInterleaved(), and compositePlanar().
|
private |
bool grk::GrkImage::greyToRGB | ( | void | ) |
uint32_t grk::GrkImage::height | ( | void | ) | const |
References _grk_image::y0, and _grk_image::y1.
|
private |
References _grk_image::comps, GRK_CHANNEL_TYPE_OPACITY, GRK_CHANNEL_TYPE_PREMULTIPLIED_OPACITY, and _grk_image::numcomps.
Referenced by postReadHeader().
bool grk::GrkImage::isSubsampled | ( | ) |
References _grk_image::comps, and _grk_image::numcomps.
Referenced by canAllocInterleaved(), and postReadHeader().
|
private |
References _grk_image::color_space, _grk_image::decompressFormat, _grk_image::forceRGB, GRK_CLRSPC_CMYK, GRK_CLRSPC_EYCC, GRK_CLRSPC_SYCC, GRK_TIF_FMT, and GRK_UNK_FMT.
Referenced by canAllocInterleaved(), convertToRGB(), and postReadHeader().
void grk::GrkImage::postReadHeader | ( | CodingParams * | cp | ) |
References canAllocInterleaved(), grk::ceildivpow2(), grk::CodingParams::coding_params_, _grk_image_meta::color, _grk_image::color_space, _grk_image::comps, grk::CodingParams::dec_, _grk_image::decompressColourSpace, _grk_image::decompressFormat, _grk_image::decompressHeight, _grk_image::decompressNumComps, _grk_image::decompressPrec, _grk_image::decompressWidth, _grk_image_comp::dx, _grk_image_comp::dy, _grk_image::forceRGB, GRK_BMP_FMT, GRK_CLRSPC_EYCC, GRK_CLRSPC_SRGB, GRK_CLRSPC_SYCC, GRK_PNG_FMT, GRK_PXM_FMT, GRK_TIF_FMT, _grk_image_comp::h, _grk_color::icc_profile_buf, _grk_color::icc_profile_len, _grk_color::icc_profile_name, isOpacity(), isSubsampled(), _grk_image::meta, _grk_image::multiTile, needsConversionToRGB(), _grk_palette_data::num_channels, _grk_image::numcomps, _grk_image::packedRowBytes, _grk_color::palette, _grk_prec::prec, _grk_image_comp::prec, _grk_image::precision, grk::DecodingParams::reduce_, _grk_image::rowsPerStrip, grk::CodingParams::t_height, _grk_image::upsample, _grk_image_comp::w, _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.
void grk::GrkImage::print | ( | void | ) | const |
References _grk_image::comps, grk::GRK_INFO(), _grk_image::numcomps, _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.
|
private |
References _grk_image_comp::data, _grk_image_comp::h, _grk_image_comp::prec, _grk_image::precision, grk::scale, _grk_image_comp::stride, and _grk_image_comp::w.
Referenced by convertPrecision().
bool grk::GrkImage::subsampleAndReduce | ( | uint32_t | reduce | ) |
References _grk_image::comps, grk::GRK_ERROR(), _grk_image::numcomps, _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.
|
private |
References all_components_data_free(), _grk_image::color_space, _grk_image::comps, createRGB(), _grk_image_comp::data, _grk_image_comp::dx, _grk_image_comp::dy, GRK_CLRSPC_SRGB, grk_object_unref(), grk::GRK_WARN(), _grk_image_comp::h, _grk_image_comp::prec, _grk_image_comp::stride, sycc_to_rgb(), and _grk_image_comp::w.
Referenced by color_sycc_to_rgb().
|
private |
References all_components_data_free(), _grk_image::color_space, _grk_image::comps, createRGB(), _grk_image_comp::data, _grk_image_comp::dx, _grk_image_comp::dy, GRK_CLRSPC_SRGB, grk_object_unref(), grk::GRK_WARN(), _grk_image_comp::h, _grk_image::numcomps, _grk_image_comp::prec, _grk_image_comp::stride, sycc_to_rgb(), and _grk_image_comp::w.
Referenced by color_sycc_to_rgb().
|
private |
References all_components_data_free(), _grk_image::color_space, _grk_image::comps, createRGB(), _grk_image_comp::data, GRK_CLRSPC_SRGB, grk_object_unref(), _grk_image_comp::h, _grk_image::numcomps, _grk_image_comp::prec, _grk_image_comp::stride, sycc_to_rgb(), and _grk_image_comp::w.
Referenced by color_sycc_to_rgb().
|
private |
Referenced by sycc420_to_rgb(), sycc422_to_rgb(), and sycc444_to_rgb().
void grk::GrkImage::transferDataFrom | ( | const Tile * | tile_src_data | ) |
References _grk_image::comps, grk::Tile::comps, grk_image_single_component_data_free(), and _grk_image::numcomps.
Referenced by 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 _grk_image::comps, _grk_serialize_buf::data, grk_image_single_component_data_free(), _grk_image::interleavedData, and _grk_image::numcomps.
void grk::GrkImage::validateColourSpace | ( | void | ) |
References _grk_image::color_space, _grk_image::comps, GRK_CLRSPC_SYCC, GRK_CLRSPC_UNKNOWN, and _grk_image::numcomps.
bool grk::GrkImage::validateZeroed | ( | void | ) |
References _grk_image::comps, and _grk_image::numcomps.
uint32_t grk::GrkImage::width | ( | void | ) | const |
References _grk_image::x0, and _grk_image::x1.
|
private |