Public Member Functions |
| ImageExporter () |
| Construct the exporter.
|
virtual | ~ImageExporter () |
| Destruct the exporter.
|
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.
|
virtual void | write (FileName outputName, int quality=100, QString compression="none") |
| Export the Isis cube channels to the given standard image.
|
int | samples () const |
| Number of samples (columns) in the output image.
|
int | lines () const |
| Number of lines (rows) in the output image.
|
int | bands () const |
| Number of bands (channels) in the output image.
|
double | inputMinimum (int channel) const |
| Returns the input minimum for the given channel.
|
double | inputMaximum (int channel) const |
| Returns the input maximum for the given channel.
|
void | setOutputPixelRange (double outputPixelMinimum, double outputPixelMaximum) |
| Set the DN floor and ceiling for the exported image.
|
virtual void | setGrayscale (ExportDescription &desc)=0 |
| Pure virtual method for setting up an export to a grayscale image.
|
virtual void | setRgb (ExportDescription &desc)=0 |
| Pure virtual method for setting up an export to an RGB image.
|
virtual void | setRgba (ExportDescription &desc)=0 |
| Pure virtual method for setting up an export to an RGBA image.
|
Protected Member Functions |
virtual void | initialize (ExportDescription &desc)=0 |
| Generic initialization with the export description.
|
void | setExtension (QString extension) |
| Sets the extension for the output image and generates the extension for the world file from it.
|
void | setExportDescription (ExportDescription &desc) |
| Sets the description for the output image.
|
Cube * | initializeProcess () |
| Sets up the export process with the parameters described within the given description.
|
QString | extension () const |
| Gets the extension for the output image.
|
ExportDescription & | exportDescription () const |
| Gets the description for the output image.
|
ProcessExport & | process () const |
| Get a reference to the process object, useful for subclasses to access and manipulate the process.
|
PixelType | pixelType () const |
| Returns the pixel type.
|
virtual int | outputPixelValue (double dn) const |
| Return the output clamped integer pixel value from the input double-precision DN.
|
virtual void | writeGrayscale (vector< Buffer * > &in) const =0 |
| Pure virtual method for writing a line of grayscale data to the output image.
|
virtual void | writeRgb (vector< Buffer * > &in) const =0 |
| Pure virtual method for writing a line of RGB data to the output image.
|
virtual void | writeRgba (vector< Buffer * > &in) const =0 |
| Pure virtual method for writing a line of RGBA data to the output image.
|
Export Isis cubes into standard formats.
Abstract base class for a series of image exporters. Each exporter handles a specialized suite of standard image formats, and can be used as a black-box with the write() method, or for finer control, the importer can act as a functor in a ProcessExport routine.
- Author
- 2012-04-03 Travis Addair
ImageExporter * Isis::ImageExporter::fromFormat |
( |
QString |
format | ) |
|
|
static |
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.
- Parameters
-
format | The format for the output image to be created |
- Returns
- A pointer to the instantiated exporter owned by the caller
References _FILEINFO_, Isis::JP2Exporter::canWriteFormat(), Isis::TiffExporter::canWriteFormat(), Isis::QtExporter::canWriteFormat(), and Isis::IException::Programmer.
Generic initialization with the export description.
Set the export description given the pixel type of the passed in description. Use the number of channels in the export description to determine the write method (i.e. grayscale, rgb, or rgba). This will also set the member variables for the number of samples, lines, and bands.
- Parameters
-
desc | Export description containing necessary channel information |
Implemented in Isis::StreamExporter.
Cube * Isis::ImageExporter::initializeProcess |
( |
| ) |
|
|
protected |
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).
- Returns
- A cube pointer to the first channel created, owned by the process
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(), writeGrayscale(), writeRgb(), and writeRgba().
void Isis::ImageExporter::setOutputPixelRange |
( |
double |
outputPixelMinimum, |
|
|
double |
outputPixelMaximum |
|
) |
| |
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.
- Parameters
-
min | The absolute minimum output DN value. |
max | The absolute maximum output DN value. |
void Isis::ImageExporter::write |
( |
FileName |
outputName, |
|
|
int |
quality = 100 , |
|
|
QString |
compression = "none" |
|
) |
| |
|
virtual |