OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ossimGeneralRasterInfo Class Reference

#include <ossimGeneralRasterInfo.h>

Inheritance diagram for ossimGeneralRasterInfo:
ossimObject ossimReferenced

Public Types

enum  ossimFillMode { NONE, ZEROES_TO_MIN, ZEROES_TO_NULL_EDGES_ONLY }
 
enum  { UNKNOWN = -1 }
 

Public Member Functions

 ossimGeneralRasterInfo ()
 
 ossimGeneralRasterInfo (const std::vector< ossimFilename > &imageFileList, ossimScalarType pixelType, ossimInterleaveType il_type, ossim_int32 numberOfBands, ossim_int32 lines, ossim_int32 samples, ossim_int32 headerSize, ossimFillMode nullsMode, ossim_int32 pixelsToChop)
 
 ossimGeneralRasterInfo (const ossimKeywordlist &kwl, const char *prefix=0)
 
 ossimGeneralRasterInfo (const ossimGeneralRasterInfo &obj)
 
const ossimGeneralRasterInfooperator= (const ossimGeneralRasterInfo &rhs)
 Assignment operator=. More...
 
virtual ~ossimGeneralRasterInfo ()
 
const ossimIrectimageRect () const
 Zero based rectangle of the valid image. More...
 
const ossimIrectvalidImageRect () const
 Returns the rectangle of where the image is within the raster file. More...
 
const ossimIrectrawImageRect () const
 Zero based rectangle of the raw image. More...
 
const ossimIptsubImageOffset () const
 Returns the offset of this image's origin to a full-image's origin, in the case where this image is a sub-image of a larger full-image. More...
 
ossim_int32 headerSize () const
 Returns the size of header in bytes. More...
 
ossim_uint32 fillToNullsMode () const
 Returns the fill mode. More...
 
void setFillToNullsMode (ossim_uint32 mode)
 Sets theSetNullsMode. More...
 
ossim_int32 numberOfBands () const
 Number of bands. More...
 
ossim_int32 bytesPerPixel () const
 Bytes per pixel. More...
 
ossim_int32 pixelsToChop () const
 Returns the number of pixels from the edge of a line to set to the fill value. More...
 
ossimInterleaveType interleaveType () const
 Enumerated in InterleaveTypeLUT. More...
 
ossim_int32 validLines () const
 Returns the number of lines within "theValidImageRect". More...
 
ossim_int32 rawLines () const
 Returns the number of lines within "theRawImageRect". More...
 
ossim_int32 bytesPerRawLine () const
 Returns the number of bytes in a raw line. More...
 
ossim_int32 bytesPerValidLine () const
 Returns the number of bytes in a valid line. More...
 
ossim_int32 validSamples () const
 Returns the number of samples within "theValidImageRect". More...
 
ossim_int32 rawSamples () const
 Returns the number of samples within "theRawImageRect". More...
 
std::streamoff offsetToFirstValidSample () const
 Returns the offset in bytes to the first valid sample in the image. More...
 
const std::vector< ossimFilename > & getImageFileList () const
 
void setImageFileList (const std::vector< ossimFilename > &list)
 
void setImageFile (const ossimFilename &file)
 Sets the image file list to file. More...
 
void setHeaderSize (ossim_int32 headerSize)
 
void setInterleaveType (ossimInterleaveType il_type)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
void setImageRect (const ossimIrect &imageRect)
 
void setValidImageRect (const ossimIrect &imageRect)
 
void setRawImageRect (const ossimIrect &imageRect)
 
void setSubImageOffset (const ossimIpt &d)
 
ossimByteOrder getImageDataByteOrder () const
 
void setImageDataByteOrder (ossimByteOrder byteOrder)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
bool open (const ossimFilename &imageFile)
 Takes image file and attempts to derive/find header file to parse for general raster data, i.e. More...
 
const ossimImageMetaDatagetImageMetaData () const
 
ossimImageMetaDatagetImageMetaData ()
 
bool initializeFromEnviHdr (const ossimEnviHeader &enviHdr)
 Initialize from envi header file. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Private Member Functions

bool initializeFromHdr (const ossimFilename &imageFile, const ossimFilename &headerFile)
 Initialize from header file. More...
 
bool initializeFromEnviHdr (const ossimFilename &headerFile)
 Initialize from envi header file. More...
 
bool initializeFromXml (const ossimFilename &imageFile, const ossimFilename &headerFile)
 Initialize from omd file. More...
 
ossim_int32 getBitsPerPixel (const ossimFilename &imageFile) const
 Private method to get bits per pixel from file size, lines, samples and bands. More...
 
void clear ()
 Clears data members. More...
 

Private Attributes

ossimImageMetaData theMetaData
 
std::vector< ossimFilenametheImageFileList
 
ossimInterleaveType theInterleaveType
 
ossimIrect theRawImageRect
 The zero based rectangle of the entire image not including any header. More...
 
ossimIrect theValidImageRect
 The rectangle representing where the valid part of the image lies within "theRawImageRect". More...
 
ossimIrect theImageRect
 The valid image rectangle normalized to be zero based. More...
 
ossimIpt theSubImageOffset
 The offset from the full-image origin to this image's origin. More...
 
ossim_int32 theHeaderSize
 Size of header in bytes. More...
 
ossimFillMode theSetNullsMode
 Mode of how to handle pixels on import. More...
 
ossim_int32 thePixelsToChop
 Amount of pixels to chop for each line edge. More...
 
ossimByteOrder theImageDataByteOrder
 The byte order the image data is stored in. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 39 of file ossimGeneralRasterInfo.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
UNKNOWN 

Definition at line 50 of file ossimGeneralRasterInfo.h.

◆ ossimFillMode

Constructor & Destructor Documentation

◆ ossimGeneralRasterInfo() [1/4]

ossimGeneralRasterInfo::ossimGeneralRasterInfo ( )

Definition at line 81 of file ossimGeneralRasterInfo.cpp.

References ossimIrect::makeNan(), theImageRect, theRawImageRect, and theValidImageRect.

82  :
83  theMetaData(),
88  theImageRect(),
89  theSubImageOffset(0,0),
90  theHeaderSize(0),
92  thePixelsToChop(0),
94 {
98 }
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossimImageMetaData theMetaData
std::vector< ossimFilename > theImageFileList
ossimInterleaveType theInterleaveType
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
void makeNan()
Definition: ossimIrect.h:329

◆ ossimGeneralRasterInfo() [2/4]

ossimGeneralRasterInfo::ossimGeneralRasterInfo ( const std::vector< ossimFilename > &  imageFileList,
ossimScalarType  pixelType,
ossimInterleaveType  il_type,
ossim_int32  numberOfBands,
ossim_int32  lines,
ossim_int32  samples,
ossim_int32  headerSize,
ossimFillMode  nullsMode,
ossim_int32  pixelsToChop 
)

Definition at line 100 of file ossimGeneralRasterInfo.cpp.

References ossimIrect::set_lrx(), ossimIrect::set_lry(), theImageRect, theRawImageRect, and theValidImageRect.

109  :
110  theMetaData(pixelType, numberOfBands),
111  theImageFileList(imageFileList),
112  theInterleaveType(il_type),
113  theRawImageRect(0,0,0,0),
114  theValidImageRect(0,0,0,0),
115  theImageRect(0,0,0,0),
116  theSubImageOffset(0,0),
118  theSetNullsMode(nullsMode),
121 {
122  theRawImageRect.set_lry(lines - 1);
123  theRawImageRect.set_lrx(samples - 1);
126 }
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 headerSize() const
Returns the size of header in bytes.
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossimImageMetaData theMetaData
std::vector< ossimFilename > theImageFileList
ossimInterleaveType theInterleaveType
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
void set_lrx(ossim_int32 x)
Definition: ossimIrect.h:693
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
void set_lry(ossim_int32 y)
Definition: ossimIrect.h:702
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
ossim_int32 pixelsToChop() const
Returns the number of pixels from the edge of a line to set to the fill value.
ossim_int32 numberOfBands() const
Number of bands.

◆ ossimGeneralRasterInfo() [3/4]

ossimGeneralRasterInfo::ossimGeneralRasterInfo ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)

Definition at line 128 of file ossimGeneralRasterInfo.cpp.

References loadState(), ossimIrect::makeNan(), theImageRect, theRawImageRect, and theValidImageRect.

130  :
133  theRawImageRect(0,0,0,0),
134  theValidImageRect(0,0,0,0),
135  theImageRect(0,0,0,0),
136  theSubImageOffset(0,0),
137  theHeaderSize(0),
139  thePixelsToChop(0),
141 {
145 
146  loadState(kwl, prefix);
147 }
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
std::vector< ossimFilename > theImageFileList
ossimInterleaveType theInterleaveType
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
void makeNan()
Definition: ossimIrect.h:329

◆ ossimGeneralRasterInfo() [4/4]

ossimGeneralRasterInfo::ossimGeneralRasterInfo ( const ossimGeneralRasterInfo obj)

Definition at line 149 of file ossimGeneralRasterInfo.cpp.

150  :
151  theMetaData ( obj.theMetaData ),
156  theImageRect ( obj.theImageRect ),
162 {
163 }
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossimImageMetaData theMetaData
std::vector< ossimFilename > theImageFileList
ossimInterleaveType theInterleaveType
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.

◆ ~ossimGeneralRasterInfo()

ossimGeneralRasterInfo::~ossimGeneralRasterInfo ( )
virtual

Definition at line 185 of file ossimGeneralRasterInfo.cpp.

186 {
187 }

Member Function Documentation

◆ bytesPerPixel()

ossim_int32 ossimGeneralRasterInfo::bytesPerPixel ( ) const
inline

Bytes per pixel.

Inlined below.

Returns
Bytes per pixel from theMetaData class member cast to an int32.

Definition at line 360 of file ossimGeneralRasterInfo.h.

References ossimImageMetaData::getBytesPerPixel(), and theMetaData.

Referenced by bytesPerRawLine(), bytesPerValidLine(), and offsetToFirstValidSample().

361 {
362  return static_cast<ossim_int32>( theMetaData.getBytesPerPixel() );
363 }
ossim_uint32 getBytesPerPixel() const
ossimImageMetaData theMetaData
int ossim_int32

◆ bytesPerRawLine()

ossim_int32 ossimGeneralRasterInfo::bytesPerRawLine ( ) const
inline

Returns the number of bytes in a raw line.

Definition at line 375 of file ossimGeneralRasterInfo.h.

References bytesPerPixel(), interleaveType(), numberOfBands(), OSSIM_BIP, and rawSamples().

Referenced by offsetToFirstValidSample(), and ossimGeneralRasterElevHandler::setFilename().

376 {
377  if (interleaveType() == OSSIM_BIP)
378  {
379  return rawSamples() * bytesPerPixel() * numberOfBands();
380  }
381  else
382  {
383  return rawSamples() * bytesPerPixel();
384  }
385 }
ossim_int32 bytesPerPixel() const
Bytes per pixel.
ossimInterleaveType interleaveType() const
Enumerated in InterleaveTypeLUT.
ossim_int32 rawSamples() const
Returns the number of samples within "theRawImageRect".
ossim_int32 numberOfBands() const
Number of bands.

◆ bytesPerValidLine()

ossim_int32 ossimGeneralRasterInfo::bytesPerValidLine ( ) const
inline

Returns the number of bytes in a valid line.

Definition at line 387 of file ossimGeneralRasterInfo.h.

References bytesPerPixel(), interleaveType(), numberOfBands(), OSSIM_BIP, and validSamples().

388 {
389  if (interleaveType() == OSSIM_BIP)
390  {
391  return validSamples() * bytesPerPixel() * numberOfBands();
392  }
393  else
394  {
395  return validSamples() * bytesPerPixel();
396  }
397 }
ossim_int32 validSamples() const
Returns the number of samples within "theValidImageRect".
ossim_int32 bytesPerPixel() const
Bytes per pixel.
ossimInterleaveType interleaveType() const
Enumerated in InterleaveTypeLUT.
ossim_int32 numberOfBands() const
Number of bands.

◆ clear()

void ossimGeneralRasterInfo::clear ( )
private

Clears data members.

Definition at line 189 of file ossimGeneralRasterInfo.cpp.

References ossimImageMetaData::clear(), ossimIrect::makeNan(), NONE, OSSIM_BIL, OSSIM_LITTLE_ENDIAN, theHeaderSize, theImageDataByteOrder, theImageFileList, theImageRect, theInterleaveType, theMetaData, thePixelsToChop, theRawImageRect, theSetNullsMode, theSubImageOffset, theValidImageRect, ossimIpt::x, and ossimIpt::y.

190 {
191  theMetaData.clear();
192  theImageFileList.clear();
197  theSubImageOffset.x = 0;
198  theSubImageOffset.y = 0;
199  theHeaderSize = 0;
201  thePixelsToChop = 0;
203 }
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossimImageMetaData theMetaData
std::vector< ossimFilename > theImageFileList
ossimInterleaveType theInterleaveType
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossim_int32 y
Definition: ossimIpt.h:142
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
void makeNan()
Definition: ossimIrect.h:329
ossim_int32 x
Definition: ossimIpt.h:141

◆ fillToNullsMode()

ossim_uint32 ossimGeneralRasterInfo::fillToNullsMode ( ) const

Returns the fill mode.

This is used to flip values on ingest. Valid Mode Enumerations:

  • 0 Do nothing to the pixels on ingest.
  • 1 Flip all zeroes to the minimum pixel value.
  • 2 Flip zeroes within the image line to minimum pixel value. This is used by edge walking code.

Definition at line 230 of file ossimGeneralRasterInfo.cpp.

References theSetNullsMode.

231 {
232  return theSetNullsMode;
233 }
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.

◆ getBitsPerPixel()

ossim_int32 ossimGeneralRasterInfo::getBitsPerPixel ( const ossimFilename imageFile) const
private

Private method to get bits per pixel from file size, lines, samples and bands.

Method created to avoid duplicate code in "initizeFrom" methods.

This assumes that "theRawImageRect" and "theNumberOfBands" has been set.

Parameters
imageFileThis image file.
Calculatedbits per pixel.
Returns
bits per pixel or 0 on error.

Definition at line 1285 of file ossimGeneralRasterInfo.cpp.

References numberOfBands(), ossimString::size(), ossimIrect::size(), theRawImageRect, ossimIpt::x, and ossimIpt::y.

Referenced by initializeFromHdr().

1286 {
1287  // Note currently does not consider header size.
1288  ossim_int32 result = 0;
1289 
1290  ossim_int64 fileSize = imageFile.size();
1291  ossimIpt rectSize = theRawImageRect.size();
1292  if ( fileSize && rectSize.x && rectSize.y && numberOfBands() )
1293  {
1294  result = ( fileSize / rectSize.x / rectSize.y / numberOfBands() ) * 8;
1295  }
1296  return result;
1297 }
ossimIpt size() const
Definition: ossimIrect.h:510
std::string::size_type size() const
Definition: ossimString.h:405
ossim_int32 y
Definition: ossimIpt.h:142
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
long long ossim_int64
ossim_int32 x
Definition: ossimIpt.h:141
ossim_int32 numberOfBands() const
Number of bands.
int ossim_int32

◆ getImageDataByteOrder()

ossimByteOrder ossimGeneralRasterInfo::getImageDataByteOrder ( ) const

Definition at line 324 of file ossimGeneralRasterInfo.cpp.

References theImageDataByteOrder.

Referenced by ossimGeneralRasterElevHandler::setFilename().

325 {
326  return theImageDataByteOrder;
327 }
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.

◆ getImageFileList()

const std::vector< ossimFilename > & ossimGeneralRasterInfo::getImageFileList ( ) const

Definition at line 273 of file ossimGeneralRasterInfo.cpp.

References theImageFileList.

274 {
275  return theImageFileList;
276 }
std::vector< ossimFilename > theImageFileList

◆ getImageMetaData() [1/2]

const ossimImageMetaData & ossimGeneralRasterInfo::getImageMetaData ( ) const
inline

◆ getImageMetaData() [2/2]

ossimImageMetaData & ossimGeneralRasterInfo::getImageMetaData ( )
inline
Returns
Reference to theMetaData class member.

Definition at line 350 of file ossimGeneralRasterInfo.h.

References theMetaData.

351 {
352  return theMetaData;
353 }
ossimImageMetaData theMetaData

◆ headerSize()

ossim_int32 ossimGeneralRasterInfo::headerSize ( ) const

Returns the size of header in bytes.

Definition at line 225 of file ossimGeneralRasterInfo.cpp.

References theHeaderSize.

Referenced by offsetToFirstValidSample(), and setHeaderSize().

226 {
227  return theHeaderSize;
228 }
ossim_int32 theHeaderSize
Size of header in bytes.

◆ imageRect()

const ossimIrect & ossimGeneralRasterInfo::imageRect ( ) const

Zero based rectangle of the valid image.

Definition at line 205 of file ossimGeneralRasterInfo.cpp.

References theImageRect.

Referenced by ossimGeneralRasterElevHandler::setFilename(), setImageRect(), setRawImageRect(), and setValidImageRect().

206 {
207  return theImageRect;
208 }
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.

◆ initializeFromEnviHdr() [1/2]

bool ossimGeneralRasterInfo::initializeFromEnviHdr ( const ossimEnviHeader enviHdr)

Initialize from envi header file.

Parameters
enviHeader
Returns
true on success, false on error.

Definition at line 1098 of file ossimGeneralRasterInfo.cpp.

References ossimImageMetaData::clear(), ossimEnviHeader::getBands(), ossimEnviHeader::getByteOrder(), ossimEnviHeader::getHeaderOffset(), ossimEnviHeader::getLines(), ossimEnviHeader::getOssimInterleaveType(), ossimEnviHeader::getOssimScalarType(), ossimEnviHeader::getSamples(), ossimEnviHeader::getXStart(), ossimEnviHeader::getYStart(), NONE, OSSIM_INTERLEAVE_UNKNOWN, OSSIM_SCALAR_UNKNOWN, ossimImageMetaData::setNumberOfBands(), ossimImageMetaData::setScalarType(), theHeaderSize, theImageDataByteOrder, theImageFileList, theImageRect, theInterleaveType, theMetaData, thePixelsToChop, theRawImageRect, theSetNullsMode, theSubImageOffset, theValidImageRect, ossimIpt::x, and ossimIpt::y.

Referenced by initializeFromEnviHdr().

1099 {
1100  bool result = false;
1101 
1102  while( 1 )
1103  {
1104  //---
1105  // Go through the data members in order.
1106  // If a required item is not found break from loop.
1107  //--
1108  theMetaData.clear();
1109 
1110  // scalar ( required ) :
1111  if( enviHdr.getOssimScalarType() != OSSIM_SCALAR_UNKNOWN )
1112  {
1114  }
1115  else
1116  {
1117  break;
1118  }
1119 
1120  theImageFileList.clear();
1121 
1122  // interleave ( required ):
1125  {
1126  break;
1127  }
1128 
1129  // bands ( required ):
1130  if ( !enviHdr.getBands() )
1131  {
1132  break;
1133  }
1134  theMetaData.setNumberOfBands( enviHdr.getBands() );
1135 
1136  // lines ( required ):
1137  ossim_uint32 lines = enviHdr.getLines();
1138  if ( !lines )
1139  {
1140  break;
1141  }
1142 
1143  // samples ( required ):
1144  ossim_uint32 samples = enviHdr.getSamples();
1145  if ( !samples )
1146  {
1147  break;
1148  }
1149 
1150  // Set the rectangles:
1151  theRawImageRect = ossimIrect( 0, 0, samples - 1, lines - 1 );
1154 
1155  // sample start ( not required ):
1156  theSubImageOffset.x = enviHdr.getXStart();
1157 
1158  // line start ( not required ):
1159  theSubImageOffset.y = enviHdr.getYStart();
1160 
1161  // header offset ( not required ):
1162  theHeaderSize = enviHdr.getHeaderOffset();
1163 
1164  // null mode:
1166 
1167  // pixels to chop:
1168  thePixelsToChop = 0;
1169 
1170  // Byte order, this will be system if not found.
1171  theImageDataByteOrder = enviHdr.getByteOrder();
1172 
1173  result = true;
1174  break; // Trailing break to get out.
1175  }
1176  return result;
1177 
1178 } // End: ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimEnviHeader& )
void setScalarType(ossimScalarType aType)
ossimScalarType getOssimScalarType() const
ossim_int32 theHeaderSize
Size of header in bytes.
ossimInterleaveType getOssimInterleaveType() const
ossim_uint32 getHeaderOffset() const
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossimImageMetaData theMetaData
std::vector< ossimFilename > theImageFileList
void setNumberOfBands(ossim_uint32 numberOfBands)
ossim_uint32 getLines() const
ossimInterleaveType theInterleaveType
ossim_uint32 getBands() const
unsigned int ossim_uint32
ossim_int32 getXStart() const
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossim_uint32 getSamples() const
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossim_int32 y
Definition: ossimIpt.h:142
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
ossim_int32 getYStart() const
ossim_int32 x
Definition: ossimIpt.h:141
ossimByteOrder getByteOrder() const

◆ initializeFromEnviHdr() [2/2]

bool ossimGeneralRasterInfo::initializeFromEnviHdr ( const ossimFilename headerFile)
private

Initialize from envi header file.

Parameters
headerFile
Returns
true on success, false on error.

Definition at line 1087 of file ossimGeneralRasterInfo.cpp.

References initializeFromEnviHdr(), and ossimEnviHeader::open().

1088 {
1089  bool result = false;
1090  ossimEnviHeader hdr;
1091  if( hdr.open( headerFile ) )
1092  {
1093  result = initializeFromEnviHdr( hdr );
1094  }
1095  return result;
1096 }
bool open(const ossimFilename &file)
Opens an envi header.
bool initializeFromEnviHdr(const ossimEnviHeader &enviHdr)
Initialize from envi header file.
Class for reading and writing an ENVI (The Environment for Visualizing Images) header file...

◆ initializeFromHdr()

bool ossimGeneralRasterInfo::initializeFromHdr ( const ossimFilename imageFile,
const ossimFilename headerFile 
)
private

Initialize from header file.

Parameters
headerFile
Returns
true on success, false on error.

Definition at line 882 of file ossimGeneralRasterInfo.cpp.

References ossimKeywordlist::addFile(), ossim::byteOrder(), ossimKeywordlist::change_delimiter(), ossimImageMetaData::clear(), ossimKeywordlist::downcaseKeywords(), ossimString::empty(), ossimKeywordlist::findKey(), getBitsPerPixel(), ossimLookUpTable::getEntryNumber(), ossimImageMetaData::getNumberOfBands(), NONE, ossimLookUpTable::NOT_FOUND, OSSIM_BIG_ENDIAN, OSSIM_BIL, OSSIM_FLOAT32, OSSIM_LITTLE_ENDIAN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, ossimImageMetaData::setNullPix(), ossimImageMetaData::setNullValuesValid(), ossimImageMetaData::setNumberOfBands(), ossimImageMetaData::setScalarType(), ossimString::size(), ossimString::string(), theHeaderSize, theImageDataByteOrder, theImageFileList, theImageRect, theInterleaveType, theMetaData, thePixelsToChop, theRawImageRect, theSetNullsMode, theSubImageOffset, theValidImageRect, ossimString::toInt32(), ossimString::toUInt32(), true, ossimIpt::x, and ossimIpt::y.

884 {
885  bool result = false;
886 
887  ossimKeywordlist kwl;
888  char delimeter = ' ';
889  kwl.change_delimiter(delimeter);
890 
891  if ( kwl.addFile(headerFile) )
892  {
893  kwl.downcaseKeywords();
894  ossimString value;
895 
896  while( 1 )
897  {
898  //---
899  // Go through the data members in order.
900  // If a required item is not found break from loop.
901  //--
902  theMetaData.clear();
903 
904  // scalar ( default ) - adjusted below :
906 
907  // Image file name:
908  theImageFileList.clear();
909  theImageFileList.push_back( imageFile );
910 
911  // interleave ( not required - default=BIL)
913  value.string() = kwl.findKey( std::string("layout") );
914  if ( value.size() )
915  {
917  ossim_int32 intrlv = lut.getEntryNumber( value.string().c_str(), true );
918  if ( intrlv != ossimLookUpTable::NOT_FOUND )
919  {
920  theInterleaveType = static_cast<ossimInterleaveType>(intrlv);
921  }
922  }
923 
924  // bands ( required ):
925  ossim_uint32 bands = 0;
926  value.string() = kwl.findKey( std::string("nbands") );
927  if ( value.size() )
928  {
929  bands = value.toUInt32();
930  }
931  if ( !bands )
932  {
933  break;
934  }
935  theMetaData.setNumberOfBands( bands );
936 
937  // lines ( required ):
938  ossim_int32 lines = 0;
939  value.string() = kwl.findKey( std::string("nrows") );
940  if ( value.size() )
941  {
942  lines = value.toInt32();
943  }
944  if ( !lines )
945  {
946  break;
947  }
948 
949  // samples ( required ):
950  ossim_int32 samples = 0;
951  value.string() = kwl.findKey( std::string("ncols") );
952  if ( value.size() )
953  {
954  samples = value.toInt32();
955  }
956  if ( !samples )
957  {
958  break;
959  }
960 
961  // nodata or null value ( not required )
962  value.string() = kwl.findKey( std::string("nodata") );
963  if ( value.empty() )
964  {
965  value.string() = kwl.findKey( std::string("nodata_value") );
966  }
967  if ( value.size() )
968  {
969  ossim_float64 nullValue = value.toUInt32();
970  for ( ossim_uint32 band = 0; band < theMetaData.getNumberOfBands(); ++band )
971  {
972  theMetaData.setNullPix( band, nullValue );
973  }
975  }
976 
977  // Set the rectangles:
978  theRawImageRect = ossimIrect( 0, 0, samples - 1, lines - 1 );
981 
982  // sample start ( not required ):
983  theSubImageOffset.x = 0;
984 
985  // line start ( not required ):
986  theSubImageOffset.y = 0;
987 
988  // header offset ( not required ):
989  theHeaderSize = 0;
990 
991  // null mode:
993 
994  // pixels to chop:
995  thePixelsToChop = 0;
996 
997  // Byte order, ( not required - defaulted to system if not found.
999  value.string() = kwl.findKey( std::string("byteorder") );
1000  if ( value.size() )
1001  {
1002  ossim_uint32 i = value.toUInt32();
1003  if ( i == 0 )
1004  {
1006  }
1007  else
1008  {
1010  }
1011  }
1012 
1013  // Pixel type used for scalar below:
1014  std::string pixelType = "N"; // not defined
1015  value.string() = kwl.findKey( std::string("pixeltype") );
1016  if ( value.size() )
1017  {
1018  pixelType = value.string();
1019  }
1020 
1021  ossim_int32 nbits = -1;
1022  value.string() = kwl.findKey( std::string("nbits") );
1023  if ( value.size() )
1024  {
1025  nbits = value.toInt32();
1026  }
1027  else
1028  {
1029  nbits = getBitsPerPixel( imageFile );
1030  }
1031 
1032  switch( nbits )
1033  {
1034  case 8:
1035  {
1037  break;
1038  }
1039  case 16:
1040  {
1041  if (pixelType == "S")
1042  {
1044  }
1045  else
1046  {
1048  }
1049  break;
1050  }
1051  case 32:
1052  {
1053  if( pixelType == "S")
1054  {
1056  }
1057  else if( pixelType == "F")
1058  {
1060  }
1061  else
1062  {
1064  }
1065  break;
1066  }
1067  default:
1068  {
1069  if( (nbits < 8) && (nbits >= 1 ) )
1070  {
1072  }
1073  break;
1074  }
1075  }
1076 
1077  result = true;
1078  break; // Trailing break to get out.
1079  }
1080  }
1081 
1082  return result;
1083 
1084 } // End: ossimGeneralRasterInfo::initializeFromHdr
void setScalarType(ossimScalarType aType)
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
16 bit unsigned integer
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
Represents serializable keyword/value map.
bool addFile(const char *file)
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
void setNullValuesValid(bool flag)
ossimKeywordlist & downcaseKeywords()
ossimImageMetaData theMetaData
std::vector< ossimFilename > theImageFileList
16 bit signed integer
void change_delimiter(char del)
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossim_uint32 toUInt32() const
32 bit floating point
32 bit unsigned integer
ossim_uint32 getNumberOfBands() const
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
ossim_int32 toInt32() const
void setNumberOfBands(ossim_uint32 numberOfBands)
double ossim_float64
ossimInterleaveType theInterleaveType
std::string::size_type size() const
Definition: ossimString.h:405
32 bit signed integer
unsigned int ossim_uint32
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossim_int32 getBitsPerPixel(const ossimFilename &imageFile) const
Private method to get bits per pixel from file size, lines, samples and bands.
ossimInterleaveType
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossim_int32 y
Definition: ossimIpt.h:142
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
bool empty() const
Definition: ossimString.h:411
ossim_int32 x
Definition: ossimIpt.h:141
8 bit unsigned integer
void setNullPix(ossim_uint32 band, double pix)
int ossim_int32
const std::string & string() const
Definition: ossimString.h:414

◆ initializeFromXml()

bool ossimGeneralRasterInfo::initializeFromXml ( const ossimFilename imageFile,
const ossimFilename headerFile 
)
private

Initialize from omd file.

Parameters
file
Returns
true on success, false on error.

Definition at line 1180 of file ossimGeneralRasterInfo.cpp.

References ossim::byteOrder(), ossimImageMetaData::clear(), ossimString::contains(), ossimFilename::fileSize(), ossimFgdcXmlDoc::getImageSize(), ossimFgdcXmlDoc::getNumberOfBands(), ossimFgdcXmlDoc::getPath(), NONE, numberOfBands(), ossimFgdcXmlDoc::open(), OSSIM_BIL, OSSIM_FLOAT32, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, ossimImageMetaData::setNumberOfBands(), ossimImageMetaData::setScalarType(), size, theHeaderSize, theImageDataByteOrder, theImageFileList, theImageRect, theInterleaveType, theMetaData, thePixelsToChop, theRawImageRect, theSetNullsMode, theSubImageOffset, theValidImageRect, ossimIpt::x, and ossimIpt::y.

1182 {
1183  bool result = false;
1184 
1185  ossimFgdcXmlDoc file;
1186  if (file.open( headerFile ))
1187  {
1188  while( 1 )
1189  {
1190  //---
1191  // Go through the data members in order.
1192  // If a required item is not found break from loop.
1193  //--
1194  theMetaData.clear();
1195 
1196  // scalar ( default ) - adjusted below :
1198 
1199  // Image file name:
1200  theImageFileList.clear();
1201  theImageFileList.push_back( imageFile );
1202 
1203  // interleave ( defaulted ):
1205 
1206  // bands ( required ):
1207  if ( !file.getNumberOfBands() )
1208  {
1209  break;
1210  }
1212 
1213  ossimIpt size;
1214  if ( file.getImageSize(size) ) // Lines, samples not image file size.
1215  {
1216  // lines, samples ( required ):
1217  if ( !size.x || !size.y )
1218  {
1219  break;
1220  }
1221  }
1222  else
1223  {
1224  break;
1225  }
1226 
1227  // Set the rectangles:
1228  theRawImageRect = ossimIrect( 0, 0, size.x - 1, size.y - 1 );
1231 
1232  // sample start ( not required ):
1233  theSubImageOffset.x = 0;
1234 
1235  // line start ( not required ):
1236  theSubImageOffset.y = 0;
1237 
1238  // header offset ( not required ):
1239  theHeaderSize = 0;
1240 
1241  // null mode:
1243 
1244  // pixels to chop:
1245  thePixelsToChop = 0;
1246 
1247  // Byte order *** need this ***, defaulting to system for now:
1249 
1250  // Adjust scalar if needed, note defaulted to 8 bit above:
1251  ossimString eainfo;
1252  file.getPath("/metadata/eainfo/detailed/enttyp/enttypd", eainfo);
1253  ossim_int32 numBits = 0;
1254  ossim_int64 fileSize = imageFile.fileSize(); // Image file size.
1255  ossim_int32 numBytes = fileSize / size.x / size.y / numberOfBands();
1256  if( numBytes > 0 && numBytes != 3 )
1257  {
1258  numBits = numBytes*8;
1259  }
1260  if( numBits == 16 )
1261  {
1263  }
1264  else if( numBits == 32 )
1265  {
1266  if(eainfo.contains("float"))
1267  {
1269  }
1270  else
1271  {
1273  }
1274  }
1275 
1276  result = true;
1277  break; // Trailing break to get out.
1278  }
1279  }
1280 
1281  return result;
1282 
1283 } // End: ossimGeneralRasterInfo::initializeFromXml
void setScalarType(ossimScalarType aType)
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
16 bit unsigned integer
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossim_int64 fileSize() const
ossim_uint32 getNumberOfBands()
Get Bands.
bool contains(char aChar) const
Definition: ossimString.h:58
ossimImageMetaData theMetaData
bool getPath(const ossimString &path, ossimString &s) const
Gets path from doc and initializes string.
std::vector< ossimFilename > theImageFileList
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
32 bit floating point
32 bit unsigned integer
void setNumberOfBands(ossim_uint32 numberOfBands)
yy_size_t size
ossimInterleaveType theInterleaveType
Class for FGDC XML doc parsing.
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
bool getImageSize(ossimIpt &size) const
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossim_int32 y
Definition: ossimIpt.h:142
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
long long ossim_int64
bool open(const ossimFilename &xmlFileName)
Open method.
ossim_int32 x
Definition: ossimIpt.h:141
8 bit unsigned integer
ossim_int32 numberOfBands() const
Number of bands.
int ossim_int32

◆ interleaveType()

ossimInterleaveType ossimGeneralRasterInfo::interleaveType ( ) const

Enumerated in InterleaveTypeLUT.

Should be either bip, bil or bsq. Defaulted to bip.

Definition at line 268 of file ossimGeneralRasterInfo.cpp.

References theInterleaveType.

Referenced by ossimGeneralRasterTileSource::allocateBuffer(), bytesPerRawLine(), bytesPerValidLine(), ossimGeneralRasterTileSource::isBandSelector(), and offsetToFirstValidSample().

269 {
270  return theInterleaveType;
271 }
ossimInterleaveType theInterleaveType

◆ loadState()

bool ossimGeneralRasterInfo::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list.

Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 404 of file ossimGeneralRasterInfo.cpp.

Referenced by ossimGeneralRasterInfo(), and ossimGeneralRasterElevHandler::setFilename().

405 {
406  static const char MODULE[] = "ossimGeneralRasterInfo::loadState";
407  if ( traceDebug() )
408  {
409  CLOG << "DEBUG: entered..."
410  << "\nprefix: " << (prefix ? prefix : "")
411  << "\nInput keyword list:\n"
412  << kwl
413  << std::endl;
414  }
415 
416  bool result = false;
417 
418  //---
419  // Look for required and option keyword. Break from loop if required
420  // keyword is not found.
421  //---
422  while( 1 )
423  {
424  // Check for errors in the ossimKeywordlist.
426  {
427  if(traceDebug())
428  {
430  << MODULE << " ERROR:\n"
431  << "Detected an error in the keywordlist: " << kwl
432  << std::endl;
433  }
434  break;
435  }
436 
437  std::string key;
438  ossimString value; // Use for keyword list lookups.
439  ossim_int32 lines = 0;
440  ossim_int32 samples = 0;
441 
442  // Lines (required):
443  key = NUMBER_LINES;
444  value.string() = kwl.findKey( key ); // Required to have this.
445  if ( value.size() )
446  {
447  lines = value.toInt32();
448  if ( !lines )
449  {
450  if (traceDebug())
451  {
453  << " ERROR:\n"
454  << "Required number of lines is 0!" << std::endl;
455  }
456  break;
457  }
458  }
459  else
460  {
461  if (traceDebug())
462  {
464  << " ERROR:\n"
465  << "Required keyword not found: " << key << std::endl;
466  }
467  break;
468  }
469 
470  // Samples (required):
471  key = NUMBER_SAMPLES;
472  value.string() = kwl.findKey( key ); // Required to have this.
473  if ( value.size() )
474  {
475  samples = value.toInt32();
476  if ( !samples )
477  {
478  if (traceDebug())
479  {
481  << " ERROR:\n"
482  << "Required number of samples is 0!" << std::endl;
483  }
484  break;
485  }
486  }
487  else
488  {
489  if (traceDebug())
490  {
492  << " ERROR:\n"
493  << "Required keyword not found: " << key << std::endl;
494  }
495  break;
496  }
497 
498  // Bands ossimImageMetaData::loadState checks for required bands:
499  if(!theMetaData.loadState(kwl, prefix))
500  {
501  if (traceDebug())
502  {
504  << " Error loading meta data!\n" << std::endl;
505  }
506  break;
507  }
508 
509  // If we get here assign the rectangles:
510  theRawImageRect = ossimIrect( 0, 0, samples - 1, lines - 1 );
513 
514  int tmp = INTERLEAVE_TYPE_LUT.getEntryNumber(kwl);
515  if (tmp == ossimLookUpTable::NOT_FOUND)
516  {
518  }
519  else
520  {
521  theInterleaveType = static_cast<ossimInterleaveType>(tmp);
522  }
523 
524  // Get the image files.
526  {
527  // Look for "filename" first, then deprecated "image_file".
529  value.string() = kwl.findKey( key );
530  if ( value.empty() )
531  {
532  // deprecated keyword...
534  value.string() = kwl.findKey( key );
535  }
536 
537  if ( value.size() )
538  {
539  //---
540  // omd (ossim metadata) files can have just the base filename, e.g. image.ras,
541  // in which case open will fail if not in the image dir. So only put it in
542  // the list if it doesn't exits.
543  //---
544  ossimFilename f = value;
545  if ( f.exists() )
546  {
547  theImageFileList.clear();
548  theImageFileList.push_back(ossimFilename(value));
549  }
550  }
551 
552  if ( theImageFileList.empty() )
553  {
554  if (traceDebug())
555  {
557  << "ERROR:\n"
558  << "Required keyword not found: "
559  << ossimKeywordNames::FILENAME_KW << std::endl;
560  }
561  break;
562  }
563  }
564  else
565  {
566  // multiple file names.
567  ossim_int32 count = 0;
568 
569  // look for image file key word with no number.
570  // Required to have this.
572  value.string() = kwl.findKey( key );
573  if ( value.empty() )
574  {
575  // deprecated keyword...
577  value.string() = kwl.findKey( key );
578  }
579 
580  if ( value.size() )
581  {
582  theImageFileList.push_back(ossimFilename(value));
583  ++count;
584  }
585 
586  ossim_int32 i = 0;
587  while ( (count < numberOfBands()) && (i < 1000) )
588  {
590  key += ossimString::toString(i).string();
591  value.string() = kwl.findKey( key );
592  if ( value.empty() )
593  {
594  // Lookup for deprecated keyword.
596  key += ossimString::toString(i).string();
597  value.string() = kwl.findKey( key );
598  }
599 
600  if ( value.size() )
601  {
602  theImageFileList.push_back(ossimFilename(value));
603  ++count;
604  }
605  ++i;
606  }
607 
608  if (count != numberOfBands()) // Error, count should equal bands!
609  {
610  if (traceDebug())
611  {
613  << " ERROR:\n"
614  << "Required keyword not found: "
616  << "\nInterleave type is multi file; however,"
617  << " not enough were pick up!" << std::endl;
618  }
619  break;
620  }
621  }
622 
623  key = VALID_START_LINE;
624  value.string() = kwl.findKey( key ); // Default is zero.
625  if ( value.size() )
626  {
627  theValidImageRect.set_uly( value.toInt32() );
628  }
629 
630  key = VALID_STOP_LINE;
631  value.string() = kwl.findKey( key ); // Default is last line.
632  if ( value.size() )
633  {
634  theValidImageRect.set_lry( value.toInt32() );
635  }
636 
638  {
640  << " ERROR:"
641  << "\nValid stop line < start line."
642  << "\nValid start line: " << theValidImageRect.ul().y
643  << "\nValid stop line: " << theValidImageRect.lr().y
644  << "\nError status has been set. Returning." << std::endl;
645  break;
646  }
647 
648  key = VALID_START_SAMPLE;
649  value.string() = kwl.findKey( key ); // Default is zero.
650  if ( value.size() )
651  {
652  theValidImageRect.set_ulx( value.toInt32() );
653  }
654 
655  key = VALID_STOP_SAMPLE;
656  value.string() = kwl.findKey( key ); // Default is last sample.
657  if ( value.size() )
658  {
659  theValidImageRect.set_lrx( value.toInt32() );
660  }
661 
663  {
665  << " ERROR:"
666  << "\nValid stop samp < start samp."
667  << "\nValid start samp: " << theValidImageRect.ul().x
668  << "\nValid stop samp: " << theValidImageRect.lr().x
669  << "\nError status has been set. Returning." << std::endl;
670  break;
671  }
672 
677 
678  key = SUB_IMAGE_OFFSET_LINE;
679  value.string() = kwl.findKey( key ); // Default is zero.
680  if ( value.size() )
681  {
682  theSubImageOffset.line = value.toInt32();
683  }
684 
685  key = SUB_IMAGE_OFFSET_SAMP;
686  value.string() = kwl.findKey( key ); // Default is zero.
687  if ( value.size() )
688  {
689  theSubImageOffset.samp = atoi(value);
690  }
691 
692  key = HEADER_SIZE;
693  value.string() = kwl.findKey( key ); // Default is zero.
694  if ( value.size() )
695  {
696  theHeaderSize = value.toInt32();
697  }
698 
699  key = SET_NULLS;
700  value.string() = kwl.findKey( key ); // Default is 2.
701  if ( value.size() )
702  {
703  int tmp;
704  tmp = atoi(value);
705  if ((tmp < 3) && (tmp > -1))
706  {
708  }
709  else
710  {
713  << " WARNING:"
714  << "\nset_fill_to_nulls_mode value out of range."
715  << "\nDefaulted to 2" << std::endl;
716  }
717  }
718 
719  key = PIXELS_TO_CHOP;
720  value.string() = kwl.findKey( key ); // Default is zero.
721  if ( value.size() )
722  {
723  thePixelsToChop = value.toInt32();
724  }
725 
726  if (bytesPerPixel() > 1)
727  {
728  // get the byte order of the data.
730  value.string() = kwl.findKey( key );
731  if ( value.size() )
732  {
733  ossimString s(value);
734  if (s.trim() != "") // Check for empty string.
735  {
736  s.downcase();
737  if (s.contains("big"))
738  {
740  }
741  else if(s.contains("little"))
742  {
744  }
745  }
746  }
747  }
748 
749  // End of while forever loop.
750  result = true;
751  break;
752 
753  } // Matches: while (1)
754 
755  if ( traceDebug() )
756  {
758  << MODULE << " Exit status: " << (result?"true":"false") << std::endl;
759  }
760 
761  return result;
762 
763 } // End: bool ossimGeneralRasterInfo::loadState
void set_uly(ossim_int32 y)
Definition: ossimIrect.h:666
static const char * BYTE_ORDER_KW
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
ossim_int32 bytesPerPixel() const
Bytes per pixel.
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
#define CLOG
Definition: ossimTrace.h:23
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossimImageMetaData theMetaData
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< ossimFilename > theImageFileList
const ossimIpt & ul() const
Definition: ossimIrect.h:274
static const ossimErrorCode OSSIM_ERROR
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
ossim_int32 toInt32() const
bool exists() const
ossimInterleaveType theInterleaveType
std::string::size_type size() const
Definition: ossimString.h:405
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimInterleaveType
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
void set_lrx(ossim_int32 x)
Definition: ossimIrect.h:693
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossim_int32 samp
Definition: ossimIpt.h:141
void set_lry(ossim_int32 y)
Definition: ossimIrect.h:702
virtual ossimErrorCode getErrorStatus() const
ossim_int32 y
Definition: ossimIpt.h:142
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
bool empty() const
Definition: ossimString.h:411
ossim_int32 line
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
static const char * IMAGE_FILE_KW
static const char * FILENAME_KW
ossim_int32 numberOfBands() const
Number of bands.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32
void set_ulx(ossim_int32 x)
Definition: ossimIrect.h:657
const std::string & string() const
Definition: ossimString.h:414

◆ numberOfBands()

ossim_int32 ossimGeneralRasterInfo::numberOfBands ( ) const
inline

Number of bands.

Inlined below.

Returns
Number of bands from theMetaData class member cast to an int32.

Definition at line 355 of file ossimGeneralRasterInfo.h.

References ossimImageMetaData::getNumberOfBands(), and theMetaData.

Referenced by ossimGeneralRasterTileSource::allocateTile(), bytesPerRawLine(), bytesPerValidLine(), getBitsPerPixel(), initializeFromXml(), offsetToFirstValidSample(), and ossimGeneralRasterElevHandler::setFilename().

356 {
357  return static_cast<ossim_int32>( theMetaData.getNumberOfBands() );
358 }
ossimImageMetaData theMetaData
ossim_uint32 getNumberOfBands() const
int ossim_int32

◆ offsetToFirstValidSample()

std::streamoff ossimGeneralRasterInfo::offsetToFirstValidSample ( ) const
inline

Returns the offset in bytes to the first valid sample in the image.

Definition at line 409 of file ossimGeneralRasterInfo.h.

References bytesPerPixel(), bytesPerRawLine(), headerSize(), interleaveType(), numberOfBands(), OSSIM_BIL, OSSIM_BIP, ossimIrect::ul(), validImageRect(), ossimIpt::x, and ossimIpt::y.

410 {
411  if (interleaveType() == OSSIM_BIP)
412  {
413  return headerSize() +
414  ( bytesPerRawLine() * validImageRect().ul().y ) +
416  }
417  else if (interleaveType() == OSSIM_BIL)
418  {
419  return headerSize() +
421  ( validImageRect().ul().x * bytesPerPixel() );
422  }
423  else // BSQ
424  {
425  return headerSize() +
426  ( bytesPerRawLine() * validImageRect().ul().y ) +
427  ( validImageRect().ul().x * bytesPerPixel() );
428  }
429 }
ossim_int32 bytesPerPixel() const
Bytes per pixel.
ossim_int32 headerSize() const
Returns the size of header in bytes.
const ossimIrect & validImageRect() const
Returns the rectangle of where the image is within the raster file.
ossimInterleaveType interleaveType() const
Enumerated in InterleaveTypeLUT.
const ossimIpt & ul() const
Definition: ossimIrect.h:274
ossim_int32 bytesPerRawLine() const
Returns the number of bytes in a raw line.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
ossim_int32 numberOfBands() const
Number of bands.

◆ open()

bool ossimGeneralRasterInfo::open ( const ossimFilename imageFile)

Takes image file and attempts to derive/find header file to parse for general raster data, i.e.

lines, samples, bands and so on.

Parameters
imagefile.
Returns
true on success, false on error.

Definition at line 765 of file ossimGeneralRasterInfo.cpp.

766 {
767  static const char MODULE[] = "ossimGeneralRasterInfo::open";
768  if ( traceDebug() )
769  {
771  << MODULE << " entered..." << "\nimageFile: " << imageFile << std::endl;
772  }
773 
774  bool result = false;
775 
776  // Wipe any previous state slick.
777  clear();
778 
779  ossimFilename copyFile = imageFile;
780  if ( !imageFile.exists() )
781  {
782  copyFile = imageFile.expand();
783  }
784 
785  // Look for the headrer of omd file as they are written out by img2rr.
786  ossimFilename hdr = copyFile;
787  hdr.setExtension("hdr"); // image.hdr
788  if ( !hdr.exists() )
789  {
790  hdr = imageFile;
791  hdr.string() += ".hdr"; // image.ras.hdr
792  if ( ! hdr.exists() )
793  {
794  hdr = imageFile;
795  hdr.setExtension("xml"); // image.xml
796  }
797  }
798 
799  if ( hdr.exists() )
800  {
801  if ( traceDebug() )
802  {
803  ossimNotify(ossimNotifyLevel_DEBUG) << "header file: " << hdr << std::endl;
804  }
805 
806  ossimString ext = hdr.ext().downcase();
807 
808  if ( ext == "hdr" )
809  {
810  if ( ossimEnviHeader::isEnviHeader( hdr ) )
811  {
812  result = initializeFromEnviHdr( hdr );
813  }
814  else
815  {
816  result = initializeFromHdr( imageFile, hdr );
817  }
818 
819  if ( !result )
820  {
821  // Could be an ossim meta data file:
822  ossimKeywordlist kwl( hdr );
823  result = loadState( kwl, 0 );
824  }
825  }
826  else if ( ext == "xml" )
827  {
828  result = initializeFromXml( imageFile, hdr );
829  }
830  }
831 
832  //---
833  // Set the file name. Needed for ossimGeneralRasterTileSource::open.
834  // Note set here above loadState call to stop loadState from returning
835  // false if no image file found.
836  //---
837  if ( theImageFileList.empty() )
838  {
839  setImageFile( imageFile );
840  }
841 
842  ossimFilename omd = imageFile;
843  omd.setExtension("omd"); // image.omd
844  if ( !omd.exists() )
845  {
846  omd.setExtension("kwl"); // image.kwl
847  }
848 
849  if ( omd.exists() )
850  {
851  if ( traceDebug() )
852  {
853  ossimNotify(ossimNotifyLevel_DEBUG) << "omd file: " << omd << std::endl;
854  }
855 
856  ossimKeywordlist kwl( omd );
857 
858  if ( result && theMetaData.getNumberOfBands() )
859  {
860  //---
861  // Just update the band info in case it has min/max values from
862  // a compute min/max scan.
863  //---
864  theMetaData.updateMetaData( kwl, std::string("") );
865  }
866  else
867  {
868  // We're not initialized yet so do a loadState:
869  result = loadState( kwl, 0 );
870  }
871  }
872 
873  if ( traceDebug() )
874  {
876  << MODULE << " Exit status: " << (result?"true":"false") << std::endl;
877  }
878 
879  return result;
880 }
Represents serializable keyword/value map.
ossimFilename expand() const
Method to do file name expansion.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
static bool isEnviHeader(const ossimFilename &file)
Global method to test first line of file for "ENVI".
ossimImageMetaData theMetaData
std::vector< ossimFilename > theImageFileList
ossim_uint32 getNumberOfBands() const
bool initializeFromHdr(const ossimFilename &imageFile, const ossimFilename &headerFile)
Initialize from header file.
void clear()
Clears data members.
bool exists() const
void setImageFile(const ossimFilename &file)
Sets the image file list to file.
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
bool initializeFromXml(const ossimFilename &imageFile, const ossimFilename &headerFile)
Initialize from omd file.
bool initializeFromEnviHdr(const ossimEnviHeader &enviHdr)
Initialize from envi header file.
ossimString ext() const
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void updateMetaData(const ossimKeywordlist &kwl, const std::string &prefix)
Method to update band values.
const std::string & string() const
Definition: ossimString.h:414

◆ operator=()

const ossimGeneralRasterInfo & ossimGeneralRasterInfo::operator= ( const ossimGeneralRasterInfo rhs)

Assignment operator=.

Definition at line 165 of file ossimGeneralRasterInfo.cpp.

References theHeaderSize, theImageDataByteOrder, theImageFileList, theImageRect, theInterleaveType, theMetaData, thePixelsToChop, theRawImageRect, theSetNullsMode, theSubImageOffset, and theValidImageRect.

167 {
168  if ( this != &rhs )
169  {
170  theMetaData = rhs.theMetaData;
181  }
182  return *this;
183 }
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossimImageMetaData theMetaData
std::vector< ossimFilename > theImageFileList
ossimInterleaveType theInterleaveType
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.

◆ pixelsToChop()

ossim_int32 ossimGeneralRasterInfo::pixelsToChop ( ) const

Returns the number of pixels from the edge of a line to set to the fill value.

This can be used to eliminate resampling error on the edge of an image and still keep the image demensions relative to the geometry file.

Definition at line 263 of file ossimGeneralRasterInfo.cpp.

References thePixelsToChop.

264 {
265  return thePixelsToChop;
266 }
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.

◆ print()

std::ostream & ossimGeneralRasterInfo::print ( std::ostream &  out) const
virtual

Generic print method.

Derived classes should re-implement as they see fit.

Returns
std::ostream&

Reimplemented from ossimObject.

Definition at line 235 of file ossimGeneralRasterInfo.cpp.

References saveState().

Referenced by ossimERSTileSource::open().

236 {
237  //---
238  // This will print in a keyword format that can be read by the constructor.
239  // that takes a keyword list.
240  //---
241  ossimKeywordlist kwl;
242  saveState( kwl, 0 );
243  out << kwl << std::endl;
244  return out;
245 }
Represents serializable keyword/value map.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ rawImageRect()

const ossimIrect & ossimGeneralRasterInfo::rawImageRect ( ) const

Zero based rectangle of the raw image.

Definition at line 215 of file ossimGeneralRasterInfo.cpp.

References theRawImageRect.

216 {
217  return theRawImageRect;
218 }
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.

◆ rawLines()

ossim_int32 ossimGeneralRasterInfo::rawLines ( ) const
inline

Returns the number of lines within "theRawImageRect".

Definition at line 370 of file ossimGeneralRasterInfo.h.

References ossimIrect::height(), and theRawImageRect.

371 {
372  return static_cast<ossim_int32>(theRawImageRect.height());
373 }
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
int ossim_int32

◆ rawSamples()

ossim_int32 ossimGeneralRasterInfo::rawSamples ( ) const
inline

Returns the number of samples within "theRawImageRect".

Definition at line 404 of file ossimGeneralRasterInfo.h.

References theRawImageRect, and ossimIrect::width().

Referenced by bytesPerRawLine().

405 {
406  return static_cast<ossim_int32>(theRawImageRect.width());
407 }
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
int ossim_int32

◆ saveState()

bool ossimGeneralRasterInfo::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 329 of file ossimGeneralRasterInfo.cpp.

References ossimKeywordlist::add(), ossimKeywordNames::FILENAME_KW, ossimImageMetaData::saveState(), theImageFileList, theMetaData, and ossimString::toString().

Referenced by print().

331 {
332  for (ossim_uint32 i=0; i<theImageFileList.size(); ++i)
333  {
335  kw += ossimString::toString(i+1);
336  kwl.add(prefix, theImageFileList[i].c_str());
337  }
338 
339  theMetaData.saveState(kwl, prefix);
340 
341  kwl.add(prefix,
342  NUMBER_LINES,
343  ossimString::toString( rawLines() ), true);
344  kwl.add(prefix,
345  NUMBER_SAMPLES,
347  true);
348  kwl.add(prefix,
349  HEADER_SIZE,
351  true);
352  kwl.add(prefix,
353  SUB_IMAGE_OFFSET_LINE,
355  true);
356  kwl.add(prefix,
357  SUB_IMAGE_OFFSET_SAMP,
359  true);
360  kwl.add(prefix,
361  VALID_START_LINE,
363  true);
364  kwl.add(prefix,
365  VALID_STOP_LINE,
367  true);
368  kwl.add(prefix,
369  VALID_START_SAMPLE,
371  true);
372  kwl.add(prefix,
373  VALID_STOP_SAMPLE,
375  true);
376  kwl.add(prefix,
378  INTERLEAVE_TYPE_LUT.getEntryString(theInterleaveType),
379  true);
380 
381  kwl.add(prefix,
382  PIXELS_TO_CHOP,
384  true);
385 
386  kwl.add(prefix,
387  SET_NULLS,
389  true);
390 
391 
392  if (bytesPerPixel() > 1)
393  {
394  kwl.add(prefix,
396  (theImageDataByteOrder == OSSIM_LITTLE_ENDIAN ? "little_endian" :
397  "big_endian"),
398  true);
399  }
400 
401  return true;
402 }
static const char * BYTE_ORDER_KW
ossim_int32 bytesPerPixel() const
Bytes per pixel.
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
virtual ossimString getEntryString(ossim_int32 entry_number) const
ossimImageMetaData theMetaData
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< ossimFilename > theImageFileList
const ossimIpt & ul() const
Definition: ossimIrect.h:274
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimInterleaveType theInterleaveType
unsigned int ossim_uint32
ossim_int32 rawLines() const
Returns the number of lines within "theRawImageRect".
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossim_int32 rawSamples() const
Returns the number of samples within "theRawImageRect".
const ossimIpt & lr() const
Definition: ossimIrect.h:276
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
const ossimIpt & ur() const
Definition: ossimIrect.h:275
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.
static const char * INTERLEAVE_TYPE_KW
ossim_int32 samp
Definition: ossimIpt.h:141
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 line
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
static const char * FILENAME_KW

◆ setFillToNullsMode()

void ossimGeneralRasterInfo::setFillToNullsMode ( ossim_uint32  mode)

Sets theSetNullsMode.

Definition at line 247 of file ossimGeneralRasterInfo.cpp.

References ossimNotify(), ossimNotifyLevel_WARN, and theSetNullsMode.

248 {
249  static const char MODULE[] = "ossimGeneralRasterInfo::setFillToNullMode";
250  if(mode < 3)
251  {
253  }
254  else
255  {
257  << MODULE << " ERROR:"
258  << "\nmode out of bounds(0 - 2): " << mode << std::endl
259  << "\nmode has not been changed." << std::endl;
260  }
261 }
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ setHeaderSize()

void ossimGeneralRasterInfo::setHeaderSize ( ossim_int32  headerSize)

Definition at line 294 of file ossimGeneralRasterInfo.cpp.

References headerSize(), and theHeaderSize.

295 {
297 }
ossim_int32 theHeaderSize
Size of header in bytes.
ossim_int32 headerSize() const
Returns the size of header in bytes.

◆ setImageDataByteOrder()

void ossimGeneralRasterInfo::setImageDataByteOrder ( ossimByteOrder  byteOrder)

Definition at line 289 of file ossimGeneralRasterInfo.cpp.

References ossim::byteOrder(), and theImageDataByteOrder.

290 {
292 }
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54

◆ setImageFile()

void ossimGeneralRasterInfo::setImageFile ( const ossimFilename file)

Sets the image file list to file.

Performs a clear, prior to setting.

Parameters
fileImage file.

Definition at line 283 of file ossimGeneralRasterInfo.cpp.

References theImageFileList.

284 {
285  theImageFileList.clear();
286  theImageFileList.push_back( file );
287 }
std::vector< ossimFilename > theImageFileList

◆ setImageFileList()

void ossimGeneralRasterInfo::setImageFileList ( const std::vector< ossimFilename > &  list)

Definition at line 278 of file ossimGeneralRasterInfo.cpp.

References theImageFileList.

279 {
280  theImageFileList = list;
281 }
std::vector< ossimFilename > theImageFileList

◆ setImageRect()

void ossimGeneralRasterInfo::setImageRect ( const ossimIrect imageRect)

Definition at line 304 of file ossimGeneralRasterInfo.cpp.

References imageRect(), and theImageRect.

305 {
307 }
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
const ossimIrect & imageRect() const
Zero based rectangle of the valid image.

◆ setInterleaveType()

void ossimGeneralRasterInfo::setInterleaveType ( ossimInterleaveType  il_type)

Definition at line 299 of file ossimGeneralRasterInfo.cpp.

References theInterleaveType.

300 {
301  theInterleaveType = il_type;
302 }
ossimInterleaveType theInterleaveType

◆ setRawImageRect()

void ossimGeneralRasterInfo::setRawImageRect ( const ossimIrect imageRect)

Definition at line 314 of file ossimGeneralRasterInfo.cpp.

References imageRect(), and theRawImageRect.

315 {
317 }
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
const ossimIrect & imageRect() const
Zero based rectangle of the valid image.

◆ setSubImageOffset()

void ossimGeneralRasterInfo::setSubImageOffset ( const ossimIpt d)

Definition at line 319 of file ossimGeneralRasterInfo.cpp.

References theSubImageOffset.

320 {
321  theSubImageOffset = d;
322 }
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.

◆ setValidImageRect()

void ossimGeneralRasterInfo::setValidImageRect ( const ossimIrect imageRect)

Definition at line 309 of file ossimGeneralRasterInfo.cpp.

References imageRect(), and theValidImageRect.

310 {
312 }
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
const ossimIrect & imageRect() const
Zero based rectangle of the valid image.

◆ subImageOffset()

const ossimIpt & ossimGeneralRasterInfo::subImageOffset ( ) const

Returns the offset of this image's origin to a full-image's origin, in the case where this image is a sub-image of a larger full-image.

Definition at line 220 of file ossimGeneralRasterInfo.cpp.

References theSubImageOffset.

221 {
222  return theSubImageOffset;
223 }
ossimIpt theSubImageOffset
The offset from the full-image origin to this image&#39;s origin.

◆ validImageRect()

const ossimIrect & ossimGeneralRasterInfo::validImageRect ( ) const

Returns the rectangle of where the image is within the raster file.

In most cases this will be the same as the rawImageRect. (zero based)

Definition at line 210 of file ossimGeneralRasterInfo.cpp.

References theValidImageRect.

Referenced by offsetToFirstValidSample().

211 {
212  return theValidImageRect;
213 }
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".

◆ validLines()

ossim_int32 ossimGeneralRasterInfo::validLines ( ) const
inline

Returns the number of lines within "theValidImageRect".

Definition at line 365 of file ossimGeneralRasterInfo.h.

References ossimIrect::height(), and theValidImageRect.

366 {
367  return static_cast<ossim_int32>(theValidImageRect.height());
368 }
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_uint32 height() const
Definition: ossimIrect.h:487
int ossim_int32

◆ validSamples()

ossim_int32 ossimGeneralRasterInfo::validSamples ( ) const
inline

Returns the number of samples within "theValidImageRect".

Definition at line 399 of file ossimGeneralRasterInfo.h.

References theValidImageRect, and ossimIrect::width().

Referenced by bytesPerValidLine().

400 {
401  return static_cast<ossim_int32>(theValidImageRect.width());
402 }
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_uint32 width() const
Definition: ossimIrect.h:500
int ossim_int32

Member Data Documentation

◆ theHeaderSize

ossim_int32 ossimGeneralRasterInfo::theHeaderSize
private

◆ theImageDataByteOrder

ossimByteOrder ossimGeneralRasterInfo::theImageDataByteOrder
private

The byte order the image data is stored in.

Definition at line 333 of file ossimGeneralRasterInfo.h.

Referenced by clear(), getImageDataByteOrder(), initializeFromEnviHdr(), initializeFromHdr(), initializeFromXml(), operator=(), and setImageDataByteOrder().

◆ theImageFileList

std::vector<ossimFilename> ossimGeneralRasterInfo::theImageFileList
private

◆ theImageRect

ossimIrect ossimGeneralRasterInfo::theImageRect
private

The valid image rectangle normalized to be zero based.

Definition at line 304 of file ossimGeneralRasterInfo.h.

Referenced by clear(), imageRect(), initializeFromEnviHdr(), initializeFromHdr(), initializeFromXml(), operator=(), ossimGeneralRasterInfo(), and setImageRect().

◆ theInterleaveType

ossimInterleaveType ossimGeneralRasterInfo::theInterleaveType
private

◆ theMetaData

ossimImageMetaData ossimGeneralRasterInfo::theMetaData
private

◆ thePixelsToChop

ossim_int32 ossimGeneralRasterInfo::thePixelsToChop
private

Amount of pixels to chop for each line edge.

Definition at line 328 of file ossimGeneralRasterInfo.h.

Referenced by clear(), initializeFromEnviHdr(), initializeFromHdr(), initializeFromXml(), operator=(), and pixelsToChop().

◆ theRawImageRect

ossimIrect ossimGeneralRasterInfo::theRawImageRect
private

The zero based rectangle of the entire image not including any header.

Definition at line 293 of file ossimGeneralRasterInfo.h.

Referenced by clear(), getBitsPerPixel(), initializeFromEnviHdr(), initializeFromHdr(), initializeFromXml(), operator=(), ossimGeneralRasterInfo(), rawImageRect(), rawLines(), rawSamples(), and setRawImageRect().

◆ theSetNullsMode

ossimFillMode ossimGeneralRasterInfo::theSetNullsMode
private

Mode of how to handle pixels on import.

0 = Do nothing the pixels. 1 = Set any zeroes to min value of radiometry. 2 = Set zeroes on line edges only to nulls; any other zeroes are set to min value of radiometry.

Definition at line 323 of file ossimGeneralRasterInfo.h.

Referenced by clear(), fillToNullsMode(), initializeFromEnviHdr(), initializeFromHdr(), initializeFromXml(), operator=(), and setFillToNullsMode().

◆ theSubImageOffset

ossimIpt ossimGeneralRasterInfo::theSubImageOffset
private

The offset from the full-image origin to this image's origin.

Definition at line 309 of file ossimGeneralRasterInfo.h.

Referenced by clear(), initializeFromEnviHdr(), initializeFromHdr(), initializeFromXml(), operator=(), setSubImageOffset(), and subImageOffset().

◆ theValidImageRect

ossimIrect ossimGeneralRasterInfo::theValidImageRect
private

The rectangle representing where the valid part of the image lies within "theRawImageRect".

Definition at line 299 of file ossimGeneralRasterInfo.h.

Referenced by clear(), initializeFromEnviHdr(), initializeFromHdr(), initializeFromXml(), operator=(), ossimGeneralRasterInfo(), setValidImageRect(), validImageRect(), validLines(), and validSamples().


The documentation for this class was generated from the following files: