Grok
9.5.0
|
#include <GrkImage.h>
Public Member Functions | |
GrkImage () | |
bool | subsampleAndReduce (uint32_t reduce) |
bool | allocData () |
Allocate data. More... | |
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 | compositeFrom (const Tile *src_tile) |
Copy tile to composite image. More... | |
bool | compositeFrom (const GrkImage *src_img) |
Copy image data to composite image. More... | |
bool | generateCompositeBounds (const TileComponent *src_comp, uint16_t compno, grkRectU32 *src, grkRectU32 *dest, grkRectU32 *dest_win, uint32_t *src_line_off) |
bool | generateCompositeBounds (const grk_image_comp *src_comp, uint16_t compno, grkRectU32 *src, grkRectU32 *dest, grkRectU32 *dest_win, uint32_t *src_line_off) |
bool | generateCompositeBounds (uint16_t compno, grkRectU32 *src, uint32_t src_stride, grkRectU32 *dest, grkRectU32 *dest_win, uint32_t *src_line_off) |
void | createMeta () |
Static Public Member Functions | |
static GrkImage * | create (uint16_t numcmpts, grk_image_cmptparm *cmptparms, GRK_COLOR_SPACE clrspc, bool doAllocation) |
Create image. More... | |
static bool | allocData (grk_image_comp *image) |
Allocate data for single image component. More... | |
Private Member Functions | |
~GrkImage () | |
Private Attributes | |
friend | GrkObjectWrapperImpl< GrkImage > |
bool | ownsData |
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 | color_applied |
bool | has_capture_resolution |
double | capture_resolution [2] |
bool | has_display_resolution |
double | display_resolution [2] |
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 |
bool grk::GrkImage::allocData | ( | void | ) |
Allocate data.
Allocate data buffer to mirror "mirror" image.
mirror | mirror image |
References _grk_image::comps, grk::GRK_ERROR(), and _grk_image::numcomps.
Referenced by grk::FileFormatDecompress::apply_palette_clr(), and create().
|
static |
Allocate data for single image component.
image | image |
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.
bool grk::GrkImage::compositeFrom | ( | const GrkImage * | src_image | ) |
Copy image data to composite image.
src_image | source image |
References _grk_image::comps, generateCompositeBounds(), grk::GRK_WARN(), grk::grkRect< T >::height(), _grk_image::numcomps, grk::grkRect< T >::width(), grk::grkRect< T >::x0, and grk::grkRect< T >::y0.
bool grk::GrkImage::compositeFrom | ( | const Tile * | src_tile | ) |
Copy tile to composite image.
Copy tile data to composite image.
tile_data stores only the decompressed resolutions, in the actual precision of the decompressed image. This method copies a sub-region of this region into p_output_image (which stores data in 32 bit precision)
src_tile | source tile |
tile stores only the decompressed resolutions, in the actual precision of the decompressed image. This method copies tile buffer into composite image.
src_tile | source tile |
References _grk_image::comps, grk::Tile::comps, generateCompositeBounds(), grk::grkRect< T >::height(), grk::Tile::numcomps, grk::grkRect< T >::width(), grk::grkRect< T >::x0, and grk::grkRect< T >::y0.
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 _grk_image::capture_resolution, _grk_image::color_space, _grk_image::comps, _grk_image_comp::data, _grk_image::display_resolution, grk_image_all_components_data_free(), grk_object_ref(), _grk_image::has_capture_resolution, _grk_image::has_display_resolution, _grk_image::meta, _grk_image::numcomps, _grk_image_meta::obj, _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.
Referenced by grk::CodeStreamDecompress::allocateProcessor(), grk::CodeStreamDecompress::decompressTile(), duplicate(), grk::CodeStreamCompress::initCompress(), and grk::CodeStreamDecompress::readHeader().
|
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_comptparm::dx, _grk_image_comptparm::dy, GRK_COMPONENT_ASSOC_COLOUR_1, GRK_COMPONENT_ASSOC_COLOUR_2, GRK_COMPONENT_ASSOC_COLOUR_3, GRK_COMPONENT_ASSOC_UNASSOCIATED, GRK_COMPONENT_TYPE_COLOUR, GRK_COMPONENT_TYPE_UNSPECIFIED, grk::GRK_ERROR(), GrkImage(), _grk_image_comptparm::h, _grk_image_comptparm::prec, _grk_image_comptparm::sgnd, _grk_image_comptparm::w, _grk_image_comptparm::x0, and _grk_image_comptparm::y0.
void grk::GrkImage::createMeta | ( | ) |
References _grk_image::meta.
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::grkRect< T >::x0, grk::grkRect< T >::x1, grk::grkRect< T >::y0, and grk::grkRect< T >::y1.
Referenced by grk::TileProcessor::generateImage().
bool grk::GrkImage::generateCompositeBounds | ( | const grk_image_comp * | src_comp, |
uint16_t | compno, | ||
grkRectU32 * | src, | ||
grkRectU32 * | dest, | ||
grkRectU32 * | dest_win, | ||
uint32_t * | src_line_off | ||
) |
bool grk::GrkImage::generateCompositeBounds | ( | const TileComponent * | src_comp, |
uint16_t | compno, | ||
grkRectU32 * | src, | ||
grkRectU32 * | dest, | ||
grkRectU32 * | dest_win, | ||
uint32_t * | src_line_off | ||
) |
bool grk::GrkImage::generateCompositeBounds | ( | uint16_t | compno, |
grkRectU32 * | src, | ||
uint32_t | src_stride, | ||
grkRectU32 * | dest, | ||
grkRectU32 * | dest_win, | ||
uint32_t * | src_line_off | ||
) |
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.
void grk::GrkImage::transferDataFrom | ( | const Tile * | tile_src_data | ) |
References _grk_image::comps, grk::Tile::comps, 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_image_single_component_data_free(), and _grk_image::numcomps.
|
private |
|
private |
Referenced by ~GrkImage().