Isis Developer Reference
TiffImporter.h
Go to the documentation of this file.
1 #ifndef TiffImporter_h
2 #define TiffImporter_h
3 
9 /* SPDX-License-Identifier: CC0-1.0 */
10 
11 #include "ImageImporter.h"
12 
13 #include "geotiff.h"
14 #include "xtiffio.h"
15 #include "tiffio.h"
16 
17 #include "PvlGroup.h"
18 
19 namespace Isis {
20 
21  class Pvl;
22 
45  class TiffImporter : public ImageImporter {
46  public:
47  TiffImporter(FileName inputName);
48  virtual ~TiffImporter();
49 
50  virtual PvlGroup convertProjection() const;
51 
52  virtual bool isGrayscale() const;
53  virtual bool isRgb() const;
54  virtual bool isArgb() const;
55 
56  protected:
57  int samplesPerPixel() const;
58 
59  virtual void updateRawBuffer(int line, int band) const;
60  virtual int getPixel(int s, int l) const;
61 
62  virtual int getGray(int pixel) const;
63  virtual int getRed(int pixel) const;
64  virtual int getGreen(int pixel) const;
65  virtual int getBlue(int pixel) const;
66  virtual int getAlpha(int pixel) const;
67 
68  private:
70  TIFF *m_image;
71 
73  uint32 *m_raster;
74 
76  uint16 m_photo;
77 
79  uint16 m_samplesPerPixel;
80 
82  GTIF *m_geotiff;
83 
85  PvlGroup m_map;
86 
87  Pvl gdalItems(const Pvl &outPvl) const;
88  Pvl upperLeftXY(const Pvl &inLab) const;
89  Pvl resolution(const Pvl &inLab) const;
90 
91  };
92 };
93 
94 
95 #endif
Isis::TProjection::LocalRadius
double LocalRadius(double lat) const
This method returns the local radius in meters at the specified latitude position.
Definition: TProjection.cpp:326
FileName.h
ProjectionFactory.h
Isis::TiffImporter::~TiffImporter
virtual ~TiffImporter()
Destruct the importer.
Definition: TiffImporter.cpp:85
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::TiffImporter::isArgb
virtual bool isArgb() const
Tests to see if the input image is not grayscale and has more than three samples per pixel,...
Definition: TiffImporter.cpp:545
Isis::ImageImporter::convertRgbToGray
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...
Definition: ImageImporter.cpp:399
Isis::ImageImporter::setSamples
void setSamples(int s)
Set the sample dimension (width) of the output image.
Definition: ImageImporter.cpp:241
Isis::TiffImporter::getGray
virtual int getGray(int pixel) const
Retrieves the gray component of the given pixel.
Definition: TiffImporter.cpp:587
Isis::PI
const double PI
The mathematical constant PI.
Definition: Constants.h:40
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
PvlGroup.h
Isis::FileName::fileExists
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:449
Isis::TiffImporter::convertProjection
virtual PvlGroup convertProjection() const
Convert any projection information associated with the input image to an ISIS Mapping group in PVL fo...
Definition: TiffImporter.cpp:110
Isis::TiffImporter::getAlpha
virtual int getAlpha(int pixel) const
Retrieves the alpha component of the given pixel.
Definition: TiffImporter.cpp:635
Isis::TiffImporter::getPixel
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 g...
Definition: TiffImporter.cpp:571
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::ImageImporter
Imports images with standard formats into Isis as cubes.
Definition: ImageImporter.h:39
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
IString.h
Isis::TiffImporter::isRgb
virtual bool isRgb() const
Tests to see if the input image is neither grayscale nor has more than three samples per pixel,...
Definition: TiffImporter.cpp:534
Isis::TiffImporter::TiffImporter
TiffImporter(FileName inputName)
Construct the importer.
Definition: TiffImporter.cpp:33
Isis::PvlToPvlTranslationManager
Allows applications to translate simple text files.
Definition: PvlToPvlTranslationManager.h:65
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::ImageImporter::setDefaultBands
void setDefaultBands()
Set the number of bands to be created for the output cube based on the number of color channels in th...
Definition: ImageImporter.cpp:192
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Pvl.h
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::TProjection
Base class for Map TProjections.
Definition: TProjection.h:166
Isis::ImageImporter::samples
int samples() const
The sample dimension (width) of the output image.
Definition: ImageImporter.cpp:278
Isis::TiffImporter::getGreen
virtual int getGreen(int pixel) const
Retrieves the green component of the given pixel.
Definition: TiffImporter.cpp:611
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ImageImporter::setLines
void setLines(int l)
Set the line dimension (height) of the output image.
Definition: ImageImporter.cpp:251
Isis::ProjectionFactory::Create
static Isis::Projection * Create(Isis::Pvl &label, bool allowDefaults=false)
This method returns a pointer to a Projection object.
Definition: ProjectionFactory.cpp:51
Isis::Angle
Defines an angle and provides unit conversions.
Definition: Angle.h:45
TiffImporter.h
TProjection.h
Isis::PvlObject::addGroup
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
Isis::ImageImporter::lines
int lines() const
The line dimension (height) of the output image.
Definition: ImageImporter.cpp:288
Isis::PvlContainer::deleteKeyword
void deleteKeyword(const QString &name)
Remove a specified keyword.
Definition: PvlContainer.cpp:97
Isis::TProjection::TrueScaleLatitude
virtual double TrueScaleLatitude() const
This method returns the latitude of true scale.
Definition: TProjection.cpp:368
Isis::TiffImporter::getBlue
virtual int getBlue(int pixel) const
Retrieves the blue component of the given pixel.
Definition: TiffImporter.cpp:623
IException.h
Isis::TiffImporter
Imports TIFF images as Isis cubes.
Definition: TiffImporter.h:45
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Angle.h
Isis::TiffImporter::updateRawBuffer
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 u...
Definition: TiffImporter.cpp:557
ImageImporter.h
Isis::TiffImporter::getRed
virtual int getRed(int pixel) const
Retrieves the red component of the given pixel.
Definition: TiffImporter.cpp:599
Isis::TiffImporter::samplesPerPixel
int samplesPerPixel() const
The number of "samples" (bands in Isis terms) per pixel in the input image.
Definition: TiffImporter.cpp:510
PvlToPvlTranslationManager.h
Isis::PvlToPvlTranslationManager::Auto
void Auto(Pvl &outputLabel)
Automatically translate all the output names found in the translation table If a output name does not...
Definition: PvlToPvlTranslationManager.cpp:199
Isis::TiffImporter::isGrayscale
virtual bool isGrayscale() const
Tests to see if the input image has a "min is white" or "min is black" photometric interpretation,...
Definition: TiffImporter.cpp:521
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126