31using namespace kdu_supp;
42class JP2_Encoder_Error;
90static const char*
const
94static const unsigned int
97static const unsigned int
100static const unsigned int
104static const char*
const
107static const char*
const
113static const char*
const
549 (
unsigned int resolution_level = 0)
const;
569 (
const std::vector<Size_2D>& sizes);
581 (
const Size_2D& size,
unsigned int resolution_level = 0);
677 {
Comment = text;
return *
this;}
911 (std::istream&
source,
int band,
int line,
int lines, kdu_int16* buffer);
929 (std::istream&
source,
int band,
int line,
int lines, kdu_int32* buffer);
1049 *JPEG2000_Codestream;
1058#ifndef DOXYGEN_PROCESSING
1062class JP2_Encoder_Error
1063:
public kdu_thread_safe_message
1067void put_text (
const char* message);
1068void add_text (
const std::string& message);
1069void flush (
bool end_of_message =
false);
JP2_Encoder()
Definition JP2_Encoder.cc:136
A JP2_Box contains JP2 file format box data.
Definition JP2_Box.hh:40
std::vector< JP2_Box * > JP2_Box_List
List of JP2 boxes.
Definition JP2_Box.hh:46
A JP2_Encoder encodes image pixel data into a JPEG2000 JP2 file.
Definition JP2_Encoder.hh:84
long long close()
Definition JP2_Encoder.cc:1501
std::string destination() const
Get the destination JP2 file pathname.
Definition JP2_Encoder.hh:170
unsigned int line_prefix_bytes() const
Get the number of bytes preceeding each line of image pixel data.
Definition JP2_Encoder.hh:377
static const int NEEDS_DESTINATION
Definition JP2_Encoder.hh:127
double bit_rate() const
Get the codestream compression bit-rate.
Definition JP2_Encoder.hh:480
std::string comment() const
Get the codestream comment.
Definition JP2_Encoder.hh:666
static const unsigned int MAX_RESOLUTION_LEVELS
Maximum number of resolution levels.
Definition JP2_Encoder.hh:98
JP2_Encoder & comment(const std::string &text)
Set comment text to be added to the codestream.
Definition JP2_Encoder.hh:676
std::streamoff Image_Offset
Image data location as a byte offset within the source file.
Definition JP2_Encoder.hh:948
bool signed_data() const
Get the signedness of the pixel data.
Definition JP2_Encoder.hh:310
bool Signed_Data
Whether pixel data is to be treated as signed.
Definition JP2_Encoder.hh:977
const Size_2D image_size() const
Get the size of the source PDS image data.
Definition JP2_Encoder.hh:244
unsigned int pixel_bytes() const
Get the number of bytes per pixel.
Definition JP2_Encoder.hh:262
JP2_Encoder & swap_pixel_bytes(bool swap_data)
Set if multi-byte pixels will be reordered before being sent to the JPEG2000 codestream generation ma...
Definition JP2_Encoder.hh:368
JP2_Encoder_Error * encoder_error() const
Get the JP2_Encoder_Error describing the last encoder error that occurred.
Definition JP2_Encoder.cc:1579
unsigned char * Producer_UUID
The UUID to be placed in a UUID List box inside a UUID Info box.
Definition JP2_Encoder.hh:992
const std::vector< Size_2D > precinct_sizes() const
Get the precinct sizes for each resolution level.
Definition JP2_Encoder.hh:536
unsigned int Line_Prefix_Bytes
The number of bytes preceeding and following each line of pixel bytes.
Definition JP2_Encoder.hh:964
std::string reasons() const
Get a description of the reasons that the encoder is not ready.
Definition JP2_Encoder.cc:1553
std::string Image_Source
Image source pathname.
Definition JP2_Encoder.hh:940
unsigned int resolution_levels() const
Get the total number of codestream resolution levels.
Definition JP2_Encoder.hh:436
JP2_Encoder & image_data_location(std::streamoff file_offset)
Set the location of the image data in the source file.
Definition JP2_Encoder.hh:220
std::string PDS_Label_Pathname
PDS label file pathname to be placed in a UUID Info URL box.
Definition JP2_Encoder.hh:988
static const char *const UUID_INFO_BOX_NAME
PDS label reference information UUID Info JP2 container box name.
Definition JP2_Encoder.hh:105
std::string Comment
Comment segment to be added to the codestream.
Definition JP2_Encoder.hh:996
JP2_Encoder & image_bands(unsigned int bands)
Set the number of bands (components) in the PDS image.
Definition JP2_Encoder.hh:236
unsigned int Line_Suffix_Bytes
Definition JP2_Encoder.hh:965
unsigned int Pixel_Bytes
Pixel datum size in bytes.
Definition JP2_Encoder.hh:969
const Size_2D code_block_size() const
Get the code block size.
Definition JP2_Encoder.hh:588
unsigned int Image_Bands
Total image bands (components).
Definition JP2_Encoder.hh:952
static const unsigned int MAX_QUALITY_LAYERS
Maximum number of quality layers.
Definition JP2_Encoder.hh:101
bool MSB_data() const
Test if the source data will be treated as MSB ordered.
Definition JP2_Encoder.cc:361
std::string progression_order() const
Get the codestream progression order descriptor.
Definition JP2_Encoder.hh:504
static const int NEEDS_SOURCE
What the encoder needs to do its job.
Definition JP2_Encoder.hh:126
JP2_Box::JP2_Box_List Added_Boxes
Definition JP2_Encoder.hh:981
unsigned int quality_layers() const
Get the number of codestream quality layers.
Definition JP2_Encoder.hh:458
JP2_Encoder & PDS_label_pathname(const std::string &pathname)
Set the PDS/JP2 label file pathname.
Definition JP2_Encoder.hh:202
JP2_Box::JP2_Box_List & added_boxes()
Get the list of user specified data boxes added to the JP2 file.
Definition JP2_Encoder.hh:607
static const unsigned int DEFAULT_RESOLUTION_LEVELS
Default number of resolution levels.
Definition JP2_Encoder.hh:95
JP2_Encoder()
Definition JP2_Encoder.cc:136
JP2_Encoder & incremental_flush_bytes(long long bytes)
Set the rate at which compressed image data will be written to the output JP2 file.
Definition JP2_Encoder.hh:823
std::vector< Size_2D > Precinct_Sizes
Precinct sizes for codestream structure organization within tiles.
Definition JP2_Encoder.hh:1026
std::string JP2_Pathname
Image destination pathname.
Definition JP2_Encoder.hh:944
long long incremental_flush_bytes() const
Get the rate at which compressed image data will be written to the output JP2 file.
Definition JP2_Encoder.hh:834
std::string source() const
Get the PDS image data source pathname.
Definition JP2_Encoder.hh:150
int needs() const
Indicates what the encoder needs to do its job.
Definition JP2_Encoder.cc:1535
static const int UUID_SIZE
Size of the UUID data content.
Definition JP2_Encoder.hh:111
static const int MIN_STRIPE_HEIGHT
Image data stripe minimum and maximum number of lines.
Definition JP2_Encoder.hh:118
static const char *const URL_BOX_NAME
PDS label relative filename URL JP2 box name.
Definition JP2_Encoder.hh:114
const unsigned char * producer_UUID() const
Get the product producer signature UUID value.
Definition JP2_Encoder.hh:639
unsigned int image_bands() const
Get the number of bands (components) in the PDS image.
Definition JP2_Encoder.hh:228
std::string PDS_label_pathname() const
Get the PDS/JP2 label file pathname.
Definition JP2_Encoder.hh:187
long long Incremental_Flush_Bytes
Definition JP2_Encoder.hh:1033
long long write_user_boxes()
Write user specified boxes to the JP2 file.
Definition JP2_Encoder.cc:1165
void open()
Open the source JP2 file.
Definition JP2_Encoder.cc:880
static const int NEEDS_IMAGE
Definition JP2_Encoder.hh:128
std::streamoff image_data_location() const
Get the location of the image data in the source file.
Definition JP2_Encoder.hh:211
double Bit_Rate
Definition JP2_Encoder.hh:1014
unsigned int Resolution_Levels
The number of resolution levels to encode.
Definition JP2_Encoder.hh:1008
JP2_Encoder & add_box(JP2_Box *box)
Add a data box to the JP2 file.
Definition JP2_Encoder.cc:204
std::string Progression_Order
The codestream progression order to be used.
Definition JP2_Encoder.hh:1018
Size_2D Image_Size
Definition JP2_Encoder.hh:956
long long write_codestream()
Generate the compressed image data JPEG2000 codestream and write it to the JP2 file.
Definition JP2_Encoder.cc:1230
const Size_2D precinct_size(unsigned int resolution_level=0) const
Get the precinct size for a given resolution level.
Definition JP2_Encoder.cc:510
~JP2_Encoder()
Definition JP2_Encoder.cc:172
Size_2D Code_Block_Size
Code block size for codestream packet encoding within precincts.
Definition JP2_Encoder.hh:1030
unsigned int Pixel_Bits
Pixel precision bits.
Definition JP2_Encoder.hh:973
bool remove_box(JP2_Box *box)
Remove a data box from the list of user specified boxes.
Definition JP2_Encoder.cc:219
const Size_2D tile_size() const
Get the size of the JP2 image tiles.
Definition JP2_Encoder.hh:413
unsigned int pixel_bits() const
Get the pixel precision.
Definition JP2_Encoder.hh:285
Size_2D Tile_Size
Tile size for codestream structure organization.
Definition JP2_Encoder.hh:1022
long long encode()
Encode the image source to a JPEG2000 JP2 destination.
Definition JP2_Encoder.cc:852
bool Swap_Pixel_Bytes
Whether pixel bytes should be reordered before be encoded.
Definition JP2_Encoder.hh:1000
void read_stripe(std::istream &source, int band, int line, int lines, kdu_int16 *buffer)
Fill an image data buffer with pixel data from a source stream.
Definition JP2_Encoder.cc:1667
bool swap_pixel_bytes() const
Test if multi-byte pixels will be reordered before being sent to the JPEG2000 codestream generation m...
Definition JP2_Encoder.hh:357
long long write_header()
Write the required metadata boxes to the JP2 file.
Definition JP2_Encoder.cc:917
JP2_Encoder & destination(const std::string &pathname)
Set the destination JP2 file pathname.
Definition JP2_Encoder.hh:178
unsigned int line_suffix_bytes() const
Get the number of bytes following each line of image pixel data.
Definition JP2_Encoder.hh:395
static const int MAX_STRIPE_HEIGHT
Definition JP2_Encoder.hh:119
int incremental_flush_lines() const
Get the rate at which compressed image data will be written to the output JP2 file.
Definition JP2_Encoder.cc:1460
static const int ENCODER_EXCEPTION
JP2_Encoder_Error exception signal value.
Definition JP2_Encoder.hh:132
unsigned int Quality_Layers
Definition JP2_Encoder.hh:1011
JP2_Encoder & line_suffix_bytes(unsigned int suffix_bytes)
Set the number of bytes following each line of image pixel data.
Definition JP2_Encoder.hh:404
JP2_Encoder & tile_size(const Size_2D &size)
Set the size of the JP2 image tiles.
Definition JP2_Encoder.hh:425
bool ready() const
Test if the encoder is ready to compress the image data.
Definition JP2_Encoder.cc:1521
int invalid_precinct_size(const std::vector< Size_2D > &sizes)
Check for valid precinct sizes.
Definition JP2_Encoder.cc:553
static const char *const UUID_BOX_NAME
Data provider UUID JP2 box name.
Definition JP2_Encoder.hh:108
static const char *const ID
Class identification name with source code version and date.
Definition JP2_Encoder.hh:91
JP2_Encoder & line_prefix_bytes(unsigned int prefix_bytes)
Set the number of bytes preceeding each line of image pixel data.
Definition JP2_Encoder.hh:386
Definition Dimensions.cc:32
bool power_of_2(unsigned int value)
Test if a value is a power of 2.
Definition JP2_Encoder.cc:530
Definition Dimensions.cc:30
A Size_2D holds 2-dimensional size information.
Definition Dimensions.hh:119