OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimImageViewProjectionTransform.cpp
Go to the documentation of this file.
1 //*****************************************************************************
2 // FILE: ossimImageViewProjectionTransform.cc
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // AUTHOR: Garrett Potts
9 // Oscar Kramer (oscar@krameranalytic.com)
10 //
11 // DESCRIPTION: Contains declaration of ossimImageViewProjectionTransform.
12 // This class provides an image to view transform that utilizes two
13 // independent 2D-to-3D projections. Intended for transforming view to
14 // geographic "world" space to input image space.
15 //
16 // LIMITATIONS: None.
17 //
18 //*****************************************************************************
19 // $Id: ossimImageViewProjectionTransform.cpp 20489 2012-01-23 20:07:56Z dburken $
20 //
22 #include <ossim/base/ossimDrect.h>
24 #include <ossim/base/ossimIpt.h>
28 #include <cmath>
29 
31  "ossimImageViewProjectionTransform",
33 
34 //*****************************************************************************
35 // CONSTRUCTOR: ossimImageViewProjectionTransform
36 //*****************************************************************************
38 ( ossimImageGeometry* imageGeometry, ossimImageGeometry* viewGeometry)
39 : m_imageGeometry(imageGeometry),
40  m_viewGeometry(viewGeometry),
41  m_crossesDateline(false)
42 {
43 }
44 
45 //*****************************************************************************
46 // CONSTRUCTOR: ossimImageViewProjectionTransform
47 //*****************************************************************************
51  m_imageGeometry(src.m_imageGeometry),
52  m_viewGeometry(src.m_viewGeometry),
53  m_crossesDateline(false)
54 {
55 }
56 
57 //*****************************************************************************
58 // DESTRUCTOR: ~ossimImageViewProjectionTransform
59 //*****************************************************************************
61 {
62 }
65 {
66  m_viewGeometry = g;
67 
69 }
70 
73 {
74  m_imageGeometry = g;
76 }
77 
78 //*****************************************************************************
79 // Workhorse of the object. Converts image-space to view-space.
80 //*****************************************************************************
82 {
83  // Check for same geometries on input and output (this includes NULL geoms):
85  {
86  vp = ip;
87  return;
88  }
89 
90  // Otherwise we need access to good geoms. Check for a bad geometry object:
92  {
93  vp.makeNan();
94  return;
95  }
96 
97  // Check for same projection on input and output sides to save projection to ground:
99  {
100  // Check for possible same 2D transforms as well:
103  {
104  vp = ip;
105  return;
106  }
107 
108  // Not the same 2D transform, so just perform local-image -> full-image -> local-view:
109  ossimDpt fp;
110  m_imageGeometry->rnToFull(ip, 0, fp);
111  m_viewGeometry->fullToRn(fp, 0, vp);
112  return;
113  }
114 
115  //---
116  // Completely different left and right side geoms (typical situation).
117  // Need to project to ground.
118  //---
119  ossimGpt gp;
120  m_imageGeometry->localToWorld(ip, gp);
121  m_viewGeometry->worldToLocal(gp, vp);
122 
123 #if 0 /* Please leave for debug. */
124  cout <<"DEBUG ossimImageViewProjectionTransform::imageToView:"
125  <<"\n ip: "<<ip
126  <<"\n gp: "<<gp
127  <<"\n vp: "<<vp<<std::endl;
128 #endif
129 }
130 
131 //*****************************************************************************
132 // Other workhorse of the object. Converts view-space to image-space.
133 //*****************************************************************************
135 {
136  // Check for same geometries on input and output (this includes NULL geoms):
138  {
139  ip = vp;
140  return;
141  }
142 
143  // Otherwise we need access to good geoms. Check for a bad geometry object:
145  {
146  ip.makeNan();
147  return;
148  }
149 
150  // Check for same projection on input and output sides to save projection to ground:
152  const ossimProjection* vproj = m_viewGeometry->getProjection();
153  if ((iproj && vproj && iproj->isEqualTo(*vproj)) || (iproj == vproj))
154  {
155  // Check for possible same 2D transforms as well:
158  if (((ixform && vxform && ixform->isEqualTo(*vxform)) || (ixform == vxform)) &&
160  {
161  ip = vp;
162  return;
163  }
164 
165  // Not the same 2D transform, so just perform local-image -> full-image -> local-view:
166  ossimDpt fp;
167  m_viewGeometry->rnToFull(vp, 0, fp);
168  m_imageGeometry->fullToRn(fp, 0, ip);
169  return;
170  }
171 
172  //---
173  // Completely different left and right side geoms (typical situation).
174  // Need to project to ground.
175  //---
176  ossimGpt gp;
177  m_viewGeometry->localToWorld(vp, gp);
178  m_imageGeometry->worldToLocal(gp, ip);
179 
180 #if 0 /* Please leave for debug. */
181  cout <<"DEBUG ossimImageViewProjectionTransform::viewToImage:"
182  <<"\n vp: "<<vp
183  <<"\n gp: "<<gp
184  <<"\n ip: "<<ip
185  <<std::endl;
186 #endif
187 }
188 
189 void ossimImageViewProjectionTransform::getViewSegments(std::vector<ossimDrect>& viewBounds,
190  ossimPolyArea2d& polyArea,
191  ossim_uint32 numberOfEdgePoints)const
192 {
193  ossimDrect imageRect;
194  ossimDrect worldRect(ossimDpt(-180,-90),
195  ossimDpt(-180,90),
196  ossimDpt(180,90),
197  ossimDpt(180,-90));
198  viewBounds.clear();
199  polyArea.clear();
200 
201  if(m_imageGeometry.valid())
202  {
203  m_imageGeometry->getBoundingRect(imageRect);
204  ossim_uint32 idx=0;
205  std::vector<ossimDpt> points;
206  std::vector<ossimGpt> gPoints;
207  bool affectedByElevation = m_imageGeometry->isAffectedByElevation();
208 
209 
210  if((numberOfEdgePoints > 2)&&(affectedByElevation))
211  {
212  m_imageGeometry->getImageEdgePoints(points, numberOfEdgePoints);
213  }
214  else
215  {
216  points.resize(4);
217 
218  points[0] = imageRect.ul();
219  points[1] = imageRect.ur();
220  points[2] = imageRect.lr();
221  points[3] = imageRect.ll();
222  }
224  {
225  ossimDpt testPt;
226  ossimGpt cg;
227  m_imageGeometry->localToWorld(imageRect.midPoint(), cg);
228  ossim_int32 sgn = static_cast<ossim_int32>(ossim::sgn(cg.lond()));
229  std::vector<ossimPolygon> polyList;
230  for(idx=0; idx < points.size();++idx)
231  {
232  ossimGpt testGpt;
233  m_imageGeometry->localToWorld(points[idx], testGpt);
234 
235  if(!testGpt.isLatNan()&&!testGpt.isLonNan())
236  {
237  gPoints.push_back(testGpt);
238  }
239  }
240 
241  // first we get the list of ground points initialized
242  // and shifted to one side of the full world rect
243  // We will do the other side next
244  //
245  for(idx=0; idx < gPoints.size();++idx)
246  {
247  if(std::fabs(gPoints[idx].lond()-cg.lond()) > 180)
248  {
249  gPoints[idx].lond(gPoints[idx].lond()+sgn*360);
250  }
251  }
252 
253  // now clip the ground list to the full ground rect
254  //
255  ossimPolygon tempPoly(gPoints);
256  tempPoly.clipToRect(polyList, worldRect);
257 
258  ossim_uint32 pointListIdx=0;
259 
260  // Loop through the clipped polygons and find their
261  // view projection. We will add this to the view
262  // bounds and we will add to the poly Area. Poly Area
263  // is used for a tighter clip.
264  //
265  for(pointListIdx=0;pointListIdx<polyList.size();++pointListIdx)
266  {
267  const std::vector<ossimDpt>& clipPoints = polyList[pointListIdx].getVertexList();
268  points.clear();
269  for(idx = 0; idx<clipPoints.size(); ++idx)
270  {
271  m_viewGeometry->worldToLocal(ossimGpt(clipPoints[idx]), testPt);
272  if(!testPt.hasNans())
273  {
274  points.push_back(testPt);
275  }
276  }
277  viewBounds.push_back(ossimDrect(points));
278 
279  if (points.size() >= 4)
280  {
281  points.push_back(points[0]);
282  polyArea.add(ossimPolyArea2d(points));//ossimPolygon(points)));
283  }
284  }
285 
286  // now shift the ground points to the other side of the world rect
287  //
288  for(idx=0; idx < gPoints.size();++idx)
289  {
290  gPoints[idx].lond(gPoints[idx].lond()+(-sgn*360));
291  }
292 
293  // Now we will do the same thing to the other side of the world
294  // and find the view projection and add those to the poly area
295  // and the view rect
296  //
297  tempPoly = gPoints;
298  polyList.clear();
299  tempPoly.clipToRect(polyList, worldRect);
300 
301  for(pointListIdx=0;pointListIdx<polyList.size();++pointListIdx)
302  {
303  const std::vector<ossimDpt>& clipPoints = polyList[pointListIdx].getVertexList();
304  points.clear();
305  for(idx = 0; idx<clipPoints.size(); ++idx)
306  {
307  m_viewGeometry->worldToLocal(ossimGpt(clipPoints[idx]), testPt);
308  if(!testPt.hasNans())
309  {
310  points.push_back(testPt);
311  }
312  }
313  viewBounds.push_back(ossimDrect(points));
314  if (points.size() >= 4)
315  {
316  points.push_back(points[0]);
317  polyArea.add(ossimPolyArea2d(points));//ossimPolygon(points)));
318  }
319 
320  }
321  }// end: if(m_crossesDateline)
322  else
323  {
324  ossimDpt testPoint;
325  std::vector<ossimDpt> vpoints;
326 
327  for(idx=0; idx < points.size();++idx)
328  {
329  ossimDpt testDpt;
330  imageToView(points[idx], testDpt);
331  if(!testDpt.hasNans())
332  {
333  vpoints.push_back(testDpt);
334  }
335  }
336 
337  if(vpoints.size())
338  {
339  vpoints.push_back(vpoints[0]);
340  viewBounds.push_back(ossimDrect(vpoints));
341  polyArea = vpoints;// = ossimPolyArea2d(points);
342 
343  }
344  }
345  }
346 }
347 
348 
350 {
351  ossimImageGeometry* g = dynamic_cast<ossimImageGeometry*>(baseObject);
352  bool new_view_set = false;
353  m_crossesDateline = false;
354  if (g)
355  {
356  m_viewGeometry = g;
357  new_view_set = true;
358  }
359  else
360  {
361  ossimProjection* proj = dynamic_cast<ossimProjection*>(baseObject);
362  if(proj)
363  {
364  if(m_viewGeometry.valid())
365  {
367  }
368  else
369  {
370  m_viewGeometry = new ossimImageGeometry(0, proj);
371  }
372 
373  new_view_set = true;
374  }
375  }
376 
377  if ( m_viewGeometry.valid() && m_viewGeometry-> getImageSize().hasNans() )
378  {
379  // Sets the view image size from the image geometry if present.
381  }
382 
383  return new_view_set;
384 }
385 
386 //*****************************************************************************
387 // Dumps contents to stream
388 //*****************************************************************************
390 {
391  out << "ossimImageViewProjectionTransform::print: ..... entered " <<endl;
392 
393  if(m_imageGeometry.valid())
394  {
395  out << " Input Image (LEFT) Geometry: " << endl;
396  m_imageGeometry->print(out);
397  }
398  else
399  {
400  out << " None defined." << endl;
401  }
402  if(m_viewGeometry.valid())
403  {
404  out << "Output View (RIGHT) Geometry: " << endl;
405  m_viewGeometry->print(out);
406  }
407  else
408  {
409  out << " None defined." << endl;
410  }
411  return out;
412 }
413 
414 //**************************************************************************************************
415 // Converts the local image space rect into bounding view-space rect
416 //**************************************************************************************************
418 {
419  // Let base class try:
421 
422  // If not successful, compute using input and output geometries:
423  if (result.hasNans() && m_imageGeometry.valid() && m_viewGeometry.valid() &&
425  {
426  ossimGeoPolygon viewClip;
428  if(viewClip.size())
429  {
430  std::vector<ossimGpt> imageGpts(4);
431  m_imageGeometry->localToWorld(imageRect.ul(), imageGpts[0]);
432  m_imageGeometry->localToWorld(imageRect.ur(), imageGpts[1]);
433  m_imageGeometry->localToWorld(imageRect.lr(), imageGpts[2]);
434  m_imageGeometry->localToWorld(imageRect.ll(), imageGpts[3]);
435 
436  const ossimDatum* viewDatum = m_viewGeometry->getProjection()->origin().datum();
437  imageGpts[0].changeDatum(viewDatum);
438  imageGpts[1].changeDatum(viewDatum);
439  imageGpts[2].changeDatum(viewDatum);
440  imageGpts[3].changeDatum(viewDatum);
441 
442  ossimPolyArea2d viewPolyArea(viewClip.getVertexList());
443  ossimPolyArea2d imagePolyArea(imageGpts);
444  viewPolyArea &= imagePolyArea;
445  std::vector<ossimPolygon> visiblePolygons;
446  viewPolyArea.getVisiblePolygons(visiblePolygons);
447  if(visiblePolygons.size())
448  {
449  std::vector<ossimDpt> vpts;
450  ossim_uint32 idx = 0;
451  for(idx=0; idx<visiblePolygons[0].getNumberOfVertices();++idx)
452  {
453  ossimDpt tempPt;
454  ossimGpt gpt(visiblePolygons[0][idx].lat, visiblePolygons[0][idx].lon, 0.0, viewDatum);
455  m_viewGeometry->worldToLocal(gpt, tempPt);
456  vpts.push_back(tempPt);
457  }
458  result = ossimDrect(vpts);
459  }
460  }
461  }
462  return result;
463 }
464 
465 //*****************************************************************************
466 // METHOD: ossimImageViewProjectionTransform::loadState
467 //*****************************************************************************
469  const char* prefix)
470 {
471  bool result = ossimImageViewTransform::loadState(kwl, prefix);
472  if(result)
473  {
474  ossimString imagePrefix = ossimString(prefix)+"image_geometry.";
475  ossimString viewPrefix = ossimString(prefix)+"view_geometry.";
476  if(kwl.numberOf(imagePrefix.c_str())>0)
477  {
479  m_imageGeometry->loadState(kwl, imagePrefix.c_str());
480  }
481  if(kwl.numberOf(viewPrefix.c_str())>0)
482  {
484  m_viewGeometry->loadState(kwl, viewPrefix.c_str());
485  }
486 
487  }
488 
489  return result;
490 }
491 
492 //**************************************************************************************************
493 //
494 //**************************************************************************************************
496  const char* prefix)const
497 {
498  ossimString imagePrefix = ossimString(prefix)+"image_geometry.";
499  ossimString viewPrefix = ossimString(prefix)+"view_geometry.";
500 
501  if(m_imageGeometry.valid())
502  {
503  m_imageGeometry->saveState(kwl, imagePrefix.c_str());
504  }
505  if(m_viewGeometry.valid())
506  {
507  m_viewGeometry->saveState(kwl, viewPrefix.c_str());
508  }
509  return ossimImageViewTransform::saveState(kwl, prefix);
510 }
511 
512 //**************************************************************************************************
513 // Returns the GSD of input image.
514 //**************************************************************************************************
516 {
517  ossimDpt result;
518 
521  else
522  result.makeNan();
523 
524  return result;
525 }
526 
527 //**************************************************************************************************
528 // Returns the GSD of the output view.
529 //**************************************************************************************************
531 {
532  ossimDpt result;
533 
536  else
537  result.makeNan();
538 
539  return result;
540 }
541 
542 // Initialize view geometry image size from image geometry.
544 {
545  bool result = false;
546  m_crossesDateline = false;
547  if ( m_imageGeometry.valid() )
548  {
550  ossimDrect imageRect( 0, 0,
553  ossimDpt size;
554  ossimDrect rect;
556  {
557  ossimGpt ulg;
558  ossimGpt urg;
559  ossimGpt lrg;
560  ossimGpt llg;
561  ossimGpt cg;
562  ossimDpt ul;
563  ossimDpt ur;
564  ossimDpt lr;
565  ossimDpt ll;
566  m_imageGeometry->localToWorld(imageRect.ul(), ulg);
567  m_imageGeometry->localToWorld(imageRect.ur(), urg);
568  m_imageGeometry->localToWorld(imageRect.lr(), lrg);
569  m_imageGeometry->localToWorld(imageRect.ll(), llg);
570  m_imageGeometry->localToWorld(imageRect.midPoint(), cg);
571 
572  if(std::fabs(ulg.lond()-cg.lond()) > 180)
573  {
574  ulg.lond(ulg.lond()+ossim::sgn(cg.lond())*360);
575  }
576  if(std::fabs(urg.lond()-cg.lond()) > 180)
577  {
578  urg.lond((urg.lond()+ossim::sgn(cg.lond())*360));
579  }
580  if(std::fabs(lrg.lond()-cg.lond()) > 180)
581  {
582  lrg.lond(lrg.lond()+ossim::sgn(cg.lond())*360);
583  }
584  if(std::fabs(llg.lond()-cg.lond()) > 180)
585  {
586  llg.lond(llg.lond()+ossim::sgn(cg.lond())*360);
587  }
588 
589  m_viewGeometry->worldToLocal(ulg, ul);
590  m_viewGeometry->worldToLocal(urg, ur);
591  m_viewGeometry->worldToLocal(lrg, lr);
592  m_viewGeometry->worldToLocal(llg, ll);
593 
594  rect= ossimDrect(ul,ur,lr,ll);
595  }
596  else
597  {
598  rect = getImageToViewBounds( imageRect );
599  }
600  size.x = ossim::round<ossim_int32>( rect.width() );
601  size.y = ossim::round<ossim_int32>( rect.height() );
602  if ( size.hasNans() == false )
603  {
605  result = true;
606  }
607 // std::cout << "VIEW SIZE ============== " << size << "\n";
608 #if 0
609 
610  if ( (imageRect.hasNans() == false) && m_viewGeometry.valid() )
611  {
613  if ( viewProj.valid() )
614  {
615  ossimIpt size;
616  size.makeNan();
617 
618  const ossimEquDistCylProjection* eqProj =
619  dynamic_cast<const ossimEquDistCylProjection*>( viewProj.get() );
620  if ( eqProj )
621  {
622  // Specialized to take into consideration a date line crossing.
623 
624  // Get the ground points we need:
625  ossimDpt iRight(imageRect.ul().x+1, imageRect.ul().y);
626  ossimDpt iDown(imageRect.ul().x, imageRect.ul().y+1);
627  ossimGpt gul;
628  ossimGpt gur;
629  ossimGpt glr;
630  ossimGpt gll;
631  ossimGpt gRight;
632  ossimGpt gDown;
633  ossim_float64 hdd; // height decimal degrees
634  ossim_float64 wdd; // width decimal degrees
635  ossim_float64 leftLon;
636  ossim_float64 rightLon;
637 
638  m_imageGeometry->localToWorld( imageRect.ul(), gul );
639  m_imageGeometry->localToWorld( imageRect.ur(), gur );
640  m_imageGeometry->localToWorld( imageRect.lr(), glr );
641  m_imageGeometry->localToWorld( imageRect.ll(), gll );
642  m_imageGeometry->localToWorld( iRight, gRight );
643  m_imageGeometry->localToWorld( iDown, gDown );
644 
645  //---
646  // Determine the direction of the image and get the geographic bounding box.
647  // For the longitude consider a date line crossing.
648  //---
649  if ( gul.lat > gDown.lat ) // oriented north up
650  {
651  if ( gul.lat >= gRight.lat ) // straight up or leaning right
652  {
653  hdd = gul.lat - glr.lat;
654  leftLon = gll.lon;
655  rightLon = gur.lon;
656  }
657  else // leaning left
658  {
659  hdd = gur.lat - gll.lat;
660  leftLon = gul.lon;
661  rightLon = glr.lon;
662  }
663  }
664  else // south or on side
665  {
666  if ( gRight.lat >= gul.lat ) // straight down or leaning right
667  {
668  hdd = glr.lat - gul.lat;
669  leftLon = gur.lon;
670  rightLon = gll.lon;
671  }
672  else // leaning left
673  {
674  hdd = gll.lat - gur.lat;
675  leftLon = glr.lon;
676  rightLon = gul.lon;
677  }
678  }
679 
680  if ( rightLon > leftLon )
681  {
682  wdd = rightLon - leftLon;
683  }
684  else // Date line cross:
685  {
686  wdd = rightLon + 360.0 - leftLon;
687  }
688 
689  //---
690  // Add one pixel width/height to the point to point size to make it edge to edge
691  // before dividing by gsd to get the size. The view projection gsd is used here
692  // since the view could be a different resolution than the input projection.
693  //---
694  size.x = ossim::round<ossim_int32>(
695  ( wdd + eqProj->getDecimalDegreesPerPixel().x ) /
696  eqProj->getDecimalDegreesPerPixel().x );
697  size.y = ossim::round<ossim_int32>(
698  ( hdd + eqProj->getDecimalDegreesPerPixel().y ) /
699  eqProj->getDecimalDegreesPerPixel().y );
700 
701 #if 0 /* Please leave for debug: */
702  cout << "\nwdd: " << wdd
703  << "\nhdd: " << hdd
704  << "\ngul: " << gul
705  << "\ngur: " << gur
706  << "\nglr: " << glr
707  << "\ngll: " << gll
708  << endl;
709 #endif
710  }
711  else // Not an ossimEquDistCylProjection:
712  {
713  ossimDrect rect = getImageToViewBounds( imageRect );
714  size.x = ossim::round<ossim_int32>( rect.width() );
715  size.y = ossim::round<ossim_int32>( rect.height() );
716  }
717 
718 #if 0 /* Please leave for debug: */
719  cout << "m_imageGeometry:\n" << *(m_imageGeometry.get())
720  << "\n\nm_viewGeometry:\n" << *(m_viewGeometry.get())
721  << "\n\ncomputed view size: " << size << endl;
722 #endif
723 
724  if ( size.hasNans() == false )
725  {
727  result = true;
728  }
729 
730  } // Matches: if ( viewProj.valid() )
731 
732  } // Matches: if ( (imageRect.hasNans() == false) ...
733 #endif
734 
735  } // Matches: if ( m_imageGeometry.valid() && ...
736 
737  return result;
738 
739 } // End: bool ossimImageViewProjectionTransform::initializeViewSize()
740 
742 {
743  m_crossesDateline = false;
744  if(m_imageGeometry.valid())
745  {
747  }
748 }
virtual std::ostream & print(std::ostream &out) const
Dumps contents to stream.
virtual const ossimDpt & getDecimalDegreesPerPixel() const
Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing...
virtual ossimDrect getImageToViewBounds(const ossimDrect &imageRect) const
Gets the image bounding rect in view-space coordinates.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
virtual bool isEqualTo(const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
ossim_uint32 numberOf(const char *str) const
virtual void imageToView(const ossimDpt &imagePoint, ossimDpt &viewPoint) const
Workhorse of the object. Converts image-space to view-space.
bool isAffectedByElevation() const
Returns TRUE if this geometry is sensitive to elevation.
T sgn(T x)
Definition: ossimCommon.h:339
ossim_float64 width() const
Definition: ossimDrect.h:522
const ossimIpt & getImageSize() const
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
Represents serializable keyword/value map.
bool isLonNan() const
Definition: ossimGpt.h:140
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Attempts to initialize a transform and a projection given the KWL.
std::ostream & print(std::ostream &out) const
Prints contents to output stream.
void getBoundingRect(ossimIrect &bounding_rect) const
Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
virtual void viewToImage(const ossimDpt &viewPoint, ossimDpt &imagePoint) const
Other workhorse of the object. Converts view-space to image-space.
RTTI_DEF1(ossimImageViewProjectionTransform, "ossimImageViewProjectionTransform", ossimImageViewTransform)
void setImageSize(const ossimIpt &size)
void setViewGeometry(ossimImageGeometry *g)
Assigns the geometry to use for output view. This object does NOT own the geometry.
bool isLatNan() const
Definition: ossimGpt.h:139
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
virtual bool isEqualTo(const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
double ossim_float64
virtual ossimDpt getOutputMetersPerPixel() const
Returns the GSD of the output view.
void rnToFull(const ossimDpt &rnPt, ossim_uint32 resolutionLevel, ossimDpt &fullPt) const
rnToFull is a utility method that takes a rn resolution image point and maps it to the full image poi...
virtual void getGroundClipPoints(ossimGeoPolygon &gpts) const
virtual ossimDrect getImageToViewBounds(const ossimDrect &imageRect) const
Computes the bounding rect in view space of the quad formed by the transformed image points of the in...
yy_size_t size
ossim_float64 lon
Definition: ossimGpt.h:266
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
virtual ossimDpt getMetersPerPixel() const =0
unsigned int ossim_uint32
virtual bool setView(ossimObject *baseObject)
This is used a a general access point for setting a view to a chain.
const std::vector< ossimGpt > & getVertexList() const
ossimRefPtr< ossimImageGeometry > m_imageGeometry
ossimRefPtr< ossimImageGeometry > m_viewGeometry
bool hasNans() const
Definition: ossimDrect.h:396
bool hasNans() const
Definition: ossimDpt.h:67
void add(const ossimPolyArea2d &rhs)
ossim_float64 height() const
Definition: ossimDrect.h:517
ossim_uint32 size() const
virtual void getViewSegments(std::vector< ossimDrect > &viewBounds, ossimPolyArea2d &polyArea, ossim_uint32 numberOfEdgePoints=25) const
Because of the fact we can have dateline crossings there exist on the view plane both positive and ne...
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
bool clipToRect(vector< ossimPolygon > &result, const ossimDrect &rect) const
Uses the ossimPolyArea2d class for the intersection.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
After rewrite for incorporating ossimImageGeometry: No longer needed.
bool initializeViewSize()
Initializes the view geometry image size from image geometry bounding rect.
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
virtual ossimGpt origin() const =0
ossimDpt midPoint() const
Definition: ossimDrect.h:817
ossim_int32 y
Definition: ossimIpt.h:142
const ossimDpt & ur() const
Definition: ossimDrect.h:340
virtual ossimDpt getInputMetersPerPixel() const
Returns the GSD of input image.
double x
Definition: ossimDpt.h:164
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
const ossim2dTo2dTransform * getTransform() const
Access methods for transform (may be NULL pointer).
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
bool hasProjection() const
Returns TRUE if valid projection defined.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
After rewrite for incorporating ossimImageGeometry: No longer needed.
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the transform (if any) and projection (if any) states to the KWL.
ossim_int32 x
Definition: ossimIpt.h:141
const ossimDpt & ll() const
Definition: ossimDrect.h:342
ossim_float64 lat
Definition: ossimGpt.h:265
void fullToRn(const ossimDpt &fullPt, ossim_uint32 resolutionLevel, ossimDpt &rnPt) const
fullToRn is a utility method that takes a full image point and maps it to a rn resolution image point...
ossimImageViewProjectionTransform(ossimImageGeometry *imageGeometry=0, ossimImageGeometry *viewGeometry=0)
const ossimDpt & lr() const
Definition: ossimDrect.h:341
void makeNan()
Definition: ossimDpt.h:65
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
void setImageGeometry(ossimImageGeometry *g)
Assigns the geometry to use for input image. This object does NOT own the geometry.
ossimDpt decimationFactor(ossim_uint32 r_index) const
Returns the decimation factor from R0 for the resolution level specified.
int ossim_int32
void getImageEdgePoints(std::vector< ossimDpt > &result, ossim_uint32 partitions=25) const