Grok  9.5.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
grk::GrkImage Class Reference

#include <GrkImage.h>

Inheritance diagram for grk::GrkImage:
_grk_image

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)
 
GrkImageduplicate (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 GrkImagecreate (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

- Public Attributes inherited from _grk_image
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_metameta
 
grk_image_compcomps
 

Constructor & Destructor Documentation

◆ GrkImage()

grk::GrkImage::GrkImage ( )

References _grk_image::obj, and _grk_object::wrapper.

Referenced by create(), and duplicate().

◆ ~GrkImage()

grk::GrkImage::~GrkImage ( )
private

Member Function Documentation

◆ allocData() [1/2]

bool grk::GrkImage::allocData ( void  )

Allocate data.

Allocate data buffer to mirror "mirror" image.

Returns
true if successful
Parameters
mirrormirror image
Returns
true if successful

References _grk_image::comps, grk::GRK_ERROR(), and _grk_image::numcomps.

Referenced by grk::FileFormatDecompress::apply_palette_clr(), and create().

◆ allocData() [2/2]

bool grk::GrkImage::allocData ( grk_image_comp image)
static

Allocate data for single image component.

Parameters
imageimage
Returns
true if successful

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.

◆ compositeFrom() [1/2]

bool grk::GrkImage::compositeFrom ( const GrkImage src_image)

Copy image data to composite image.

Parameters
src_imagesource image
Returns
: true if successful

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.

◆ compositeFrom() [2/2]

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)

Parameters
src_tilesource tile
Returns
: true if successful

tile stores only the decompressed resolutions, in the actual precision of the decompressed image. This method copies tile buffer into composite image.

Parameters
src_tilesource tile
Returns
: true if successful

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.

◆ copyHeader()

void grk::GrkImage::copyHeader ( GrkImage dest)

◆ create()

GrkImage * grk::GrkImage::create ( uint16_t  numcmpts,
grk_image_cmptparm cmptparms,
GRK_COLOR_SPACE  clrspc,
bool  doAllocation 
)
static

Create image.

Parameters
numcmptsnumber of components
cmptparmscomponent parameters
clrspcimage color space
doAllocationtrue if data is to be allocated, otherwise false
Returns
a new image if successful, otherwise nullptr

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.

◆ createMeta()

void grk::GrkImage::createMeta ( )

References _grk_image::meta.

◆ duplicate()

GrkImage * grk::GrkImage::duplicate ( const Tile src_tile)

◆ generateCompositeBounds() [1/3]

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 
)

◆ generateCompositeBounds() [2/3]

bool grk::GrkImage::generateCompositeBounds ( const TileComponent src_comp,
uint16_t  compno,
grkRectU32 src,
grkRectU32 dest,
grkRectU32 dest_win,
uint32_t *  src_line_off 
)

◆ generateCompositeBounds() [3/3]

bool grk::GrkImage::generateCompositeBounds ( uint16_t  compno,
grkRectU32 src,
uint32_t  src_stride,
grkRectU32 dest,
grkRectU32 dest_win,
uint32_t *  src_line_off 
)

◆ subsampleAndReduce()

bool grk::GrkImage::subsampleAndReduce ( uint32_t  reduce)

◆ transferDataFrom()

void grk::GrkImage::transferDataFrom ( const Tile tile_src_data)

◆ transferDataTo()

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.

Member Data Documentation

◆ GrkObjectWrapperImpl< GrkImage >

friend grk::GrkImage::GrkObjectWrapperImpl< GrkImage >
private

◆ ownsData

bool grk::GrkImage::ownsData
private

Referenced by ~GrkImage().


The documentation for this class was generated from the following files: