Isis Developer Reference
|
Exports cubes into JPEG 2000 images. More...
#include <JP2Exporter.h>
Public Member Functions | |
JP2Exporter () | |
Construct the JPEG 2000 exporter. More... | |
virtual | ~JP2Exporter () |
Destruct the exporter. More... | |
virtual void | write (FileName outputName, int quality=100, QString compression="none") |
Initialize the encoder, open the output file for writing, then let the base ImageExporter handle the generic black-box writing routine. More... | |
virtual void | setGrayscale (ExportDescription &desc) |
Generic initialization with the export description. More... | |
virtual void | setRgb (ExportDescription &desc) |
Generic initialization with the export description. More... | |
virtual void | setRgba (ExportDescription &desc) |
Generic initialization with the export description. More... | |
void | operator() (vector< Buffer * > &in) const |
The method for writing a line of input image data (with potentially several bands representing color channels) to the output image. More... | |
int | samples () const |
Number of samples (columns) in the output image. More... | |
int | lines () const |
Number of lines (rows) in the output image. More... | |
int | bands () const |
Number of bands (channels) in the output image. More... | |
double | inputMinimum (int channel) const |
Returns the input minimum for the given channel. More... | |
double | inputMaximum (int channel) const |
Returns the input maximum for the given channel. More... | |
void | setOutputPixelRange (double outputPixelMinimum, double outputPixelMaximum) |
Set the DN floor and ceiling for the exported image. More... | |
Static Public Member Functions | |
static bool | canWriteFormat (QString format) |
Returns true if the format is "jp2". More... | |
static ImageExporter * | fromFormat (QString format) |
A static (factory) method for constructing an ImageExporter instance from an output format. More... | |
Protected Types | |
typedef void(ImageExporter::* | WriteChannels) (vector< Buffer * > &in) const |
Friendly alias for a method used to write a particular color channel. More... | |
Protected Member Functions | |
virtual void | createBuffer () |
Creates the buffer to store a chunk of streamed line data with one or more bands. More... | |
virtual void | setBuffer (int s, int b, int dn) const |
Set the DN value at the given sample and band of the line buffer. More... | |
virtual void | writeLine (int l) const |
Writes a line of buffered data to the output image on disk. More... | |
virtual void | initialize (ExportDescription &desc) |
Generic initialization with the export description. More... | |
virtual void | writeGrayscale (vector< Buffer * > &in) const |
Write a line of grayscale data to the output image. More... | |
virtual void | writeRgb (vector< Buffer * > &in) const |
Write a line of RGB data to the output image. More... | |
virtual void | writeRgba (vector< Buffer * > &in) const |
Write a line of RGBA data to the output image. More... | |
void | setExtension (QString extension) |
Sets the extension for the output image and generates the extension for the world file from it. More... | |
void | setExportDescription (ExportDescription &desc) |
Sets the description for the output image. More... | |
Cube * | initializeProcess () |
Sets up the export process with the parameters described within the given description. More... | |
QString | extension () const |
Gets the extension for the output image. More... | |
ExportDescription & | exportDescription () const |
Gets the description for the output image. More... | |
ProcessExport & | process () const |
Get a reference to the process object, useful for subclasses to access and manipulate the process. More... | |
PixelType | pixelType () const |
Returns the pixel type. More... | |
virtual int | outputPixelValue (double dn) const |
Return the output clamped integer pixel value from the input double-precision DN. More... | |
Exports cubes into JPEG 2000 images.
A streamed exporter for JPEG 2000 images. Can write an arbitrarily large set of single-band Isis cubes to an arbitrarily large JPEG 2000 image with the given pixel type.
|
protectedinherited |
Friendly alias for a method used to write a particular color channel.
Isis::JP2Exporter::JP2Exporter | ( | ) |
Construct the JPEG 2000 exporter.
References Isis::ImageExporter::setExtension().
|
virtual |
Destruct the exporter.
|
inherited |
Number of bands (channels) in the output image.
Referenced by Isis::QtExporter::checkDataSize(), createBuffer(), Isis::TiffExporter::createBuffer(), Isis::TiffExporter::setBuffer(), write(), and Isis::TiffExporter::write().
|
static |
Returns true if the format is "jp2".
format | Lowercase format abbreviation |
Referenced by Isis::ImageExporter::fromFormat().
|
protectedvirtual |
Creates the buffer to store a chunk of streamed line data with one or more bands.
Implements Isis::StreamExporter.
References Isis::ImageExporter::bands(), Isis::ImageExporter::pixelType(), Isis::ImageExporter::samples(), and Isis::UnsignedByte.
|
protectedinherited |
Gets the description for the output image.
|
protectedinherited |
Gets the extension for the output image.
Referenced by write(), Isis::QtExporter::write(), and Isis::TiffExporter::write().
|
staticinherited |
A static (factory) method for constructing an ImageExporter instance from an output format.
The specific subclass of the returned instance is determined from the desired output image format provided. Each subclass has knowledge of whether or not it can write a particular format. Because the ability to export an image format is not mutually exclusive amongst exporters, the order of condieration here matters. For example, using a TIFF exporter takes precedence over a Qt exporter for TIFF images, because the former can process cubes greater than 2GB while the latter cannot. It is the caller's responsibility to delete the exporter instance when they are finished with it.
format | The format for the output image to be created |
References _FILEINFO_, canWriteFormat(), Isis::QtExporter::canWriteFormat(), Isis::TiffExporter::canWriteFormat(), and Isis::IException::Programmer.
|
protectedvirtualinherited |
Generic initialization with the export description.
Set the input, set the pixel type, and create the buffer.
desc | Export description containing necessary channel information |
Implements Isis::ImageExporter.
References Isis::StreamExporter::createBuffer(), and Isis::ImageExporter::initialize().
Referenced by Isis::StreamExporter::setGrayscale(), Isis::StreamExporter::setRgb(), and Isis::StreamExporter::setRgba().
|
protectedinherited |
Sets up the export process with the parameters described within the given description.
This method determines determines whether to write the data as grayscale, RGB, or RGBA. It then opens a cube for retrieving the input data and establishing the dimensions of the output image. Next, the ProcessExport format is set to BIL and the ProcessExport output pixel type, output valid data range, and output null are set based on the given export description. Last, the absolute output pixel range is set based on the given description (this is the smallest and largest allowed pixel values in the output, including "special" pixel values).
References _FILEINFO_, Isis::ProcessExport::BIL, Isis::Cube::lineCount(), Isis::IException::Programmer, Isis::Cube::sampleCount(), Isis::ProcessExport::setFormat(), Isis::ProcessExport::SetOutputNull(), Isis::ProcessExport::SetOutputRange(), Isis::ProcessExport::SetOutputType(), Isis::ImageExporter::writeGrayscale(), Isis::ImageExporter::writeRgb(), and Isis::ImageExporter::writeRgba().
|
inherited |
Returns the input maximum for the given channel.
Any value of max in the input cube will be mapped to the output max of the output channel.
channel | Index of the channel within the process |
|
inherited |
Returns the input minimum for the given channel.
Any value of min in the input cube will be mapped to the output min of the output channel.
channel | Index of the channel within the process |
|
inherited |
Number of lines (rows) in the output image.
Referenced by Isis::QtExporter::checkDataSize(), Isis::QtExporter::setGrayscale(), Isis::QtExporter::setRgb(), Isis::QtExporter::setRgba(), write(), and Isis::TiffExporter::write().
|
inherited |
The method for writing a line of input image data (with potentially several bands representing color channels) to the output image.
It is called for each line of data in the input images (provides a vector containing the same line from each single-band input image). Enables the exporter to be used as a functor in a custom ProcessExport routine, bypassing the black-box write() method entirely.
in | Vector containing a line of input data from each input channel |
|
protectedvirtualinherited |
Return the output clamped integer pixel value from the input double-precision DN.
dn | The input DN |
Referenced by Isis::QtExporter::writeGrayscale(), Isis::StreamExporter::writeGrayscale(), Isis::QtExporter::writeRgb(), Isis::StreamExporter::writeRgb(), Isis::QtExporter::writeRgba(), and Isis::StreamExporter::writeRgba().
|
protectedinherited |
Returns the pixel type.
Defaults to None if not set by the user.
References Isis::None.
Referenced by createBuffer(), Isis::TiffExporter::createBuffer(), setBuffer(), Isis::TiffExporter::setBuffer(), write(), Isis::TiffExporter::write(), and writeLine().
|
protectedinherited |
Get a reference to the process object, useful for subclasses to access and manipulate the process.
|
inherited |
Number of samples (columns) in the output image.
Referenced by Isis::QtExporter::checkDataSize(), createBuffer(), Isis::TiffExporter::createBuffer(), Isis::QtExporter::setGrayscale(), Isis::QtExporter::setRgb(), Isis::QtExporter::setRgba(), write(), and Isis::TiffExporter::write().
|
protectedvirtual |
Set the DN value at the given sample and band of the line buffer.
s | The sample index into the buffer |
b | The band index into the buffer |
dn | The value to set at the given index |
Implements Isis::StreamExporter.
References _FILEINFO_, Isis::ImageExporter::pixelType(), Isis::IException::Programmer, Isis::SignedWord, Isis::toString(), Isis::UnsignedByte, and Isis::UnsignedWord.
|
protectedinherited |
Sets the description for the output image.
desc | The export description |
|
protectedinherited |
Sets the extension for the output image and generates the extension for the world file from it.
extension | The extension for the output image |
Referenced by JP2Exporter(), Isis::QtExporter::QtExporter(), and Isis::TiffExporter::TiffExporter().
|
virtualinherited |
Generic initialization with the export description.
Stream exporters do not do anything special to export a grayscale image beyond setting up the appropriate number of color channels.
desc | Export description containing necessary channel information |
Implements Isis::ImageExporter.
References Isis::StreamExporter::initialize().
|
inherited |
Set the DN floor and ceiling for the exported image.
All DNs less than the min will be set to the min in the exported image. Similarly, all DNs greater than the max will be set to the max in the exported image.
Note: These values may be "special". For example, if Null pixels are exported to 0.0 and the minimum valid pixels are exported to 2.0, then 0.0 should be passed in for the value of the min parameter.
min | The absolute minimum output DN value. |
max | The absolute maximum output DN value. |
|
virtualinherited |
Generic initialization with the export description.
Stream exporters do not do anything special to export an RGB image beyond setting up the appropriate number of color channels.
desc | Export description containing necessary channel information |
Implements Isis::ImageExporter.
References Isis::StreamExporter::initialize().
|
virtualinherited |
Generic initialization with the export description.
Stream exporters do not do anything special to export an RGBA image beyond setting up the appropriate number of color channels.
desc | Export description containing necessary channel information |
Implements Isis::ImageExporter.
References Isis::StreamExporter::initialize().
|
virtual |
Initialize the encoder, open the output file for writing, then let the base ImageExporter handle the generic black-box writing routine.
outputName | The filename of the output cube |
quality | The quality of the output, not used for JPEG 2000 |
compression | The compression algorithm used. Not used for JPEG 2000 |
Reimplemented from Isis::ImageExporter.
References Isis::FileName::addExtension(), Isis::ImageExporter::bands(), Isis::FileName::expanded(), Isis::ImageExporter::extension(), Isis::ImageExporter::lines(), Isis::JP2Encoder::OpenFile(), Isis::ImageExporter::pixelType(), Isis::ImageExporter::samples(), and Isis::ImageExporter::write().
|
protectedvirtualinherited |
Write a line of grayscale data to the output image.
in | Vector containing a single grayscale input line |
Implements Isis::ImageExporter.
References Isis::Buffer::Line(), Isis::ImageExporter::outputPixelValue(), Isis::Buffer::SampleDimension(), Isis::StreamExporter::setBuffer(), and Isis::StreamExporter::writeLine().
|
protectedvirtual |
Writes a line of buffered data to the output image on disk.
l | The line of the output image, unused for JPEG 2000 |
Implements Isis::StreamExporter.
References Isis::ImageExporter::pixelType(), Isis::UnsignedByte, and Isis::JP2Encoder::Write().
|
protectedvirtualinherited |
Write a line of RGB data to the output image.
in | Vector containing three input lines (red, green, blue) |
Implements Isis::ImageExporter.
References Isis::Buffer::Line(), Isis::ImageExporter::outputPixelValue(), Isis::Buffer::SampleDimension(), Isis::StreamExporter::setBuffer(), and Isis::StreamExporter::writeLine().
|
protectedvirtualinherited |
Write a line of RGBA data to the output image.
in | Vector containing four input lines (red, green, blue, alpha) |
Implements Isis::ImageExporter.
References Isis::Buffer::Line(), Isis::ImageExporter::outputPixelValue(), Isis::Buffer::SampleDimension(), Isis::StreamExporter::setBuffer(), and Isis::StreamExporter::writeLine().