|
Isis 3 Programmer Reference
|
7 #include "ImageImporter.h"
9 #include <QImageReader>
12 #include "CubeAttribute.h"
15 #include "JP2Decoder.h"
16 #include "JP2Importer.h"
17 #include "ProcessByLine.h"
19 #include "QtImporter.h"
20 #include "SpecialPixel.h"
21 #include "TiffImporter.h"
96 int l = out.
Line() - 1;
110 return import(outputName, att);
144 if (
bands() == 4) name +=
"Alpha";
148 "Cannot interpret BandBin for [" +
IString(
bands()) +
"] band image",
266 "Cannot create an image with [" +
IString(b) +
"] bands",
326 if (pixel <= m_nullMax && pixel >=
m_nullMin) {
329 else if (pixel <= m_hrsMax && pixel >=
m_hrsMin) {
330 return Isis::HIGH_REPR_SAT8;
332 else if (pixel <= m_lrsMax && pixel >=
m_lrsMin) {
333 return Isis::LOW_REPR_SAT8;
376 "Cannot determine channel for band [" +
IString(band) +
"]",
403 return (red * 11 + green * 16 + blue * 5) / 32;
423 QString format = QImageReader::imageFormat(inputName.
expanded());
424 if (format ==
"tiff") {
427 else if (format !=
"" && format !=
"jp2") {
430 else if (JP2Decoder::IsJP2(inputName.
expanded().toLatin1().data())) {
435 "Cannot determine image format for [" + inputName.
expanded() +
"]",
double m_hrsMin
The lower bound of the range within which input DNs will be made HRS.
int SampleDimension() const
Returns the number of samples in the shape buffer.
virtual int convertRgbToGray(int pixel) const
Convert the current pixel, taken from an RGB/A image, and blend its RGB components into a single gray...
Contains Pvl Groups and Pvl Objects.
virtual int getPixel(int s, int l) const =0
Pure virtual method that returns a representation of a pixel for the input format that can then be br...
void setSamples(int s)
Set the sample dimension (width) of the output image.
double m_lrsMax
The upper bound of the range within which input DNs will be made LRS.
A single keyword-value pair.
int(ImageImporter::* GetChannelMethod)(int pixel) const
Friendly alias for a method used to get a particular color channel.
void WriteHistory(Cube &cube)
Writes out the History blob to the cube.
void setLrsRange(double min, double max)
Set the range of DN values within which a pixel from the input image will be set to LRS in the output...
File name manipulation and expansion.
virtual bool isArgb() const =0
Pure virtual method for returning true if the image is RGBA.
virtual int getGreen(int pixel) const =0
Pure virtual method for retrieving the green component of the given pixel.
virtual void updateRawBuffer(int line, int band) const =0
Pure virtual method that updates the buffer used to store chunks of the input data at a time.
void setNullRange(double min, double max)
Set the range of DN values within which a pixel from the input image will be set to Null in the outpu...
Imports JPEG 2000 images as Isis cubes.
Container for cube-like labels.
Manipulate and parse attributes of output cube filenames.
Imports images with standard formats into Isis as cubes.
int m_samples
The number of samples to be written to the output.
virtual int getBlue(int pixel) const =0
Pure virtual method for retrieving the blue component of the given pixel.
Buffer for reading and writing cube data.
int bands() const
The band dimension (depth) of the output image.
void ProcessCubeInPlace(const Functor &funct, bool threaded=true)
Same functionality as StartProcess(void funct(Isis::Buffer &inout)) using Functors.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
void setDefaultBands()
Set the number of bands to be created for the output cube based on the number of color channels in th...
Contains multiple PvlContainers.
double m_hrsMax
The upper bound of the range within which input DNs will be made HRS.
void setDimensions(int ns, int nl, int nb)
Used prior to the Create method to specify the size of the cube.
void create(const QString &cfile)
This method will create an isis cube for writing.
FileName * m_inputName
The filename of the input image.
int samples() const
The sample dimension (width) of the output image.
void setBands(int b)
Set the band dimension (depth) of the output image.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
virtual PvlGroup convertProjection() const
Pure virtual method for converting projection information in the file being imported to an ISIS Mappi...
IO Handler for Isis Cubes.
virtual int getAlpha(int pixel) const =0
Pure virtual method for retrieving the alpha component of the given pixel.
void setLines(int l)
Set the line dimension (height) of the output image.
void operator()(Buffer &out) const
The method for processing the output cube in place, called for each line of the output image.
virtual ~ImageImporter()
Destruct the importer.
double m_nullMax
The upper bound of the range within which input DNs will be made Null.
void setHrsRange(double min, double max)
Set the range of DN values within which a pixel from the input image will be set to HRS in the output...
int m_lines
The number of lines to be written to the output.
int m_bands
The number of bands to be written to the output.
double testSpecial(double pixel) const
Tests a pixel against the Null, HRS, and LRS ranges defined by the importer's handler.
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
int lines() const
The line dimension (height) of the output image.
virtual bool isGrayscale() const =0
Pure virtual method for returning true if the image is grayscale.
int Band(const int index=0) const
Returns the band position associated with a shape buffer index.
Imports TIFF images as Isis cubes.
Cube * import(FileName outputName)
Import the image with default output attributes.
@ Programmer
This error is for when a programmer made an API call that was illegal.
static ImageImporter * fromFileName(FileName inputName)
A static (factory) method for constructing an ImageImporter instance from an input filename.
FileName filename() const
The filename of the input image this instance was constructed with.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
virtual GetChannelMethod getBandChannel(int band) const
Retrieve the method responsible for fetching the color channel from the input image corresponding to ...
void SetProcessingDirection(ProcessingDirection direction)
Set the direction the data will be read, either all lines in a single band proceeding to the next ban...
ImageImporter(FileName inputName)
Construct the importer.
Cube * m_outCube
The owned handle on the output cube to be imported to.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
Imports a series of standard image formats with Qt facilities.
Adds specific functionality to C++ strings.
double m_lrsMin
The lower bound of the range within which input DNs will be made LRS.
void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Isis::Cube * SetInputCube(const QString ¶meter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
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.
Cube * createOutput(FileName outputName, CubeAttributeOutput &att)
Create the output cube from the given filename and attributes.
virtual int getRed(int pixel) const =0
Pure virtual method for retrieving the red component of the given pixel.
double m_nullMin
The lower bound of the range within which input DNs will be made Null.
virtual int getGray(int pixel) const =0
Pure virtual method for retrieving the gray component of the given pixel.