Grok  7.6.6
Public Member Functions | Static Public Member Functions | List of all members
grk::GrkImage Class Reference

#include <GrkImage.h>

Inheritance diagram for grk::GrkImage:
_grk_image

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

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ GrkImage()

grk::GrkImage::GrkImage ( )

Referenced by create(), and duplicate().

◆ ~GrkImage()

grk::GrkImage::~GrkImage ( )

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::FileFormat::apply_palette_clr(), create(), and duplicate().

◆ allocData() [2/2]

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

◆ compositeFrom()

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)

Parameters
src_tilesource tile
cpcoding parameters
Returns
: true if successful

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

Parameters
src_tilesource tile
cpcoding parameters
Returns
: true if successful

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.

◆ copyHeader()

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.

Parameters
destthe dest image
Returns
true if successful

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().

◆ create()

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

◆ duplicate() [1/2]

GrkImage * grk::GrkImage::duplicate ( void  )

◆ duplicate() [2/2]

GrkImage * grk::GrkImage::duplicate ( const grk_tile tile_src_data)

Create new image and copy tile buffer data in.

Parameters
tile_src_datatile source data
Returns
new GrkImage if successful

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().

◆ reduceDimensions()

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

◆ transferDataFrom()

void grk::GrkImage::transferDataFrom ( const grk_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.

Referenced by grk::CodeStream::exec_decompress().


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