Grok
7.6.6
|
#include <GrkImage.h>
Public Member Functions | |
GrkImage () | |
~GrkImage () | |
bool | reduceDimensions (uint32_t reduce) |
bool | allocData () |
Allocate data. More... | |
bool | 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... | |
GrkImage * | duplicate () |
void | transferDataTo (GrkImage *dest) |
Transfer data to dest for each component, and null out "this" data. More... | |
void | transferDataFrom (const grk_tile *tile_src_data) |
GrkImage * | duplicate (const grk_tile *tile_src) |
Create new image and copy tile buffer data in. More... | |
bool | compositeFrom (grk_tile *tile, CodingParams *cp) |
Copy tile to composite image. More... | |
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... | |
Additional Inherited Members | |
![]() | |
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 |
color space: sRGB, Greyscale or YUV More... | |
grk_image_comp * | comps |
image components More... | |
grk_color | color |
bool | color_applied |
bool | has_capture_resolution |
double | capture_resolution [2] |
bool | has_display_resolution |
double | display_resolution [2] |
uint8_t * | iptc_buf |
size_t | iptc_len |
uint8_t * | xmp_buf |
size_t | xmp_len |
grk::GrkImage::GrkImage | ( | ) |
Referenced by create(), and duplicate().
grk::GrkImage::~GrkImage | ( | ) |
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::FileFormat::apply_palette_clr(), create(), and duplicate().
|
static |
Allocate data for single image component.
image | image |
References _grk_image_comp::data, grk::default_align, grk::grk_aligned_malloc(), grk::GRK_ERROR(), grk_image_single_component_data_free(), grk::grk_make_aligned_width(), _grk_image_comp::h, _grk_image_comp::owns_data, _grk_image_comp::stride, and _grk_image_comp::w.
Referenced by grk::CodeStream::decompress_tiles().
bool grk::GrkImage::compositeFrom | ( | grk_tile * | src_tile, |
CodingParams * | cp | ||
) |
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 |
cp | coding parameters |
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 the image (which stores data in 32 bit precision). Tile data will be released after compositing is complete
src_tile | source tile |
cp | coding parameters |
References _grk_image::comps, grk::grk_tile::comps, grk::grk_rectangle< T >::height(), grk::CodingParams::m_coding_params, grk::CodingParams::m_dec, grk::DecodingParams::m_reduce, grk::grk_tile::numcomps, grk::grk_rectangle< T >::width(), grk::grk_rectangle< T >::x0, grk::grk_rectangle< T >::x1, grk::grk_rectangle< T >::y0, and grk::grk_rectangle< T >::y1.
bool 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::FileFormat::alloc_palette(), _grk_image::color, _grk_image::color_space, _grk_image::comps, _grk_image_comp::data, grk::grk_free(), grk_image_all_components_data_free(), grk::grk_malloc(), grk_color::icc_profile_buf, _grk_image::numcomps, grk_color::palette, _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.
Referenced by grk::CodeStream::allocateProcessor(), duplicate(), grk::CodeStream::init_compress(), and grk::CodeStream::read_header().
|
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::grk_calloc(), 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(), grk_image_destroy(), 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.
Referenced by grk_image_create().
GrkImage * grk::GrkImage::duplicate | ( | void | ) |
References _grk_image::comps, copyHeader(), GrkImage(), and _grk_image::numcomps.
Referenced by grk::TileCache::put().
Create new image and copy tile buffer data in.
tile_src_data | tile source data |
References allocData(), grk::TileComponentWindowBuffer< T >::bounds(), grk::grk_tile::comps, copyHeader(), grk::TileComponent::getBuffer(), GrkImage(), grk::grk_tile::numcomps, and grk::grk_rectangle< T >::width().
bool grk::GrkImage::reduceDimensions | ( | 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 grk_tile * | tile_src_data | ) |
References _grk_image::comps, grk::grk_tile::comps, and _grk_image::numcomps.
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.
Referenced by grk::CodeStream::exec_decompress().