7#include "ImageExporter.h"
11#include "CubeAttribute.h"
12#include "ExportDescription.h"
14#include "JP2Exporter.h"
16#include "ProcessExport.h"
17#include "QtExporter.h"
18#include "TiffExporter.h"
19#include "UserInterface.h"
106 if (!p.HasInputRange()) {
114 p.ProcessCubes(*
this);
161 return m_process->GetInputMinimum(channel);
174 return m_process->GetInputMaximum(channel);
402 format = format.toLower();
414 "Cannot export image as format [" + format +
"]",
IO Handler for Isis Cubes.
Describes how a cube as a single color channel to be exported.
double inputMinimum() const
Returns the input minimum for this channel.
double inputMaximum() const
Returns the input maximum for this channel.
bool hasCustomRange() const
Returns true if the user of this instance has set a custom input range for this channel.
FileName filename() const
Returns a copy of the filename associated with this channel.
CubeAttributeInput attributes() const
Returns a copy of the input attributes associated with this channel.
Describes how a series of cubes should be exported.
File name manipulation and expansion.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
FileName removeExtension() const
Removes all extensions in the file name.
FileName addExtension(const QString &extension) const
Adds a new extension to the file name.
@ Programmer
This error is for when a programmer made an API call that was illegal.
int lines() const
Number of lines (rows) in the output image.
QString extension() const
Gets the extension for the output image.
int bands() const
Number of bands (channels) in the output image.
virtual void write(FileName outputName, int quality=100, QString compression="none", UserInterface *ui=nullptr)
Export the Isis cube channels to the given standard image.
virtual ~ImageExporter()
Destruct the exporter.
Cube * addChannel(int i)
Add a channel of input data to the process from the export description at the given index.
ExportDescription & exportDescription() const
Gets the description for the output image.
Cube * initializeProcess()
Sets up the export process with the parameters described within the given description.
double inputMinimum(int channel) const
Returns the input minimum for the given channel.
ExportDescription * m_exportDescription
!
void createWorldFile(FileName outputName)
Creates a world file is the input has a map projection.
int m_samples
Number of samples (columns) in the output image.
QString m_extension
Extension to append to the output image if not already provided.
static ImageExporter * fromFormat(QString format)
A static (factory) method for constructing an ImageExporter instance from an output format.
WriteChannels m_writeMethod
Method pointer to one of the pure virtual write methods.
int samples() const
Number of samples (columns) in the output image.
ImageExporter()
Construct the exporter.
PixelType pixelType() const
Returns the pixel type.
double m_outputPixelMaximum
!
virtual void writeGrayscale(vector< Buffer * > &in) const =0
Pure virtual method for writing a line of grayscale data to the output image.
void setOutputPixelRange(double outputPixelMinimum, double outputPixelMaximum)
Set the DN floor and ceiling for the exported image.
void operator()(vector< Buffer * > &in) const
The method for writing a line of input image data (with potentially several bands representing color ...
QString m_worldExtension
Extension to append to the output world file.
int m_lines
Number of lines (rows) in the output image.
void setExportDescription(ExportDescription &desc)
Sets the description for the output image.
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.
ProcessExport & process() const
Get a reference to the process object, useful for subclasses to access and manipulate the process.
int m_bands
Number of bands (channels) in the output image.
virtual int outputPixelValue(double dn) const
Return the output clamped integer pixel value from the input double-precision DN.
ProcessExport * m_process
The object that feeds lines to this instance and handles stretching.
double m_outputPixelMinimum
!
virtual void writeRgba(vector< Buffer * > &in) const =0
Pure virtual method for writing a line of RGBA 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.
double inputMaximum(int channel) const
Returns the input maximum for the given channel.
Exports cubes into JPEG 2000 images.
static bool canWriteFormat(QString format)
Returns true if the format is "jp2".
Process class for exporting cubes.
void CreateWorldFile(const QString &worldFile)
Create a standard world file for the input cube.
void SetOutputNull(const double value)
Set output special pixel value for NULL.
void SetOutputType(Isis::PixelType pixelIn)
Set output pixel bit type in Buffer.
void SetInputRange()
Set input pixel range from user.
@ BIL
Band interleaved by line.
void setFormat(ExportFormat format)
Sets the storage order of the output file.
void SetOutputRange(const double minimum, const double maximum)
Set output pixel range in Buffer.
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
virtual Isis::Cube * SetInputCube(const QString ¶meter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Exports cubes into one of several formats with Qt facilities.
static bool canWriteFormat(QString format)
Returns true if the format is supported by QImageWriter.
Exports cubes into TIFF images.
static bool canWriteFormat(QString format)
Returns true if the format is "tiff".
Command Line and Xml loader, validation, and access.
This is free and unencumbered software released into the public domain.
PixelType
Enumerations for Isis Pixel Types.
Namespace for the standard library.