Grok 20.3.2
grk::FileFormatJP2Compress Class Reference

#include <FileFormatJP2Compress.h>

Inheritance diagram for grk::FileFormatJP2Compress:
grk::FileFormatJP2Family grk::ICompressor grk::FileFormatMJ2Compress

Public Member Functions

 FileFormatJP2Compress (IStream *stream)
virtual ~FileFormatJP2Compress ()
bool init (grk_cparameters *param, GrkImage *image) override
bool start (void) override
uint64_t compress (grk_plugin_tile *tile) override
uint64_t transcode (IStream *srcStream)
Public Member Functions inherited from grk::FileFormatJP2Family
 FileFormatJP2Family (IStream *stream)
virtual ~FileFormatJP2Family ()
 FileFormatJP2Family (const FileFormatJP2Family &)=delete
FileFormatJP2Familyoperator= (const FileFormatJP2Family &)=delete
Public Member Functions inherited from grk::ICompressor
virtual ~ICompressor ()=default
virtual uint64_t compressFrame (GrkImage *image, grk_plugin_tile *tile)
virtual bool finalize (void)

Protected Member Functions

GrkImagegetHeaderImage (void) override
uint8_t * write_ihdr (uint32_t *p_nb_bytes_written)
uint8_t * write_colr (uint32_t *p_nb_bytes_written)
Protected Member Functions inherited from grk::FileFormatJP2Family
void init (grk_decompress_parameters *param)
bool readHeaderProcedure ()
bool readHeader (grk_header_info *header_info, GrkImage *headerImage)
grk_colorgetColour (void)
std::string getBoxName (const Box &box)
const FindHandlerInfo img_find_handler (uint32_t id)
 Finds the BOX_FUNC related to given box id.
uint32_t read_asoc (AsocBox *parent, uint8_t **header_data, uint32_t *header_data_size, uint32_t asocSize)
bool read_asoc (uint8_t *header_data, uint32_t header_data_size)
void serializeAsoc (AsocBox *asoc, grk_asoc *serial_asocs, uint32_t *num_asocs, uint32_t level)
bool read_box_header (Box *box, IStream *stream, uint32_t *bytesRead, bool codeStreamBoxWasRead)
bool read_box_header (Box *box, uint8_t *p_data, uint32_t *bytesRead, uint64_t availableBytes)
uint8_t * write_buffer (uint32_t boxId, Buffer8 *buffer, uint32_t *p_nb_bytes_written)
bool write_ftyp (IStream *stream, uint32_t file_type)
bool write_signature (IStream *stream, uint32_t sig)
bool exec (std::vector< PROCEDURE_FUNC > *procs)
bool read_jp2h (uint8_t *headerData, uint32_t headerSize)
 Reads the Jpeg2000 file Header box - JP2 Header box.
void skip (uint8_t **headerData, uint32_t *headerSize, uint32_t skip)

Protected Attributes

CodeStreamCompresscodeStream = nullptr
GrkImageinputImage_ = nullptr
Protected Attributes inherited from grk::FileFormatJP2Family
std::vector< PROCEDURE_FUNC > * procedure_list_
 list of execution procedures
uint32_t brand
uint32_t minversion
uint32_t numcl
uint32_t * cl
uint32_t w
uint32_t h
uint16_t numcomps
uint8_t bpc
uint8_t C
uint8_t UnkC
uint8_t IPR
uint8_t meth
uint8_t approx
GRK_ENUM_COLOUR_SPACE enumcs
uint8_t precedence
ComponentInfocomps
bool has_capture_resolution
double capture_resolution [2]
bool has_display_resolution
double display_resolution [2]
Buffer8 xml
Buffer8 xml_boxes [JP2_MAX_NUM_XML_BOXES]
uint32_t numXmlBoxes
bool io_xml_
std::string xml_outfile_
Buffer8 ipr
UUIDBox uuids [JP2_MAX_NUM_UUIDS]
uint32_t numUuids
std::unordered_map< uint32_t, BOX_FUNCheader
AsocBox root_asoc
uint32_t jp2_state
bool headerError_
bool headerRead_
std::stack< BoxsuperBoxes_
std::unordered_map< uint32_t, BOX_FUNCimg_header
IStreamstream_

Private Member Functions

bool end (void)
grk_colorgetColour (void)
void find_cf (double x, uint16_t *num, uint16_t *den)
void write_res_box (double resx, double resy, uint32_t box_id, uint8_t **current_res_ptr)
uint8_t * write_res (uint32_t *p_nb_bytes_written)
uint8_t * write_bpc (uint32_t *p_nb_bytes_written)
uint8_t * write_component_mapping (uint32_t *p_nb_bytes_written)
uint8_t * write_palette_clr (uint32_t *p_nb_bytes_written)
uint8_t * write_channel_definition (uint32_t *p_nb_bytes_written)
bool write_jp2h (void)
bool write_ftyp (void)
bool write_signature (void)
bool write_uuids (void)
bool write_jp2c (void)
bool default_validation (void)
void init_header_writing ()
void init_end_header_writing (void)
uint8_t * write_xml (uint32_t *p_nb_bytes_written)
bool write_xml_boxes (void)
bool write_ipr (void)
bool write_asoc_boxes (void)
bool write_rreq (void)
bool skip_jp2c (void)
uint32_t calcAsocSize (AsocBox *asoc)
bool writeAsocBox (IStream *stream, AsocBox *asoc)
void buildAsocTree (const grk_asoc *flat, uint32_t count)
uint64_t transcodeCodestream (IStream *srcStream, uint64_t csStart, uint64_t csLength)

Private Attributes

bool needs_xl_jp2c_box_length = false
uint64_t codestream_offset = 0
bool jpx_branding_ = false
bool write_rreq_ = false
uint16_t rreq_standard_features_ [8] = {}
uint8_t num_rreq_standard_features_ = 0
bool geoboxes_after_jp2c_ = false
bool transcode_mode_ = false
bool write_tlm_transcode_ = false
bool write_plt_transcode_ = false
bool write_sop_transcode_ = false
bool write_eph_transcode_ = false
uint16_t max_layers_transcode_ = 0
uint8_t max_res_transcode_ = 0
GRK_PROG_ORDER transcode_prog_order_ = GRK_PROG_UNKNOWN
grk_stream_params transcode_src_ {}

Constructor & Destructor Documentation

◆ FileFormatJP2Compress()

grk::FileFormatJP2Compress::FileFormatJP2Compress ( IStream * stream)
explicit

◆ ~FileFormatJP2Compress()

grk::FileFormatJP2Compress::~FileFormatJP2Compress ( )
virtual

Member Function Documentation

◆ buildAsocTree()

void grk::FileFormatJP2Compress::buildAsocTree ( const grk_asoc * flat,
uint32_t count )
private

◆ calcAsocSize()

uint32_t grk::FileFormatJP2Compress::calcAsocSize ( AsocBox * asoc)
private

◆ compress()

uint64_t grk::FileFormatJP2Compress::compress ( grk_plugin_tile * tile)
overridevirtual

Implements grk::ICompressor.

Reimplemented in grk::FileFormatMJ2Compress.

References codeStream, and end().

◆ default_validation()

◆ end()

bool grk::FileFormatJP2Compress::end ( void )
private

◆ find_cf()

void grk::FileFormatJP2Compress::find_cf ( double x,
uint16_t * num,
uint16_t * den )
private

Referenced by write_res_box().

◆ getColour()

grk_color * grk::FileFormatJP2Compress::getColour ( void )
private

◆ getHeaderImage()

GrkImage * grk::FileFormatJP2Compress::getHeaderImage ( void )
overrideprotectedvirtual

Implements grk::FileFormatJP2Family.

References codeStream.

◆ init()

bool grk::FileFormatJP2Compress::init ( grk_cparameters * param,
GrkImage * image )
overridevirtual

Implements grk::ICompressor.

Reimplemented in grk::FileFormatMJ2Compress.

References grk::FileFormatJP2Family::approx, grk::FileFormatJP2Family::bpc, grk::FileFormatJP2Family::brand, buildAsocTree(), grk::FileFormatJP2Family::C, grk::FileFormatJP2Family::capture_resolution, grk::FileFormatJP2Family::cl, codeStream, grk::FileFormatJP2Family::comps, grk::FileFormatJP2Family::display_resolution, grk::FileFormatJP2Family::enumcs, grk::EXIF_UUID, geoboxes_after_jp2c_, grk::GEOTIFF_UUID, getColour(), GRK_CBLKSTY_HT_ONLY, GRK_CHANNEL_TYPE_COLOUR, GRK_CLRSPC_CMYK, GRK_CLRSPC_DEFAULT_CIE, GRK_CLRSPC_EYCC, GRK_CLRSPC_GRAY, GRK_CLRSPC_ICC, GRK_CLRSPC_SRGB, GRK_CLRSPC_SYCC, GRK_ENUM_CLRSPC_CIE, GRK_ENUM_CLRSPC_CMYK, GRK_ENUM_CLRSPC_EYCC, GRK_ENUM_CLRSPC_GRAY, GRK_ENUM_CLRSPC_SRGB, GRK_ENUM_CLRSPC_SYCC, GRK_ENUM_CLRSPC_UNKNOWN, grk_image_meta_new(), grk::grk_malloc(), grk::grk_ref(), grk::grklog, grk::FileFormatJP2Family::h, grk::FileFormatJP2Family::has_capture_resolution, grk::FileFormatJP2Family::has_display_resolution, inputImage_, grk::FileFormatJP2Family::IPR, grk::FileFormatJP2Family::ipr, grk::IPTC_UUID, grk::JP2_JP2, grk::JP2_JPH, grk::JP2_JPX, jpx_branding_, max_layers_transcode_, max_res_transcode_, grk::FileFormatJP2Family::meth, grk::FileFormatJP2Family::minversion, grk::MycmsLogErrorHandlerFunction(), num_rreq_standard_features_, grk::FileFormatJP2Family::numcl, grk::FileFormatJP2Family::numcomps, grk::FileFormatJP2Family::numUuids, grk::FileFormatJP2Family::precedence, rreq_standard_features_, transcode_mode_, transcode_prog_order_, transcode_src_, grk::FileFormatJP2Family::UnkC, grk::FileFormatJP2Family::uuids, grk::FileFormatJP2Family::w, write_eph_transcode_, write_plt_transcode_, write_rreq_, write_sop_transcode_, write_tlm_transcode_, grk::FileFormatJP2Family::xml, and grk::XMP_UUID.

Referenced by grk::FileFormatMJ2Compress::init().

◆ init_end_header_writing()

void grk::FileFormatJP2Compress::init_end_header_writing ( void )
private

◆ init_header_writing()

◆ skip_jp2c()

bool grk::FileFormatJP2Compress::skip_jp2c ( void )
private

◆ start()

◆ transcode()

◆ transcodeCodestream()

◆ write_asoc_boxes()

bool grk::FileFormatJP2Compress::write_asoc_boxes ( void )
private

◆ write_bpc()

uint8_t * grk::FileFormatJP2Compress::write_bpc ( uint32_t * p_nb_bytes_written)
private

◆ write_channel_definition()

uint8_t * grk::FileFormatJP2Compress::write_channel_definition ( uint32_t * p_nb_bytes_written)
private

◆ write_colr()

◆ write_component_mapping()

uint8_t * grk::FileFormatJP2Compress::write_component_mapping ( uint32_t * p_nb_bytes_written)
private

◆ write_ftyp()

bool grk::FileFormatJP2Compress::write_ftyp ( void )
private

◆ write_ihdr()

◆ write_ipr()

bool grk::FileFormatJP2Compress::write_ipr ( void )
private

◆ write_jp2c()

bool grk::FileFormatJP2Compress::write_jp2c ( void )
private

◆ write_jp2h()

◆ write_palette_clr()

uint8_t * grk::FileFormatJP2Compress::write_palette_clr ( uint32_t * p_nb_bytes_written)
private

◆ write_res()

◆ write_res_box()

void grk::FileFormatJP2Compress::write_res_box ( double resx,
double resy,
uint32_t box_id,
uint8_t ** current_res_ptr )
private

◆ write_rreq()

bool grk::FileFormatJP2Compress::write_rreq ( void )
private

◆ write_signature()

bool grk::FileFormatJP2Compress::write_signature ( void )
private

◆ write_uuids()

bool grk::FileFormatJP2Compress::write_uuids ( void )
private

◆ write_xml()

uint8_t * grk::FileFormatJP2Compress::write_xml ( uint32_t * p_nb_bytes_written)
private

◆ write_xml_boxes()

◆ writeAsocBox()

Member Data Documentation

◆ codeStream

◆ codestream_offset

uint64_t grk::FileFormatJP2Compress::codestream_offset = 0
private

Referenced by skip_jp2c(), and write_jp2c().

◆ geoboxes_after_jp2c_

bool grk::FileFormatJP2Compress::geoboxes_after_jp2c_ = false
private

◆ inputImage_

GrkImage* grk::FileFormatJP2Compress::inputImage_ = nullptr
protected

◆ jpx_branding_

bool grk::FileFormatJP2Compress::jpx_branding_ = false
private

Referenced by init().

◆ max_layers_transcode_

uint16_t grk::FileFormatJP2Compress::max_layers_transcode_ = 0
private

◆ max_res_transcode_

uint8_t grk::FileFormatJP2Compress::max_res_transcode_ = 0
private

◆ needs_xl_jp2c_box_length

bool grk::FileFormatJP2Compress::needs_xl_jp2c_box_length = false
private

Referenced by skip_jp2c(), start(), and write_jp2c().

◆ num_rreq_standard_features_

uint8_t grk::FileFormatJP2Compress::num_rreq_standard_features_ = 0
private

Referenced by init(), and write_rreq().

◆ rreq_standard_features_

uint16_t grk::FileFormatJP2Compress::rreq_standard_features_[8] = {}
private

Referenced by init(), and write_rreq().

◆ transcode_mode_

bool grk::FileFormatJP2Compress::transcode_mode_ = false
private

Referenced by init(), and start().

◆ transcode_prog_order_

GRK_PROG_ORDER grk::FileFormatJP2Compress::transcode_prog_order_ = GRK_PROG_UNKNOWN
private

◆ transcode_src_

grk_stream_params grk::FileFormatJP2Compress::transcode_src_ {}
private

Referenced by init(), and transcodeCodestream().

◆ write_eph_transcode_

bool grk::FileFormatJP2Compress::write_eph_transcode_ = false
private

◆ write_plt_transcode_

bool grk::FileFormatJP2Compress::write_plt_transcode_ = false
private

◆ write_rreq_

bool grk::FileFormatJP2Compress::write_rreq_ = false
private

◆ write_sop_transcode_

bool grk::FileFormatJP2Compress::write_sop_transcode_ = false
private

◆ write_tlm_transcode_

bool grk::FileFormatJP2Compress::write_tlm_transcode_ = false
private

Referenced by init(), and transcode().


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