Isis 3 Programmer Reference
|
Exports cubes into one of several formats with Qt facilities. More...
#include <QtExporter.h>
Public Member Functions | |
QtExporter (QString format) | |
Construct the Qt exporter. More... | |
virtual | ~QtExporter () |
Destruct the exporter. More... | |
virtual void | setGrayscale (ExportDescription &desc) |
Set the input with the description generically, check the data size for a single-band image with the established dimensions, initialize the image with the Indexed8 format, and setup the color table from 0 to 256. More... | |
virtual void | setRgb (ExportDescription &desc) |
Set the input with the description generically, check the data size for a three-band image with the established dimensions, and initialize the image with the RGB32 format. More... | |
virtual void | setRgba (ExportDescription &desc) |
Set the input with the description generically, check the data size for a four-band image with the established dimensions, and initialize the image with the ARGB32 format. More... | |
virtual void | write (FileName outputName, int quality=100, QString compression="none") |
Let the base ImageExporter handle the generic black-box writing routine, then save the image to disk. 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 supported by QImageWriter. 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 | 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 | checkDataSize (BigInt samples, BigInt lines, int bands) |
Checks that the data size for an image of the desired dimensions will be less than 2GB. 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... | |
Private Member Functions | |
void | initialize (ExportDescription &desc) |
Generic initialization with the export description. More... | |
Private Attributes | |
QImage * | m_qimage |
Structure holding all output image data in memory. More... | |
QString | m_format |
The lowercase abbreviated format of the output image. More... | |
Exports cubes into one of several formats with Qt facilities.
Takes a series of single-banded Isis cubes and exports them into one of several possible standard image formats using Qt's QImage structure to handle reading the data into memory and setting individual pixel values. Set Qt's documentation on QImageWriter for a complete list of supported formats:
http://qt-project.org/doc/qt-4.8/qimagewriter.html#supportedImageFormats
While Qt can be used to export Isis cubes to TIFF images, it is generally recommended to use the TiffExporter class instead, which uses LibTIFF version 4 to import big TIFFs. Qt, as of version 4.8, can only import images <2GB in size.
2012-04-04 Travis Addair - Added documentation.
2013-06-05 Jeannie Backer - Added initialize() method and replaced call to setInput(). Changed ImageExporter calls to new method names, where needed. References #1380.
2015-02-12 Jeffrey Covington - Added compression parameter to write() method. Fixes #1745.
Definition at line 63 of file QtExporter.h.
|
protectedinherited |
Friendly alias for a method used to write a particular color channel.
Definition at line 114 of file ImageExporter.h.
Isis::QtExporter::QtExporter | ( | QString | format | ) |
Construct the Qt exporter.
format | The format to export to |
Definition at line 21 of file QtExporter.cpp.
References m_format, m_qimage, and Isis::ImageExporter::setExtension().
|
virtual |
|
inherited |
Number of bands (channels) in the output image.
Definition at line 132 of file ImageExporter.cpp.
Referenced by checkDataSize(), Isis::JP2Exporter::createBuffer(), Isis::TiffExporter::createBuffer(), Isis::TiffExporter::setBuffer(), Isis::JP2Exporter::write(), and Isis::TiffExporter::write().
|
static |
Returns true if the format is supported by QImageWriter.
format | Lowercase format abbreviation |
Definition at line 240 of file QtExporter.cpp.
Referenced by Isis::ImageExporter::fromFormat().
Checks that the data size for an image of the desired dimensions will be less than 2GB.
samples | Number of samples in the output |
lines | Number of lines in the output |
bands | Number of bands in the output |
Definition at line 219 of file QtExporter.cpp.
References _FILEINFO_, Isis::ImageExporter::bands(), Isis::ImageExporter::lines(), Isis::ImageExporter::samples(), Isis::toString(), and Isis::IException::User.
Referenced by setGrayscale(), setRgb(), and setRgba().
|
protectedinherited |
Gets the description for the output image.
Definition at line 220 of file ImageExporter.cpp.
|
protectedinherited |
Gets the extension for the output image.
Definition at line 202 of file ImageExporter.cpp.
Referenced by Isis::JP2Exporter::write(), Isis::TiffExporter::write(), and 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 |
Definition at line 384 of file ImageExporter.cpp.
References _FILEINFO_, Isis::JP2Exporter::canWriteFormat(), Isis::TiffExporter::canWriteFormat(), canWriteFormat(), and Isis::IException::Programmer.
|
privatevirtual |
Generic initialization with the export description.
Set the input and set the pixel type.
desc | Export description containing necessary channel information |
Implements Isis::ImageExporter.
Definition at line 53 of file QtExporter.cpp.
References _FILEINFO_, Isis::ImageExporter::initialize(), m_format, Isis::ExportDescription::pixelType(), and Isis::IException::Unknown.
Referenced by setGrayscale(), setRgb(), and 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).
Definition at line 240 of file ImageExporter.cpp.
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 |
Definition at line 158 of file ImageExporter.cpp.
|
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 |
Definition at line 145 of file ImageExporter.cpp.
|
inherited |
Number of lines (rows) in the output image.
Definition at line 122 of file ImageExporter.cpp.
Referenced by checkDataSize(), setGrayscale(), setRgb(), setRgba(), Isis::JP2Exporter::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 |
Definition at line 78 of file ImageExporter.cpp.
|
protectedvirtualinherited |
Return the output clamped integer pixel value from the input double-precision DN.
dn | The input DN |
Definition at line 319 of file ImageExporter.cpp.
Referenced by Isis::StreamExporter::writeGrayscale(), writeGrayscale(), Isis::StreamExporter::writeRgb(), writeRgb(), Isis::StreamExporter::writeRgba(), and writeRgba().
|
protectedinherited |
Returns the pixel type.
Defaults to None if not set by the user.
Definition at line 301 of file ImageExporter.cpp.
Referenced by Isis::JP2Exporter::createBuffer(), Isis::TiffExporter::createBuffer(), Isis::JP2Exporter::setBuffer(), Isis::TiffExporter::setBuffer(), Isis::JP2Exporter::write(), Isis::TiffExporter::write(), and Isis::JP2Exporter::writeLine().
|
protectedinherited |
Get a reference to the process object, useful for subclasses to access and manipulate the process.
Definition at line 291 of file ImageExporter.cpp.
|
inherited |
Number of samples (columns) in the output image.
Definition at line 112 of file ImageExporter.cpp.
Referenced by checkDataSize(), Isis::JP2Exporter::createBuffer(), Isis::TiffExporter::createBuffer(), setGrayscale(), setRgb(), setRgba(), Isis::JP2Exporter::write(), and Isis::TiffExporter::write().
|
protectedinherited |
Sets the description for the output image.
desc | The export description |
Definition at line 211 of file ImageExporter.cpp.
|
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 |
Definition at line 187 of file ImageExporter.cpp.
Referenced by Isis::JP2Exporter::JP2Exporter(), QtExporter(), and Isis::TiffExporter::TiffExporter().
|
virtual |
Set the input with the description generically, check the data size for a single-band image with the established dimensions, initialize the image with the Indexed8 format, and setup the color table from 0 to 256.
desc | Export description containing necessary channel information |
Implements Isis::ImageExporter.
Definition at line 71 of file QtExporter.cpp.
References checkDataSize(), initialize(), Isis::ImageExporter::lines(), m_qimage, and Isis::ImageExporter::samples().
|
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. |
Definition at line 175 of file ImageExporter.cpp.
|
virtual |
Set the input with the description generically, check the data size for a three-band image with the established dimensions, and initialize the image with the RGB32 format.
desc | Export description containing necessary channel information |
Implements Isis::ImageExporter.
Definition at line 93 of file QtExporter.cpp.
References checkDataSize(), initialize(), Isis::ImageExporter::lines(), m_qimage, and Isis::ImageExporter::samples().
|
virtual |
Set the input with the description generically, check the data size for a four-band image with the established dimensions, and initialize the image with the ARGB32 format.
desc | Export description containing necessary channel information |
Implements Isis::ImageExporter.
Definition at line 107 of file QtExporter.cpp.
References checkDataSize(), initialize(), Isis::ImageExporter::lines(), m_qimage, and Isis::ImageExporter::samples().
|
virtual |
Let the base ImageExporter handle the generic black-box writing routine, then save the image to disk.
outputName | The filename of the output cube |
quality | The quality of the output. |
compression | The compression algorithm used. Not supported for Qt. |
Reimplemented from Isis::ImageExporter.
Definition at line 193 of file QtExporter.cpp.
References _FILEINFO_, Isis::FileName::addExtension(), Isis::FileName::expanded(), Isis::ImageExporter::extension(), m_format, m_qimage, Isis::IException::Programmer, and Isis::ImageExporter::write().
|
protectedvirtual |
Write a line of grayscale data to the output image.
in | Vector containing a single grayscale input line |
Implements Isis::ImageExporter.
Definition at line 119 of file QtExporter.cpp.
References _FILEINFO_, Isis::Buffer::Line(), m_qimage, Isis::ImageExporter::outputPixelValue(), Isis::Buffer::SampleDimension(), and Isis::IException::User.
|
protectedvirtual |
Write a line of RGB data to the output image.
in | Vector containing three input lines (red, green, blue) |
Implements Isis::ImageExporter.
Definition at line 146 of file QtExporter.cpp.
References Isis::Buffer::Line(), m_qimage, Isis::ImageExporter::outputPixelValue(), and Isis::Buffer::SampleDimension().
|
protectedvirtual |
Write a line of RGBA data to the output image.
in | Vector containing four input lines (red, green, blue, alpha) |
Implements Isis::ImageExporter.
Definition at line 167 of file QtExporter.cpp.
References Isis::Buffer::Line(), m_qimage, Isis::ImageExporter::outputPixelValue(), and Isis::Buffer::SampleDimension().
|
private |
The lowercase abbreviated format of the output image.
Definition at line 91 of file QtExporter.h.
Referenced by initialize(), QtExporter(), and write().
|
private |
Structure holding all output image data in memory.
Definition at line 88 of file QtExporter.h.
Referenced by QtExporter(), setGrayscale(), setRgb(), setRgba(), write(), writeGrayscale(), writeRgb(), writeRgba(), and ~QtExporter().