File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
 |
Isis 3 Programmer Reference
|
7 #include "QtExporter.h"
10 #include <QImageWriter>
13 #include "ExportDescription.h"
15 #include "IException.h"
34 else if (format ==
"jpeg")
36 else if (format ==
"tiff")
38 else if (format ==
"gif")
40 else if (format ==
"bmp")
62 QString msg =
"Invalid pixel type. The Qt exporter for file type [";
64 msg +=
"] requires an unsigned byte (i.e. 8BIT) output.";
85 for (
int i = 0; i < 256; i++) {
86 colors.push_back(qRgb(i, i, i));
126 Buffer &grayLine = *in[0];
130 int lineIndex = grayLine.
Line() - 1;
131 for (
int sampleIndex = 0; sampleIndex < grayLine.
SampleDimension(); sampleIndex++) {
136 m_qimage->setPixel(sampleIndex, lineIndex, pixelValue);
137 if (!
m_qimage->valid(sampleIndex, lineIndex)) {
138 QString msg =
"Qt has detected your file size as exceeding 2GB.";
139 msg +=
" While your image might be under 2GB, your image labels are more";
140 msg +=
" than likely pushing the file size over 2GB.";
154 Buffer &greenLine = *in[1];
155 Buffer &blueLine = *in[2];
157 QRgb *line = (QRgb *)
m_qimage->scanLine(redLine.
Line() - 1);
163 line[s] = qRgb(red, green, blue);
175 Buffer &greenLine = *in[1];
176 Buffer &blueLine = *in[2];
177 Buffer &alphaLine = *in[3];
179 QRgb *line = (QRgb *)
m_qimage->scanLine(redLine.
Line() - 1);
186 line[s] = qRgba(red, green, blue, alpha);
200 QString compression) {
210 QString err =
"Unable to save [" + outputName.
expanded() +
230 if (size >= maxSize) {
231 QString gigaBytes =
toString(size / (1024.0 * 1024.0 * 1024.0));
232 QString msg =
"Cube exceeds max size of 2GB. Qimage cannot support ";
233 msg +=
"that much raw data. Your cube is " + gigaBytes +
" GB.";
247 bool supported =
false;
250 while (it != list.end() && !supported) {
251 if (*it == QString(format)) supported =
true;
virtual void setGrayscale(ExportDescription &desc)
Set the input with the description generically, check the data size for a single-band image with the ...
virtual ~QtExporter()
Destruct the exporter.
void initialize(ExportDescription &desc)
Generic initialization with the export description.
QtExporter(QString format)
Construct the Qt exporter.
int SampleDimension() const
Returns the number of samples in the shape buffer.
This is free and unencumbered software released into the public domain.
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.
virtual void setRgb(ExportDescription &desc)
Set the input with the description generically, check the data size for a three-band image with the e...
File name manipulation and expansion.
QImage * m_qimage
Structure holding all output image data in memory.
@ Unknown
A type of error that cannot be classified as any of the other error types.
Describes how a series of cubes should be exported.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
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.
Buffer for reading and writing cube data.
virtual void write(FileName outputName, int quality=100, QString compression="none")
Export the Isis cube channels to the given standard image.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
PixelType pixelType() const
Returns the pixel type.
FileName addExtension(const QString &extension) const
Adds a new extension to the file name.
virtual void writeGrayscale(vector< Buffer * > &in) const
Write a line of grayscale data to the output image.
long long int BigInt
Big int.
virtual int outputPixelValue(double dn) const
Return the output clamped integer pixel value from the input double-precision DN.
QString extension() const
Gets the extension for the output image.
virtual void writeRgba(vector< Buffer * > &in) const
Write a line of RGBA data to the output image.
virtual void setRgba(ExportDescription &desc)
Set the input with the description generically, check the data size for a four-band image with the es...
Export Isis cubes into standard formats.
virtual void writeRgb(vector< Buffer * > &in) const
Write a line of RGB data to the output image.
@ 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.
int bands() const
Number of bands (channels) in the output image.
int samples() const
Number of samples (columns) in the output image.
This is free and unencumbered software released into the public domain.
static bool canWriteFormat(QString format)
Returns true if the format is supported by QImageWriter.
QString m_format
The lowercase abbreviated format of the output image.
void setExtension(QString extension)
Sets the extension for the output image and generates the extension for the world file from it.
virtual void initialize(ExportDescription &desc)=0
Generic initialization with the export description.
int Line(const int index=0) const
Returns the line position associated with a shape buffer index.
This is free and unencumbered software released into the public domain.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....