7#include "JP2Exporter.h"
11#include "IException.h"
13#include "JP2Encoder.h"
14#include "UserInterface.h"
49 int mult = (type == Isis::UnsignedByte) ? 1 : 2;
52 for (
int i = 0; i <
bands(); i++)
68 outputName = outputName.addExtension(
extension());
90 ((
unsigned char *)
m_buffer[b])[s] = (
unsigned char) dn;
93 ((
short int *)
m_buffer[b])[s] = (
short int) dn;
96 ((
short unsigned int *)
m_buffer[b])[s] = (
short unsigned int) dn;
99 throw IException(IException::Programmer,
100 "Invalid pixel type for data [" +
toString(type) +
"]",
113 if (type == Isis::UnsignedByte)
128 return format ==
"jp2";
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.
int samples() const
Number of samples (columns) in the output image.
PixelType pixelType() const
Returns the pixel type.
void setExtension(QString extension)
Sets the extension for the output image and generates the extension for the world file from it.
static bool canWriteFormat(QString format)
Returns true if the format is "jp2".
virtual void writeLine(int l) const
Writes a line of buffered data to the output image on disk.
JP2Encoder * m_encoder
Object responsible for writing data to the output image.
virtual void write(FileName outputName, int quality=100, QString compression="none", UserInterface *ui=nullptr)
Initialize the encoder, open the output file for writing, then let the base ImageExporter handle the ...
virtual ~JP2Exporter()
Destruct the exporter.
virtual void setBuffer(int s, int b, int dn) const
Set the DN value at the given sample and band of the line buffer.
JP2Exporter()
Construct the JPEG 2000 exporter.
virtual void createBuffer()
Creates the buffer to store a chunk of streamed line data with one or more bands.
char ** m_buffer
Two dimensional array containing all color channels for a line.
StreamExporter()
Construct the stream exporter.
Command Line and Xml loader, validation, and access.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.