28 m_exportDescription = NULL;
32 m_worldExtension =
"";
38 m_outputPixelMinimum = 0.0;
39 m_outputPixelMaximum = 0.0;
53 setExportDescription(desc);
63 delete m_exportDescription;
64 m_exportDescription = NULL;
79 (this->*m_writeMethod)(in);
96 QString compression) {
99 p.ProcessCubes(*
this);
103 createWorldFile(outputName);
146 return m_process->GetInputMinimum(channel);
159 return m_process->GetInputMaximum(channel);
176 m_outputPixelMinimum = outputPixelMinimum;
177 m_outputPixelMaximum = outputPixelMaximum;
188 m_extension = extension;
192 int last = extension.length() - 1;
193 m_worldExtension = extension.mid(0, 1) + extension.mid(last) +
"w";
212 *m_exportDescription = desc;
221 return *m_exportDescription;
241 switch (m_exportDescription->channelCount()) {
253 "Cannot export an image with [" + QString(m_exportDescription->channelCount()) +
259 Cube *cube = addChannel(0);
262 m_bands = m_exportDescription->channelCount();
264 for (
int i = 1; i < m_exportDescription->channelCount(); i++) addChannel(i);
273 m_exportDescription->outputPixelValidMax());
279 setOutputPixelRange(m_exportDescription->outputPixelAbsoluteMin(),
280 m_exportDescription->outputPixelAbsoluteMax());
302 if (m_exportDescription) {
303 return m_exportDescription->pixelType();
320 if (dn < m_outputPixelMinimum) {
321 return m_outputPixelMinimum;
323 else if (dn > m_outputPixelMaximum) {
324 return m_outputPixelMaximum;
387 format = format.toLower();
399 "Cannot export image as format [" + format +
"]",
double inputMaximum() const
Returns the input maximum for this channel.
static bool canWriteFormat(QString format)
Returns true if the format is "tiff".
QString extension() const
Gets the extension for the output image.
File name manipulation and expansion.
int bands() const
Number of bands (channels) in the output image.
Cube * initializeProcess()
Sets up the export process with the parameters described within the given description.
Process class for exporting cubes.
static ImageExporter * fromFormat(QString format)
A static (factory) method for constructing an ImageExporter instance from an output format...
Exports cubes into JPEG 2000 images.
Export Isis cubes into standard formats.
ImageExporter()
Construct the exporter.
void SetOutputNull(const double value)
Set output special pixel value for NULL.
Exports cubes into TIFF images.
FileName addExtension(const QString &extension) const
Adds a new extension to the file name.
int samples() const
Number of samples (columns) in the output image.
virtual int outputPixelValue(double dn) const
Return the output clamped integer pixel value from the input double-precision DN. ...
double inputMinimum() const
Returns the input minimum for this channel.
Namespace for the standard library.
PixelType pixelType() const
Returns the pixel type.
double inputMinimum(int channel) const
Returns the input minimum for the given channel.
ExportDescription & exportDescription() const
Gets the description for the output image.
This error is for when a programmer made an API call that was illegal.
void setExtension(QString extension)
Sets the extension for the output image and generates the extension for the world file from it...
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
ProcessExport & process() const
Get a reference to the process object, useful for subclasses to access and manipulate the process...
PixelType
Enumerations for Isis Pixel Types.
void CreateWorldFile(const QString &worldFile)
Create a standard world file for the input cube.
void SetOutputRange(const double minimum, const double maximum)
Set output pixel range in Buffer.
void SetOutputType(Isis::PixelType pixelIn)
Set output pixel bit type in Buffer.
void setExportDescription(ExportDescription &desc)
Sets the description for the output image.
void SetInputRange()
Set input pixel range from user.
virtual Isis::Cube * SetInputCube(const QString ¶meter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
#define _FILEINFO_
Macro for the filename and line number.
void setFormat(ExportFormat format)
Sets the storage order of the output file.
virtual void writeRgba(vector< Buffer *> &in) const =0
Pure virtual method for writing a line of RGBA data to the output image.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
static bool canWriteFormat(QString format)
Returns true if the format is supported by QImageWriter.
Describes how a series of cubes should be exported.
int lines() const
Number of lines (rows) in the output image.
virtual void initialize(ExportDescription &desc)=0
Generic initialization with the export description.
Describes how a cube as a single color channel to be exported.
void setOutputPixelRange(double outputPixelMinimum, double outputPixelMaximum)
Set the DN floor and ceiling for the exported image.
FileName filename() const
Returns a copy of the filename associated with this channel.
virtual void writeGrayscale(vector< Buffer *> &in) const =0
Pure virtual method for writing a line of grayscale data to the output image.
void operator()(vector< Buffer *> &in) const
The method for writing a line of input image data (with potentially several bands representing color ...
static bool canWriteFormat(QString format)
Returns true if the format is "jp2".
virtual void write(FileName outputName, int quality=100, QString compression="none")
Export the Isis cube channels to the given standard image.
Band interleaved by line.
Namespace for ISIS/Bullet specific routines.
double inputMaximum(int channel) const
Returns the input maximum for the given channel.
virtual ~ImageExporter()
Destruct the exporter.
virtual void writeRgb(vector< Buffer *> &in) const =0
Pure virtual method for writing a line of RGB data to the output image.
Cube * addChannel(int i)
Add a channel of input data to the process from the export description at the given index...
bool hasCustomRange() const
Returns true if the user of this instance has set a custom input range for this channel.
void createWorldFile(FileName outputName)
Creates a world file is the input has a map projection.
CubeAttributeInput attributes() const
Returns a copy of the input attributes associated with this channel.
Exports cubes into one of several formats with Qt facilities.
FileName removeExtension() const
Removes all extensions in the file name.
IO Handler for Isis Cubes.