30 using namespace kdu_supp;
40 class JP2_Decoder_Error;
80 static const char*
const
84 static const char*
const
87 static const char*
const
92 static const char*
const
129 {
return JP2_Pathname;}
160 {
return Image_Size.Width;}
168 {
return Image_Size.Height;}
176 {
return Image_Bands;}
191 {
return Resolution_Levels;}
199 {
return Pixel_Bytes;}
216 {
return Signed_Data;}
230 {
return UUID_Info_UUID;}
241 {
return UUID_Info_URL;}
252 {
return Image_Destination;}
260 {Image_Destination = pathname;
return *
this;}
270 Size_2D rendered_size ()
const;
278 unsigned int rendered_width ()
const;
286 unsigned int rendered_height ()
const;
302 {
return Image_Region;}
336 JP2_Decoder& image_region (
int x,
int y,
int width,
int height);
344 {
return Resolution_Level;}
362 JP2_Decoder& resolution_level (
unsigned int level);
370 {
return Swap_Pixel_Bytes;}
383 {Swap_Pixel_Bytes = swap_data;
return *
this;}
391 {
return Bytes_Written;}
412 std::string reasons ()
const;
424 unsigned long long decode ();
455 bool is_open ()
const;
474 unsigned long long write_image_data ();
490 JP2_Decoder_Error* decoder_error ()
const;
520 std::streamsize write_stripe
521 (std::ostream& destination, std::streamoff file_offset,
522 int band,
int line,
int lines, kdu_int16* buffer);
547 std::streamsize write_stripe
548 (std::ostream& destination, std::streamoff file_offset,
549 int band,
int line,
int lines, kdu_int32* buffer);
587 set_resolution_and_region
588 (
unsigned int level,
const Rectangle& region);
691 *JPEG2000_Codestream;
701 #ifndef DOXYGEN_PROCESSING
705 class JP2_Decoder_Error
706 :
public kdu_thread_safe_message
710 void put_text (
const char* message);
711 void flush (
bool end_of_message =
false);
A JP2_Decoder decodes image pixel data from a JPEG2000 JP2 image file.
Definition: JP2_Decoder.hh:74
Rectangle Image_Region
Image region to be rendered.
Definition: JP2_Decoder.hh:659
std::string destination() const
Get the destination file pathname for the rendered image data.
Definition: JP2_Decoder.hh:251
bool signed_data() const
Get the signedness of the pixel data.
Definition: JP2_Decoder.hh:215
bool Signed_Data
Whether pixel data is signed.
Definition: JP2_Decoder.hh:619
unsigned char * UUID_Info_UUID
First UUID value found in a UUID List box of a UUID Info super box.
Definition: JP2_Decoder.hh:640
unsigned int pixel_bytes() const
Get the number of bytes per pixel.
Definition: JP2_Decoder.hh:198
unsigned int image_height() const
Get the height of the JP2 source image.
Definition: JP2_Decoder.hh:167
unsigned int image_width() const
Get the width of the JP2 source image.
Definition: JP2_Decoder.hh:159
unsigned int resolution_levels() const
Get the total number of codestream resolution levels.
Definition: JP2_Decoder.hh:190
static const char *const UUID_INFO_BOX_NAME
PDS label reference information UUID Info JP2 container box name.
Definition: JP2_Decoder.hh:85
JP2_Decoder & destination(const std::string &pathname)
Set the destination file pathname for the rendered image data.
Definition: JP2_Decoder.hh:259
unsigned int Pixel_Bytes
Pixel datum size in bytes.
Definition: JP2_Decoder.hh:611
unsigned int Image_Bands
Total image bands (components).
Definition: JP2_Decoder.hh:603
unsigned long long bytes_written() const
Get the number of image data bytes written.
Definition: JP2_Decoder.hh:390
unsigned int resolution_level() const
Get the resolution level at which the codestream will be rendered.
Definition: JP2_Decoder.hh:343
Rectangle image_region() const
Get the image region that will be rendered from the JP2 source.
Definition: JP2_Decoder.hh:301
std::string JP2_Pathname
JP2 source pathname.
Definition: JP2_Decoder.hh:599
std::string source() const
Get the JP2 source pathname.
Definition: JP2_Decoder.hh:128
static const int MIN_STRIPE_HEIGHT
Image data stripe minimum and maximum number of lines.
Definition: JP2_Decoder.hh:97
static const char *const URL_BOX_NAME
PDS label relative filename URL JP2 box name.
Definition: JP2_Decoder.hh:93
std::string Image_Destination
Image data destination pathname.
Definition: JP2_Decoder.hh:651
unsigned int image_bands() const
Get the number of bands (components) in the JP2 image.
Definition: JP2_Decoder.hh:175
Size_2D image_size() const
Get the size of the JP2 source image.
Definition: JP2_Decoder.hh:151
unsigned int Resolution_Level
Resolution level to render.
Definition: JP2_Decoder.hh:667
Size_2D Rendered_Size
Rendered image size.
Definition: JP2_Decoder.hh:655
unsigned long long Bytes_Written
Total number of pixel bytes written.
Definition: JP2_Decoder.hh:675
unsigned int Resolution_Levels
Resolution levels available.
Definition: JP2_Decoder.hh:632
Size_2D Image_Size
Dimensions of the source image.
Definition: JP2_Decoder.hh:607
JP2_Decoder & swap_pixel_bytes(bool swap_data)
Sets whether multi-byte pixels will be reordered before being written.
Definition: JP2_Decoder.hh:382
std::string URL() const
Get the URL found in the JP2 source.
Definition: JP2_Decoder.hh:240
unsigned int Pixel_Bits
Pixel precision bits.
Definition: JP2_Decoder.hh:615
unsigned char *const producer_UUID() const
Get the UUID found in the JP2 source.
Definition: JP2_Decoder.hh:229
unsigned int pixel_bits() const
Get the pixel precision.
Definition: JP2_Decoder.hh:206
bool Swap_Pixel_Bytes
Whether pixel bytes should be reordered when written.
Definition: JP2_Decoder.hh:671
bool swap_pixel_bytes() const
Tests if multi-byte pixels will be reordered before being written.
Definition: JP2_Decoder.hh:369
std::string UUID_Info_URL
First URL value found in a URL box of a UUID Info super box.
Definition: JP2_Decoder.hh:644
static const int MAX_STRIPE_HEIGHT
Definition: JP2_Decoder.hh:98
static const int DECODER_EXCEPTION
JP2_Decoder_Error exception signal value.
Definition: JP2_Decoder.hh:102
static const char *const UUID_BOX_NAME
Data provider UUID JP2 box name.
Definition: JP2_Decoder.hh:88
static const char *const ID
Class identification name with source code version and date.
Definition: JP2_Decoder.hh:81
Definition: Dimensions.cc:30
A Rectangle is a position with a size.
Definition: Dimensions.hh:223
A Size_2D holds 2-dimensional size information.
Definition: Dimensions.hh:119