31 using namespace kdu_supp;
42 class JP2_Encoder_Error;
90 static const char*
const
94 static const unsigned int
97 static const unsigned int
100 static const unsigned int
104 static const char*
const
107 static const char*
const
113 static const char*
const
151 {
return Image_Source;}
171 {
return JP2_Pathname;}
179 {JP2_Pathname = pathname;
return *
this;}
188 {
return PDS_Label_Pathname;}
203 {PDS_Label_Pathname = pathname;
return *
this;}
212 {
return Image_Offset;}
221 {Image_Offset = file_offset;
return *
this;}
229 {
return Image_Bands;}
237 {Image_Bands = bands;
return *
this;}
263 {
return Pixel_Bytes;}
278 JP2_Encoder& pixel_bytes (
unsigned int bytes_per_pixel);
302 JP2_Encoder& pixel_bits (
unsigned int bits_per_pixel);
311 {
return Signed_Data;}
334 bool MSB_data ()
const;
358 {
return Swap_Pixel_Bytes;}
369 {Swap_Pixel_Bytes = swap_data;
return *
this;}
378 {
return Line_Prefix_Bytes;}
387 {Line_Prefix_Bytes = prefix_bytes;
return *
this;}
396 {
return Line_Suffix_Bytes;}
405 {Line_Suffix_Bytes = suffix_bytes;
return *
this;}
426 {Tile_Size = size;
return *
this;}
437 {
return Resolution_Levels;}
451 JP2_Encoder& resolution_levels (
unsigned int resolution_levels);
459 {
return Quality_Layers;}
472 JP2_Encoder& quality_layers (
unsigned int quality_layers);
505 {
return Progression_Order;}
527 JP2_Encoder& progression_order (
const std::string& progression);
537 {
return Precinct_Sizes;}
549 (
unsigned int resolution_level = 0)
const;
569 (
const std::vector<Size_2D>& sizes);
581 (
const Size_2D& size,
unsigned int resolution_level = 0);
589 {
return Code_Block_Size;}
608 {
return Added_Boxes;}
629 bool remove_box (
JP2_Box* box);
640 {
return Producer_UUID;}
658 JP2_Encoder& producer_UUID (
const unsigned char*
id);
677 {Comment = text;
return *
this;}
693 std::string reasons ()
const;
727 JP2_Encoder_Error* encoder_error ()
const;
759 long long write_header ();
771 long long write_user_boxes ();
776 long long write_codestream ();
824 {Incremental_Flush_Bytes = ((bytes < 0) ? 0 : bytes);
return *
this;}
835 {
return Incremental_Flush_Bytes;}
855 JP2_Encoder& incremental_flush_lines (
unsigned int lines);
875 int incremental_flush_lines ()
const;
891 invalid_precinct_size (
const std::vector<Size_2D>& sizes);
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);
1025 std::vector<Size_2D>
1049 *JPEG2000_Codestream;
1058 #ifndef DOXYGEN_PROCESSING
1062 class JP2_Encoder_Error
1063 :
public kdu_thread_safe_message
1067 void put_text (
const char* message);
1068 void add_text (
const std::string& message);
1069 void flush (
bool end_of_message =
false);
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
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
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
unsigned char * Producer_UUID
The UUID to be placed in a UUID List box inside a UUID Info box.
Definition: JP2_Encoder.hh:992
unsigned int Line_Prefix_Bytes
The number of bytes preceeding and following each line of pixel bytes.
Definition: JP2_Encoder.hh:964
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
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
unsigned int Line_Suffix_Bytes
Definition: JP2_Encoder.hh:965
unsigned int Pixel_Bytes
Pixel datum size in bytes.
Definition: JP2_Encoder.hh:969
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
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
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
static const unsigned int MAX_QUALITY_LAYERS
Maximum number of quality layers.
Definition: JP2_Encoder.hh:101
JP2_Encoder & destination(const std::string &pathname)
Set the destination JP2 file pathname.
Definition: JP2_Encoder.hh:178
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
static const unsigned int DEFAULT_RESOLUTION_LEVELS
Default number of resolution levels.
Definition: JP2_Encoder.hh:95
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
JP2_Encoder & comment(const std::string &text)
Set comment text to be added to the codestream.
Definition: JP2_Encoder.hh:676
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
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
JP2_Encoder & image_bands(unsigned int bands)
Set the number of bands (components) in the PDS image.
Definition: JP2_Encoder.hh:236
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
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
const std::vector< Size_2D > precinct_sizes() const
Get the precinct sizes for each resolution level.
Definition: JP2_Encoder.hh:536
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
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
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
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
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
bool Swap_Pixel_Bytes
Whether pixel bytes should be reordered before be encoded.
Definition: JP2_Encoder.hh:1000
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
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
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_prefix_bytes(unsigned int prefix_bytes)
Set the number of bytes preceeding each line of image pixel data.
Definition: JP2_Encoder.hh:386
JP2_Encoder & PDS_label_pathname(const std::string &pathname)
Set the PDS/JP2 label file pathname.
Definition: JP2_Encoder.hh:202
JP2_Encoder & tile_size(const Size_2D &size)
Set the size of the JP2 image tiles.
Definition: JP2_Encoder.hh:425
static const char *const UUID_BOX_NAME
Data provider UUID JP2 box name.
Definition: JP2_Encoder.hh:108
const unsigned char * producer_UUID() const
Get the product producer signature UUID value.
Definition: JP2_Encoder.hh:639
static const char *const ID
Class identification name with source code version and date.
Definition: JP2_Encoder.hh:91
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
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