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

#include <ossimRpfTocEntry.h>

Public Member Functions

 ossimRpfTocEntry ()
 
ossimErrorCode parseStream (std::istream &in, ossimByteOrder byteOrder)
 
std::ostream & print (std::ostream &out, const std::string &prefix=std::string()) const
 print method that outputs a key/value type format adding prefix to keys. More...
 
void setEntry (const ossimRpfFrameEntry &entry, long row, long col)
 
bool getEntry (long row, long col, ossimRpfFrameEntry &result) const
 
ossimString getProductType () const
 
ossim_uint32 getNumberOfFramesHorizontal () const
 
ossim_uint32 getNumberOfFramesVertical () const
 
ossim_uint32 getNumberOfLines () const
 
ossim_uint32 getNumberOfSamples () const
 
ossim_uint32 getNumberOfBands () const
 
void getBoundingRect (ossimIrect &rect) const
 Get the bounding rect of entry. More...
 
const ossimRpfBoundaryRectRecordgetBoundaryInformation () const
 
bool isEmpty () const
 
ossimRefPtr< ossimImageGeometrygetImageGeometry () const
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
void getDecimalDegreesPerPixel (ossimDpt &scale) const
 Get the scale in decimal degrees per pixel. More...
 
void getMetersPerPixel (ossimDpt &scale) const
 Get the scale in meters per pixel. More...
 

Private Member Functions

void allocateFrameEntryArray ()
 

Private Attributes

ossimRpfBoundaryRectRecord theBoundaryInformation
 
ossim_uint32 theNumSamples
 
std::vector< std::vector< ossimRpfFrameEntry > > theFrameEntryArray
 

May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10)

More...
 

Friends

std::ostream & operator<< (std::ostream &out, const ossimRpfTocEntry &data)
 

Detailed Description

Definition at line 27 of file ossimRpfTocEntry.h.

Constructor & Destructor Documentation

◆ ossimRpfTocEntry()

ossimRpfTocEntry::ossimRpfTocEntry ( )

Definition at line 32 of file ossimRpfTocEntry.cpp.

33 {
34 
35 }

Member Function Documentation

◆ allocateFrameEntryArray()

void ossimRpfTocEntry::allocateFrameEntryArray ( )
private

Definition at line 270 of file ossimRpfTocEntry.cpp.

References ossimRpfBoundaryRectRecord::getNumberOfFramesHorizontal(), ossimRpfBoundaryRectRecord::getNumberOfFramesVertical(), theBoundaryInformation, and theFrameEntryArray.

Referenced by parseStream().

271 {
274 
275  for(ossim_uint32 index = 0; index < theFrameEntryArray.size(); index++)
276  {
277  theFrameEntryArray[index].resize(horizontalSize);
278  }
279 }
ossim_uint32 getNumberOfFramesVertical() const
std::vector< std::vector< ossimRpfFrameEntry > > theFrameEntryArray
May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10) ...
unsigned int ossim_uint32
ossimRpfBoundaryRectRecord theBoundaryInformation
ossim_uint32 getNumberOfFramesHorizontal() const

◆ getBoundaryInformation()

const ossimRpfBoundaryRectRecord & ossimRpfTocEntry::getBoundaryInformation ( ) const

◆ getBoundingRect()

void ossimRpfTocEntry::getBoundingRect ( ossimIrect rect) const

Get the bounding rect of entry.

Parameters
rectGets initialized with rect.

Definition at line 117 of file ossimRpfTocEntry.cpp.

References getNumberOfLines(), and getNumberOfSamples().

118 {
119  rect = ossimIrect(0, 0, getNumberOfSamples()-1, getNumberOfLines()-1);
120 }
ossim_uint32 getNumberOfSamples() const
ossim_uint32 getNumberOfLines() const

◆ getDecimalDegreesPerPixel()

void ossimRpfTocEntry::getDecimalDegreesPerPixel ( ossimDpt scale) const

Get the scale in decimal degrees per pixel.

Definition at line 247 of file ossimRpfTocEntry.cpp.

References ossimRpfBoundaryRectRecord::getCoverage(), ossimRpfCoverageSection::getHorizontalInterval(), ossimRpfCoverageSection::getLrLat(), getNumberOfLines(), getNumberOfSamples(), ossimRpfCoverageSection::getUlLat(), ossimRpfCoverageSection::getUlLon(), ossimRpfCoverageSection::getUrLon(), ossimRpfCoverageSection::getVerticalInterval(), theBoundaryInformation, ossimDpt::x, and ossimDpt::y.

Referenced by getImageGeometry(), and parseStream().

248 {
249 #if 1
252 #else
259  scale.x = (urLon - ulLon) / samps;
260  scale.y = (ulLat - llLat) / lines;
261 #endif
262 }
ossim_float64 getVerticalInterval() const
double y
Definition: ossimDpt.h:165
ossim_uint32 getNumberOfSamples() const
const ossimRpfCoverageSection & getCoverage() const
double ossim_float64
ossim_float64 getUlLat() const
ossim_float64 getUrLon() const
ossimRpfBoundaryRectRecord theBoundaryInformation
ossim_float64 getHorizontalInterval() const
ossim_uint32 getNumberOfLines() const
ossim_float64 getUlLon() const
double x
Definition: ossimDpt.h:164
ossim_float64 getLrLat() const

◆ getEntry()

bool ossimRpfTocEntry::getEntry ( long  row,
long  col,
ossimRpfFrameEntry result 
) const

Definition at line 140 of file ossimRpfTocEntry.cpp.

References theFrameEntryArray.

Referenced by ossimRpfToc::getFirstEntry(), ossimCibCadrgTileSource::getIntersectingEntries(), ossimRpfToc::getRpfFrameEntry(), ossimCibCadrgTileSource::populateLut(), and ossimCibCadrgTileSource::updatePropertiesToFirstValidFrame().

143 {
144  if(row < (long)theFrameEntryArray.size() && row >= 0)
145  {
146  if(col < (long)theFrameEntryArray[row].size() && col >= 0)
147  {
148  result = theFrameEntryArray[row][col];
149  }
150  else
151  {
152  return false;
153  }
154  }
155  else
156  {
157  return false;
158  }
159 
160  return true;
161 }
std::vector< std::vector< ossimRpfFrameEntry > > theFrameEntryArray
May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10) ...

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimRpfTocEntry::getImageGeometry ( ) const

Returns the image geometry object associated with this tile source or NULL if non defined.

The geometry contains full-to-local image transform as well as projection (image-to-world).

Definition at line 194 of file ossimRpfTocEntry.cpp.

References ossimRefPtr< T >::get(), ossimRpfBoundaryRectRecord::getCoverage(), getDecimalDegreesPerPixel(), ossimRpfCoverageSection::getLlLat(), ossimRpfCoverageSection::getUlLat(), ossimRpfCoverageSection::getUlLon(), ossimRpfBoundaryRectRecord::getZone(), ossimGpt::lon, ossimMapProjection::setDecimalDegreesPerPixel(), ossimMapProjection::setOrigin(), ossimImageGeometry::setProjection(), ossimMapProjection::setUlTiePoints(), and theBoundaryInformation.

Referenced by ossimCibCadrgTileSource::getImageGeometry().

195 {
196 
199 
200  // Decimal degrees per pixel:
201  ossimDpt ddpp;
203 
204  // Tie point - Shifted to pixel-is-point:
205  ossimGpt tie( (ul.latd() - (ddpp.y/2.0)), (ul.lond() + (ddpp.x/2.0)), 0.0 );
206 
207  // Origin - Use the center latitude for horizontal scale, and the left edge as origin longitude
208  // (OLK 10/10)
209  ossimGpt origin ((ul.lat + theBoundaryInformation.getCoverage().getLlLat())/2.0, tie.lon);
210 
211 #if 0 /* Please leave for debug. (drb) */
212  std::cout << "boundaryInfo:\n" << boundaryInfo << std::endl;
213 #endif
214 
216 
217  if (z == 74) z--; // Fix J to a zone.
218  if (z > 64) z -= 64; // Below the equator
219  else z -= 48; // Above the equator
220 
222  if ( z != 9 )
223  {
224  mapProj = new ossimEquDistCylProjection;
225  }
226  else
227  {
228  mapProj = new ossimAzimEquDistProjection;
229  }
230 
231  // Set the origin:
232  mapProj->setOrigin(origin);
233 
234  // Set the scale:
235  mapProj->setDecimalDegreesPerPixel(ddpp);
236 
237  // Set the tie:
238  mapProj->setUlTiePoints(tie);
239 
240  // Give projection to the geometry object.
242  geom->setProjection( mapProj.get() );
243 
244  return geom;
245 }
ossim_float64 getLlLat() const
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
virtual void setOrigin(const ossimGpt &origin)
Sets theOrigin to origin.
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
const ossimRpfCoverageSection & getCoverage() const
ossim_float64 getUlLat() const
ossimRpfBoundaryRectRecord theBoundaryInformation
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
ossim_float64 getUlLon() const
virtual void setUlTiePoints(const ossimGpt &gpt)
void getDecimalDegreesPerPixel(ossimDpt &scale) const
Get the scale in decimal degrees per pixel.

◆ getMetersPerPixel()

void ossimRpfTocEntry::getMetersPerPixel ( ossimDpt scale) const

Get the scale in meters per pixel.

Definition at line 264 of file ossimRpfTocEntry.cpp.

References ossimRpfBoundaryRectRecord::getCoverage(), ossimRpfCoverageSection::getHorizontalResolution(), ossimRpfCoverageSection::getVerticalResolution(), theBoundaryInformation, ossimDpt::x, and ossimDpt::y.

265 {
268 }
double y
Definition: ossimDpt.h:165
ossim_float64 getVerticalResolution() const
const ossimRpfCoverageSection & getCoverage() const
ossimRpfBoundaryRectRecord theBoundaryInformation
double x
Definition: ossimDpt.h:164
ossim_float64 getHorizontalResolution() const

◆ getNumberOfBands()

ossim_uint32 ossimRpfTocEntry::getNumberOfBands ( ) const
Returns
Number of bands.

Definition at line 102 of file ossimRpfTocEntry.cpp.

References getProductType(), ossimString::trim(), and ossimString::upcase().

103 {
104  ossim_uint32 result = 0;
105  ossimString productType = getProductType().trim().upcase();
106  if( productType == "CIB" )
107  {
108  result = 1;
109  }
110  else if ( productType == "CADRG" )
111  {
112  result = 3;
113  }
114  return result;
115 }
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
ossimString getProductType() const
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.

◆ getNumberOfFramesHorizontal()

ossim_uint32 ossimRpfTocEntry::getNumberOfFramesHorizontal ( ) const

◆ getNumberOfFramesVertical()

ossim_uint32 ossimRpfTocEntry::getNumberOfFramesVertical ( ) const

◆ getNumberOfLines()

ossim_uint32 ossimRpfTocEntry::getNumberOfLines ( ) const
Returns
The number of lines (frames vertical * 1536).

Definition at line 92 of file ossimRpfTocEntry.cpp.

References ossimRpfBoundaryRectRecord::getNumberOfFramesVertical(), and theBoundaryInformation.

Referenced by getBoundingRect(), getDecimalDegreesPerPixel(), and ossimCibCadrgTileSource::setTocEntryToRender().

93 {
95 }
ossim_uint32 getNumberOfFramesVertical() const
ossimRpfBoundaryRectRecord theBoundaryInformation

◆ getNumberOfSamples()

ossim_uint32 ossimRpfTocEntry::getNumberOfSamples ( ) const
Returns
The number of samples (frames horizontal * 1536).

Definition at line 97 of file ossimRpfTocEntry.cpp.

References theNumSamples.

Referenced by getBoundingRect(), getDecimalDegreesPerPixel(), and ossimCibCadrgTileSource::setTocEntryToRender().

98 {
99  return theNumSamples;
100 }
ossim_uint32 theNumSamples

◆ getProductType()

ossimString ossimRpfTocEntry::getProductType ( ) const

◆ isEmpty()

bool ossimRpfTocEntry::isEmpty ( ) const

If there is an entry and all the files don't exist we will return true.

Definition at line 172 of file ossimRpfTocEntry.cpp.

References size, and theFrameEntryArray.

Referenced by ossimCibCadrgTileSource::getProductEntryList().

173 {
174  long rows = (long)theFrameEntryArray.size();
175  long cols = 0;
176  if(rows > 0)
177  {
178  cols = (long)theFrameEntryArray[0].size();
179  for(long rowIndex = 0; rowIndex < rows; ++ rowIndex)
180  {
181  for(long colIndex = 0; colIndex < cols; ++colIndex)
182  {
183  if(theFrameEntryArray[rowIndex][colIndex].exists())
184  {
185  return false;
186  }
187  }
188  }
189  }
190 
191  return true;
192 }
yy_size_t size
std::vector< std::vector< ossimRpfFrameEntry > > theFrameEntryArray
May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10) ...

◆ parseStream()

ossimErrorCode ossimRpfTocEntry::parseStream ( std::istream &  in,
ossimByteOrder  byteOrder 
)

Definition at line 37 of file ossimRpfTocEntry.cpp.

References allocateFrameEntryArray(), ossim::byteOrder(), getDecimalDegreesPerPixel(), ossimRpfBoundaryRectRecord::getNumberOfFramesHorizontal(), ossimErrorCodes::OSSIM_OK, ossimRpfBoundaryRectRecord::parseStream(), theBoundaryInformation, theNumSamples, and ossimDpt::x.

39 {
41 
43  if(result == ossimErrorCodes::OSSIM_OK)
44  {
46  }
47 
48  // Fetch the number of samples as data member since it may need to be adjusted due to
49  // wrap (OLK 10/10):
51  ossimDpt ddpp;
53  ossim_float64 width_in_deg = theNumSamples*ddpp.x;
54  if (width_in_deg >= 360.0)
55  theNumSamples -= (width_in_deg - 360.0)/ddpp.x;
56 
57  return result;
58 }
ossim_int32 ossimErrorCode
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
static const ossimErrorCode OSSIM_OK
ossim_uint32 theNumSamples
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
double ossim_float64
ossimRpfBoundaryRectRecord theBoundaryInformation
ossim_uint32 getNumberOfFramesHorizontal() const
double x
Definition: ossimDpt.h:164
void getDecimalDegreesPerPixel(ossimDpt &scale) const
Get the scale in decimal degrees per pixel.

◆ print()

std::ostream & ossimRpfTocEntry::print ( std::ostream &  out,
const std::string &  prefix = std::string() 
) const

print method that outputs a key/value type format adding prefix to keys.

Parameters
outString to output to.
prefixThis will be prepended to key. e.g. Where prefix = "nitf." and key is "file_name" key becomes: "nitf.file_name:"
Returns
output stream.

Definition at line 60 of file ossimRpfTocEntry.cpp.

References ossimRpfBoundaryRectRecord::print(), theBoundaryInformation, and theFrameEntryArray.

Referenced by operator<<().

62 {
63  theBoundaryInformation.print(out, prefix);
64 
65  std::vector< std::vector<ossimRpfFrameEntry> >::const_iterator frameEntry =
66  theFrameEntryArray.begin();
67 
68  while( frameEntry != theFrameEntryArray.end() )
69  {
70  std::vector<ossimRpfFrameEntry>::const_iterator i =
71  (*frameEntry).begin();
72  while ( i != (*frameEntry).end() )
73  {
74  (*i).print(out, prefix);
75  ++i;
76  }
77  ++frameEntry;
78  }
79  return out;
80 }
std::vector< std::vector< ossimRpfFrameEntry > > theFrameEntryArray
May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10) ...
ossimRpfBoundaryRectRecord theBoundaryInformation
std::ostream & print(std::ostream &out, ossimString prefix) const
prints to out.

◆ setEntry()

void ossimRpfTocEntry::setEntry ( const ossimRpfFrameEntry entry,
long  row,
long  col 
)

Definition at line 127 of file ossimRpfTocEntry.cpp.

References theFrameEntryArray.

130 {
131  if(row < (long)theFrameEntryArray.size() && row >= 0)
132  {
133  if(col < (long)theFrameEntryArray[row].size() && col >= 0)
134  {
135  theFrameEntryArray[row][col] = entry;
136  }
137  }
138 }
std::vector< std::vector< ossimRpfFrameEntry > > theFrameEntryArray
May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10) ...

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const ossimRpfTocEntry data 
)
friend

Definition at line 25 of file ossimRpfTocEntry.cpp.

27 {
28  data.print(out);
29  return out;
30 }
std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
print method that outputs a key/value type format adding prefix to keys.

Member Data Documentation

◆ theBoundaryInformation

ossimRpfBoundaryRectRecord ossimRpfTocEntry::theBoundaryInformation
private

◆ theFrameEntryArray

std::vector< std::vector<ossimRpfFrameEntry> > ossimRpfTocEntry::theFrameEntryArray
private

May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10)

Definition at line 110 of file ossimRpfTocEntry.h.

Referenced by allocateFrameEntryArray(), getEntry(), isEmpty(), print(), and setEntry().

◆ theNumSamples

ossim_uint32 ossimRpfTocEntry::theNumSamples
private

Definition at line 109 of file ossimRpfTocEntry.h.

Referenced by getNumberOfSamples(), and parseStream().


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