Isis 3 Programmer Reference
ImageImporter.h
1#ifndef ImageImporter_h
2#define ImageImporter_h
3
9/* SPDX-License-Identifier: CC0-1.0 */
10
11namespace Isis {
12 class Buffer;
13 class Cube;
14 class CubeAttributeOutput;
15 class FileName;
16 class ImageImporter;
17 class PvlGroup;
18
40 public:
41 ImageImporter(FileName inputName);
42 virtual ~ImageImporter();
43
44 void operator()(Buffer &out) const;
45
46 Cube * import(FileName outputName);
47 Cube * import(FileName outputName, CubeAttributeOutput &att);
48
49 void setNullRange(double min, double max);
50 void setLrsRange(double min, double max);
51 void setHrsRange(double min, double max);
52
53 void setSamples(int s);
54 void setLines(int l);
55 void setBands(int b);
56
57 int samples() const;
58 int lines() const;
59 int bands() const;
60
61 FileName filename() const;
62
63
70 virtual PvlGroup convertProjection() const;
71
77 virtual bool isGrayscale() const = 0;
78
84 virtual bool isRgb() const = 0;
85
91 virtual bool isArgb() const = 0;
92
93 static ImageImporter * fromFileName(FileName inputName);
94
95 protected:
97 typedef int (ImageImporter::*GetChannelMethod)(int pixel) const;
98
100
101 void setDefaultBands();
102 double testSpecial(double pixel) const;
103
104 virtual GetChannelMethod getBandChannel(int band) const;
105 virtual int convertRgbToGray(int pixel) const;
106
115 virtual void updateRawBuffer(int line, int band) const = 0;
116
127 virtual int getPixel(int s, int l) const = 0;
128
137 virtual int getGray(int pixel) const = 0;
138
147 virtual int getRed(int pixel) const = 0;
148
157 virtual int getGreen(int pixel) const = 0;
158
167 virtual int getBlue(int pixel) const = 0;
168
177 virtual int getAlpha(int pixel) const = 0;
178
179 private:
182
185
188
191
194
196 double m_nullMin;
197
199 double m_nullMax;
200
202 double m_lrsMin;
203
205 double m_lrsMax;
206
208 double m_hrsMin;
209
211 double m_hrsMax;
212 };
213};
214
215
216#endif
Buffer for reading and writing cube data.
Definition Buffer.h:53
Manipulate and parse attributes of output cube filenames.
IO Handler for Isis Cubes.
Definition Cube.h:168
File name manipulation and expansion.
Definition FileName.h:100
Imports images with standard formats into Isis as cubes.
int bands() const
The band dimension (depth) of the output image.
double m_lrsMax
The upper bound of the range within which input DNs will be made LRS.
void setLines(int l)
Set the line dimension (height) of the output image.
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...
virtual int getGreen(int pixel) const =0
Pure virtual method for retrieving the green component of the given pixel.
virtual int getBlue(int pixel) const =0
Pure virtual method for retrieving the blue component of the given pixel.
double m_nullMax
The upper bound of the range within which input DNs will be made Null.
int samples() const
The sample dimension (width) of the output image.
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.
virtual int getRed(int pixel) const =0
Pure virtual method for retrieving the red component of the given pixel.
void setSamples(int s)
Set the sample dimension (width) of the output image.
ImageImporter(FileName inputName)
Construct the importer.
FileName filename() const
The filename of the input image this instance was constructed with.
virtual int getGray(int pixel) const =0
Pure virtual method for retrieving the gray component of the given pixel.
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...
void setDefaultBands()
Set the number of bands to be created for the output cube based on the number of color channels in th...
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...
FileName * m_inputName
The filename of the input image.
virtual GetChannelMethod getBandChannel(int band) const
Retrieve the method responsible for fetching the color channel from the input image corresponding to ...
virtual int getAlpha(int pixel) const =0
Pure virtual method for retrieving the alpha component of the given pixel.
int m_samples
The number of samples to be written to the output.
double m_hrsMin
The lower bound of the range within which input DNs will be made HRS.
double testSpecial(double pixel) const
Tests a pixel against the Null, HRS, and LRS ranges defined by the importer's handler.
virtual PvlGroup convertProjection() const
Pure virtual method for converting projection information in the file being imported to an ISIS Mappi...
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(ImageImporter::* GetChannelMethod)(int pixel) const
Friendly alias for a method used to get a particular color channel.
static ImageImporter * fromFileName(FileName inputName)
A static (factory) method for constructing an ImageImporter instance from an input filename.
double m_hrsMax
The upper bound of the range within which input DNs will be made HRS.
void operator()(Buffer &out) const
The method for processing the output cube in place, called for each line of the output image.
double m_nullMin
The lower bound of the range within which input DNs will be made Null.
virtual bool isArgb() const =0
Pure virtual method for returning true if the image is RGBA.
Cube * createOutput(FileName outputName, CubeAttributeOutput &att)
Create the output cube from the given filename and attributes.
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...
int m_bands
The number of bands to be written to the output.
double m_lrsMin
The lower bound of the range within which input DNs will be made LRS.
void setBands(int b)
Set the band dimension (depth) of the output image.
Cube * m_outCube
The owned handle on the output cube to be imported to.
virtual ~ImageImporter()
Destruct the importer.
int m_lines
The number of lines to be written to the output.
virtual bool isGrayscale() const =0
Pure virtual method for returning true if the image is grayscale.
int lines() const
The line dimension (height) of the output image.
virtual bool isRgb() const =0
Pure virtual method for returning true if the image is RGB (no alpha).
Contains multiple PvlContainers.
Definition PvlGroup.h:41
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16