|
| TiffImporter (FileName inputName) |
| Construct the importer. More...
|
|
virtual | ~TiffImporter () |
| Destruct the importer. More...
|
|
virtual PvlGroup | convertProjection () const |
| Convert any projection information associated with the input image to an ISIS Mapping group in PVL form. More...
|
|
virtual bool | isGrayscale () const |
| Tests to see if the input image has a "min is white" or "min is black" photometric interpretation, implying grayscale (no RGB/A). More...
|
|
virtual bool | isRgb () const |
| Tests to see if the input image is neither grayscale nor has more than three samples per pixel, implying RGB (no alpha). More...
|
|
virtual bool | isArgb () const |
| Tests to see if the input image is not grayscale and has more than three samples per pixel, implying RGBA. More...
|
|
void | operator() (Buffer &out) const |
| The method for processing the output cube in place, called for each line of the output image. More...
|
|
Cube * | import (FileName outputName) |
| Import the image with default output attributes. More...
|
|
Cube * | import (FileName outputName, CubeAttributeOutput &att) |
| Import the input image this instance was constructed with into the given output Isis cube with the given output attributes. More...
|
|
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 output. More...
|
|
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. More...
|
|
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. More...
|
|
void | setSamples (int s) |
| Set the sample dimension (width) of the output image. More...
|
|
void | setLines (int l) |
| Set the line dimension (height) of the output image. More...
|
|
void | setBands (int b) |
| Set the band dimension (depth) of the output image. More...
|
|
int | samples () const |
| The sample dimension (width) of the output image. More...
|
|
int | lines () const |
| The line dimension (height) of the output image. More...
|
|
int | bands () const |
| The band dimension (depth) of the output image. More...
|
|
FileName | filename () const |
| The filename of the input image this instance was constructed with. More...
|
|
|
int | samplesPerPixel () const |
| The number of "samples" (bands in Isis terms) per pixel in the input image. More...
|
|
virtual void | updateRawBuffer (int line, int band) const |
| Does nothing as LibTIFF reads the entire input image into memory, and therefore does not need to be updated throughout the import process. More...
|
|
virtual int | getPixel (int s, int l) const |
| Returns a representation of a pixel for the input format that can then be broken down into specific gray or RGB/A components. More...
|
|
virtual int | getGray (int pixel) const |
| Retrieves the gray component of the given pixel. More...
|
|
virtual int | getRed (int pixel) const |
| Retrieves the red component of the given pixel. More...
|
|
virtual int | getGreen (int pixel) const |
| Retrieves the green component of the given pixel. More...
|
|
virtual int | getBlue (int pixel) const |
| Retrieves the blue component of the given pixel. More...
|
|
virtual int | getAlpha (int pixel) const |
| Retrieves the alpha component of the given pixel. More...
|
|
Cube * | createOutput (FileName outputName, CubeAttributeOutput &att) |
| Create the output cube from the given filename and attributes. More...
|
|
void | setDefaultBands () |
| Set the number of bands to be created for the output cube based on the number of color channels in the input image. More...
|
|
double | testSpecial (double pixel) const |
| Tests a pixel against the Null, HRS, and LRS ranges defined by the importer's handler. More...
|
|
virtual GetChannelMethod | getBandChannel (int band) const |
| Retrieve the method responsible for fetching the color channel from the input image corresponding to the current band out of output being filled. More...
|
|
virtual int | convertRgbToGray (int pixel) const |
| Convert the current pixel, taken from an RGB/A image, and blend its RGB components into a single grayscale DN. More...
|
|
Imports TIFF images as Isis cubes.
Takes a TIFF input image and imports it into Isis in the cube format. Unlike Qt's facilities for importing TIFFs, this class is capable of importing images >2GB, provided the user's machine has sufficient RAM to hold such an image in memory.
- Author
- 2012-03-16 Travis Addair
PvlGroup Isis::TiffImporter::convertProjection |
( |
| ) |
const |
|
virtual |
Convert any projection information associated with the input image to an ISIS Mapping group in PVL form.
Currently this routine only handles GeoTiff tags containing UTM projection parameters. NOTE: As written, this only works for a few projections. The tranlsation files can be extened to work for more, but the whole design needs to be generalized and thought out.
References: http://www.remotesensing.org/geotiff/spec/geotiffhome.html
- Returns
- The ISIS PVL mapping group
Reimplemented from Isis::ImageImporter.
References Isis::PvlObject::addGroup(), Isis::PvlToPvlTranslationManager::Auto(), Isis::ProjectionFactory::Create(), Isis::FileName::expanded(), Isis::FileName::fileExists(), Isis::PvlObject::findGroup(), Isis::TProjection::LocalRadius(), Isis::PI, Isis::toString(), and Isis::TProjection::TrueScaleLatitude().
int Isis::ImageImporter::convertRgbToGray |
( |
int |
pixel | ) |
const |
|
protectedvirtualinherited |
A static (factory) method for constructing an ImageImporter instance from an input filename.
The specific subclass of the returned instance is determined from the interpreted image format of the input image. Such tests are done by reading a minimal amount of the input data necessary to determine the format. It is the caller's responsibility to delete the importer instance when they are finished with it. Note that deleting the importer will also delete the cube handle returned by the import() method.
- Parameters
-
inputName | The filename of the input image to be imported |
- Returns
- A pointer to the instantiated importer owned by the caller
References _FILEINFO_, Isis::FileName::expanded(), Isis::JP2Decoder::IsJP2(), and Isis::IException::Programmer.
|
protectedvirtualinherited |
Retrieve the method responsible for fetching the color channel from the input image corresponding to the current band out of output being filled.
This will always be the getGray() method for single band output images. For RGB/A images, band 1 will be red, band 2 green, band 3 blue, and band 4 alpha.
- Parameters
-
band | The current band of the output image |
- Returns
- The method that converts input pixels into the current band's color component
References _FILEINFO_, Isis::ImageImporter::bands(), Isis::ImageImporter::getAlpha(), Isis::ImageImporter::getBlue(), Isis::ImageImporter::getGray(), Isis::ImageImporter::getGreen(), Isis::ImageImporter::getRed(), and Isis::IException::Programmer.
Referenced by Isis::ImageImporter::operator()().
Import the input image this instance was constructed with into the given output Isis cube with the given output attributes.
This will do a black-box import using a ProcessByLine routine. The BandBin group will be updated in the output cube with the names of the color channels included. The output cube will be returned on completion of the import process so the caller can continue to modify the labels. The importer instance will retain ownership of this cube, such that the cube handle will be deallocated upon destruction of the importer.
- Parameters
-
outputName | The filename of the output cube |
att | The attributes for writing the output cube |
- Returns
- A handle on the newly imported Isis cube owned by the importer
References _FILEINFO_, Isis::PvlObject::addGroup(), Isis::ImageImporter::bands(), Isis::ProcessByBrick::BandsFirst, Isis::ImageImporter::convertProjection(), Isis::ImageImporter::createOutput(), Isis::ProcessByBrick::EndProcess(), Isis::PvlObject::findObject(), Isis::PvlContainer::keywords(), Isis::Cube::label(), Isis::ProcessByLine::ProcessCubeInPlace(), Isis::IException::Programmer, Isis::ProcessByLine::SetInputCube(), Isis::ProcessByBrick::SetProcessingDirection(), and Isis::Process::WriteHistory().
void Isis::ImageImporter::operator() |
( |
Buffer & |
out | ) |
const |
|
inherited |
The method for processing the output cube in place, called for each line of the output image.
Enables the importer to be used as a functor in a custom ProcessByLine routine, bypassing the black-box import() method entirely. Care should be taken, however, to observe the requirements placed on the structure of such a processing routine by this method. For example, the JP2Importer child requires that the processing proceed in the direction of bands before lines, because its input data is structured in a BIL (band interlaced by line) format.
- Parameters
-
out | A reference to a line of output data to be written to |
References Isis::Buffer::Band(), Isis::ImageImporter::getBandChannel(), Isis::ImageImporter::getPixel(), Isis::Buffer::Line(), Isis::Buffer::SampleDimension(), Isis::ImageImporter::testSpecial(), and Isis::ImageImporter::updateRawBuffer().
int Isis::TiffImporter::samplesPerPixel |
( |
| ) |
const |
|
protected |
The number of "samples" (bands in Isis terms) per pixel in the input image.
Combined with the photometric interpretation, this can be used to determine the color mode of the input image. We need both pieces of information because grayscale images are not guaranteed to have only one sample per pixel.
- Returns
- The samples per pixel
Referenced by isArgb(), and isRgb().
void Isis::ImageImporter::setBands |
( |
int |
b | ) |
|
|
inherited |
double Isis::ImageImporter::testSpecial |
( |
double |
pixel | ) |
const |
|
protectedinherited |
Tests a pixel against the Null, HRS, and LRS ranges defined by the importer's handler.
Any pixel value falling within one of these ranges will be converted into the given type of special pixel. In case of overlapping ranges, these tests will be performed in the order mentioned at the start of this description. By default, these ranges are set such that all incoming pixels will retain their original values.
- Parameters
-
pixel | The DN value to be tested |
- Returns
- The valid DN or special pixel if it fell within the special ranges
References Isis::HIGH_REPR_SAT8, Isis::LOW_REPR_SAT8, and Isis::NULL8.
Referenced by Isis::ImageImporter::operator()().