grk::FileFormatCompress Class Reference

`#include <FileFormatCompress.h>`

Inheritance diagram for grk::FileFormatCompress:

## Public Member Functions

| FileFormatCompress (BufferedStream *stream)
virtual | ~FileFormatCompress ()
bool | init (grk_cparameters *p_param, GrkImage *p_image)
bool | start (void)
bool | compress (grk_plugin_tile *tile)
Public Member Functions inherited from grk::FileFormat
| FileFormat (void)
virtual | ~FileFormat ()
Public Member Functions inherited from grk::ICodeStreamCompress
virtual | ~ICodeStreamCompress ()=default

## Private Member Functions

bool | end (void)
grk_color * | getColour (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_colr (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)
uint8_t * | write_ihdr (uint32_t *p_nb_bytes_written)
uint8_t * | write_buffer (uint32_t boxId, grk_buf8 *buffer, uint32_t *p_nb_bytes_written)
bool | write_uuids (void)
bool | write_ftyp (void)
bool | write_jp2c (void)
bool | write_jp (void)
bool | default_validation (void)
void | init_header_writing ()
void | init_end_header_writing (void)
void | init_compressValidation (void)
uint8_t * | write_xml (uint32_t *p_nb_bytes_written)
bool | skip_jp2c (void)

## Private Attributes

CodeStreamCompress * | codeStream
bool | needs_xl_jp2c_box_length
uint64_t | j2k_codestream_offset
GrkImage * | inputImage_

## Additional Inherited Members

Protected Member Functions inherited from grk::FileFormat
bool | exec (std::vector< PROCEDURE_FUNC > *procs)
Protected Attributes inherited from grk::FileFormat
std::vector< PROCEDURE_FUNC > * | validation_list_
| list of validation procedures
std::vector< PROCEDURE_FUNC > * | procedure_list_
| list of execution procedures
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
uint32_t | brand
uint32_t | minversion
uint32_t | numcl
uint32_t * | cl
ComponentInfo * | comps
bool | has_capture_resolution
double | capture_resolution [2]
bool | has_display_resolution
double | display_resolution [2]
grk_buf8 | xml
UUIDBox | uuids [JP2_MAX_NUM_UUIDS]
uint32_t | numUuids

## Constructor & Destructor Documentation

## FileFormatCompress()

grk::FileFormatCompress::FileFormatCompress | ( | BufferedStream * | stream | ) |

## ~FileFormatCompress()

grk::FileFormatCompress::~FileFormatCompress | ( |  | ) |

virtual

References codeStream, grk_object_unref(), inputImage_, and _grk_image::obj.

## Member Function Documentation

## compress()

bool grk::FileFormatCompress::compress | ( | grk_plugin_tile * | tile | ) |

virtual

Implements grk::ICodeStreamCompress.

References codeStream, grk::CodeStreamCompress::compress(), end(), and grk::grk_read().

## default_validation()

bool grk::FileFormatCompress::default_validation | ( | void |  | ) |

private

References grk::FileFormat::bpc, codeStream, grk::FileFormat::comps, grk::CodeStream::getStream(), grk::grk_read(), grk::maxPrecisionJ2K, grk::FileFormat::meth, grk::FileFormat::numcomps, grk::FileFormat::procedure_list_, and grk::FileFormat::validation_list_.

Referenced by init_compressValidation().

## end()

bool grk::FileFormatCompress::end | ( | void |  | ) |

private

References grk::FileFormat::exec(), init_end_header_writing(), and grk::FileFormat::procedure_list_.

Referenced by compress(), and write_ftyp().

## find_cf()

void grk::FileFormatCompress::find_cf | ( | double | x,
|  | uint16_t * | num,
|  | uint16_t * | den
| ) |  |

private

References grk::grk_read().

Referenced by write_res_box().

## getColour()

grk_color * grk::FileFormatCompress::getColour | ( | void |  | ) |

private

References _grk_image_meta::color, inputImage_, and _grk_image::meta.

Referenced by init(), write_channel_definition(), write_colr(), write_component_mapping(), write_jp2h(), and write_palette_clr().

## init()

bool grk::FileFormatCompress::init | ( | grk_cparameters * | p_param,
|  | GrkImage * | p_image
| ) |  |

virtual

Implements grk::ICodeStreamCompress.

References grk::FileFormat::approx, _grk_channel_description::asoc, _grk_image_comp::association, grk::ComponentInfo::bpc, grk::FileFormat::bpc, grk::FileFormat::brand, grk::FileFormat::C, grk::FileFormat::capture_resolution, _grk_channel_description::channel, _grk_color::channel_definition, grk::FileFormat::cl, codeStream, _grk_image::color_space, grk::FileFormat::comps, _grk_image::comps, _grk_channel_definition::descriptions, grk::FileFormat::display_resolution, grk::FileFormat::enumcs, getColour(), 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::GRK_ERROR(), grk_image_meta_new(), grk::grk_malloc(), grk_object_ref(), grk::grk_read(), grk::GRK_WARN(), grk::FileFormat::h, grk::FileFormat::has_capture_resolution, grk::FileFormat::has_display_resolution, grk::CodeStreamCompress::init(), inputImage_, grk::FileFormat::IPR, _grk_image_meta::iptc_buf, _grk_image_meta::iptc_len, grk::IPTC_UUID, JP2_JP2, _grk_image::meta, grk::FileFormat::meth, grk::FileFormat::minversion, grk::MycmsLogErrorHandlerFunction(), _grk_channel_definition::num_channel_descriptions, grk::FileFormat::numcl, grk::FileFormat::numcomps, _grk_image::numcomps, grk::FileFormat::numUuids, _grk_image::obj, _grk_image_comp::prec, grk::FileFormat::precedence, _grk_image_comp::sgnd, _grk_channel_description::typ, _grk_image_comp::type, grk::FileFormat::UnkC, grk::FileFormat::uuids, grk::GrkImage::validateICC(), grk::FileFormat::w, _grk_image::x0, _grk_image::x1, _grk_image_meta::xmp_buf, _grk_image_meta::xmp_len, grk::XMP_UUID, _grk_image::y0, and _grk_image::y1.

## init_compressValidation()

void grk::FileFormatCompress::init_compressValidation | ( | void |  | ) |

private

References default_validation(), and grk::FileFormat::validation_list_.

Referenced by start().

## init_end_header_writing()

void grk::FileFormatCompress::init_end_header_writing | ( | void |  | ) |

private

References grk::FileFormat::procedure_list_, and write_jp2c().

Referenced by end().

## init_header_writing()

void grk::FileFormatCompress::init_header_writing | ( | void |  | ) |

private

References grk::FileFormat::procedure_list_, skip_jp2c(), write_ftyp(), write_jp(), write_jp2h(), and write_uuids().

Referenced by start().

## skip_jp2c()

bool grk::FileFormatCompress::skip_jp2c | ( | void |  | ) |

private

References codeStream, grk::CodeStream::getStream(), grk::grk_read(), j2k_codestream_offset, and needs_xl_jp2c_box_length.

Referenced by init_header_writing().

## start()

bool grk::FileFormatCompress::start | ( | void |  | ) |

virtual

Implements grk::ICodeStreamCompress.

References codeStream, _grk_image::comps, grk::FileFormat::exec(), grk::CodeStream::getHeaderImage(), grk::grk_read(), init_compressValidation(), init_header_writing(), needs_xl_jp2c_box_length, grk::FileFormat::procedure_list_, grk::CodeStreamCompress::start(), grk::FileFormat::validation_list_, and _grk_image_comp::w.

## write_bpc()

uint8_t * grk::FileFormatCompress::write_bpc | ( | uint32_t * | p_nb_bytes_written | ) |

private

References grk::FileFormat::bpc, grk::FileFormat::comps, grk::grk_calloc(), grk::grk_read(), grk::grk_write(), JP2_BPCC, and grk::FileFormat::numcomps.

Referenced by write_jp2h().

## write_buffer()

uint8_t * grk::FileFormatCompress::write_buffer | ( | uint32_t | boxId,
|  | grk_buf8 * | buffer,
|  | uint32_t * | p_nb_bytes_written
| ) |  |

private

References grk::grk_buf< T, A >::buf, grk::grk_calloc(), grk::grk_read(), and grk::grk_buf< T, A >::len.

Referenced by write_xml().

## write_channel_definition()

uint8_t * grk::FileFormatCompress::write_channel_definition | ( | uint32_t * | p_nb_bytes_written | ) |

private

References _grk_color::channel_definition, getColour(), grk::grk_malloc(), grk::grk_read(), JP2_CDEF, and _grk_channel_definition::num_channel_descriptions.

Referenced by write_jp2h().

## write_colr()

uint8_t * grk::FileFormatCompress::write_colr | ( | uint32_t * | p_nb_bytes_written | ) |

private

References grk::FileFormat::approx, grk::FileFormat::enumcs, getColour(), grk::grk_calloc(), grk::grk_read(), _grk_color::icc_profile_len, JP2_COLR, grk::FileFormat::meth, and grk::FileFormat::precedence.

Referenced by write_jp2h().

## write_component_mapping()

uint8_t * grk::FileFormatCompress::write_component_mapping | ( | uint32_t * | p_nb_bytes_written | ) |

private

References getColour(), grk::grk_malloc(), grk::grk_read(), JP2_CMAP, _grk_palette_data::num_channels, and _grk_color::palette.

Referenced by write_jp2h().

## write_ftyp()

bool grk::FileFormatCompress::write_ftyp | ( | void |  | ) |

private

References grk::FileFormat::brand, grk::FileFormat::cl, codeStream, end(), grk::CodeStream::getStream(), grk::GRK_ERROR(), grk::grk_read(), JP2_FTYP, grk::FileFormat::minversion, and grk::FileFormat::numcl.

Referenced by init_header_writing().

## write_ihdr()

uint8_t * grk::FileFormatCompress::write_ihdr | ( | uint32_t * | p_nb_bytes_written | ) |

private

References grk::FileFormat::bpc, grk::FileFormat::C, grk::grk_calloc(), grk::grk_read(), grk::FileFormat::h, grk::FileFormat::IPR, JP2_IHDR, grk::FileFormat::numcomps, grk::FileFormat::UnkC, and grk::FileFormat::w.

Referenced by write_jp2h().

## write_jp()

bool grk::FileFormatCompress::write_jp | ( | void |  | ) |

private

References codeStream, grk::CodeStream::getStream(), grk::grk_read(), and JP2_JP.

Referenced by init_header_writing().

## write_jp2c()

bool grk::FileFormatCompress::write_jp2c | ( | void |  | ) |

private

References codeStream, grk::CodeStream::getStream(), grk::GRK_ERROR(), grk::grk_read(), j2k_codestream_offset, JP2_JP2C, and needs_xl_jp2c_box_length.

Referenced by init_end_header_writing().

## write_jp2h()

bool grk::FileFormatCompress::write_jp2h | ( | void |  | ) |

private

References grk::FileFormat::bpc, grk::grk_buf< T, A >::buf, grk::FileFormat::capture_resolution, codeStream, grk::FileFormat::display_resolution, getColour(), grk::CodeStream::getStream(), grk::GRK_ERROR(), grk::grk_free(), grk::grk_read(), grk::FileFormat::has_capture_resolution, grk::FileFormat::has_display_resolution, inputImage_, JP2_JP2H, grk::grk_buf< T, A >::len, _grk_image::meta, write_bpc(), write_channel_definition(), write_colr(), write_component_mapping(), write_ihdr(), write_palette_clr(), write_res(), write_xml(), and grk::FileFormat::xml.

Referenced by init_header_writing().

## write_palette_clr()

uint8_t * grk::FileFormatCompress::write_palette_clr | ( | uint32_t * | p_nb_bytes_written | ) |

private

References getColour(), grk::grk_malloc(), grk::grk_read(), JP2_PCLR, and _grk_color::palette.

Referenced by write_jp2h().

## write_res()

uint8_t * grk::FileFormatCompress::write_res | ( | uint32_t * | p_nb_bytes_written | ) |

private

References grk::FileFormat::capture_resolution, grk::FileFormat::display_resolution, grk::grk_calloc(), grk::grk_read(), GRK_RESOLUTION_BOX_SIZE, JP2_CAPTURE_RES, JP2_DISPLAY_RES, JP2_RES, and write_res_box().

Referenced by write_jp2h().

## write_res_box()

void grk::FileFormatCompress::write_res_box | ( | double | resx,
|  | double | resy,
|  | uint32_t | box_id,
|  | uint8_t ** | current_res_ptr
| ) |  |

private

References find_cf(), grk::grk_read(), and GRK_RESOLUTION_BOX_SIZE.

Referenced by write_res().

## write_uuids()

bool grk::FileFormatCompress::write_uuids | ( | void |  | ) |

private

References codeStream, grk::CodeStream::getStream(), grk::grk_read(), JP2_UUID, grk::FileFormat::numUuids, and grk::FileFormat::uuids.

Referenced by init_header_writing().

## write_xml()

uint8_t * grk::FileFormatCompress::write_xml | ( | uint32_t * | p_nb_bytes_written | ) |

private

References grk::grk_read(), JP2_XML, write_buffer(), and grk::FileFormat::xml.

Referenced by write_jp2h().

## Member Data Documentation

## codeStream

CodeStreamCompress* grk::FileFormatCompress::codeStream

private

Referenced by compress(), default_validation(), init(), skip_jp2c(), start(), write_ftyp(), write_jp(), write_jp2c(), write_jp2h(), write_uuids(), and ~FileFormatCompress().

## inputImage_

GrkImage* grk::FileFormatCompress::inputImage_

private

Referenced by getColour(), init(), write_jp2h(), and ~FileFormatCompress().

## j2k_codestream_offset

uint64_t grk::FileFormatCompress::j2k_codestream_offset

private

Referenced by skip_jp2c(), and write_jp2c().

## needs_xl_jp2c_box_length

bool grk::FileFormatCompress::needs_xl_jp2c_box_length

private

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

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

- FileFormatCompress.h
- FileFormatCompress.cpp