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

#include <ossimImageViewAffineTransform.h>

Inheritance diagram for ossimImageViewAffineTransform:
ossimImageViewTransform ossim2dTo2dTransform ossimViewInterface ossimObject ossimReferenced

Public Member Functions

 ossimImageViewAffineTransform (double rotateDegrees=0.0, double imageScaleX=1.0, double imageScaleY=1.0, double scaleXValue=1.0, double scaleYValue=1.0, double translateXValue=0.0, double translateYValue=0.0, double pivotXValue=0.0, double pivotYValue=0.0)
 
virtual ~ossimImageViewAffineTransform ()
 
 ossimImageViewAffineTransform (const ossimImageViewAffineTransform &src)
 
virtual ossimObjectdup () const
 
virtual void imageToView (const ossimDpt &imagePoint, ossimDpt &viewPoint) const
 
virtual void viewToImage (const ossimDpt &viewPoint, ossimDpt &imagePoint) const
 
void setMatrix (NEWMAT::Matrix &matrix)
 
const NEWMAT::Matrix & getMatrix () const
 
virtual bool isIdentity () const
 
virtual bool isValid () const
 
virtual bool setView (ossimObject *obj)
 
virtual ossimObjectgetView ()
 
virtual const ossimObjectgetView () const
 
virtual ossimDpt getInputMetersPerPixel () const
 
virtual ossimDpt getOutputMetersPerPixel () const
 
virtual void translate (double deltaX, double deltaY)
 
virtual void translateX (double deltaX)
 
virtual void translateY (double deltaY)
 
virtual void pivot (double originX, double originY)
 
virtual void pivotX (double originX)
 
virtual void pivotY (double originY)
 
virtual void imageSpaceScale (double x, double y)
 
virtual void imageSpaceScaleX (double x)
 
virtual void imageSpaceScaleY (double y)
 
virtual void scale (double x, double y)
 
virtual void scaleX (double x)
 
virtual void scaleY (double y)
 
virtual void rotate (double degrees)
 
ossim_float64 getRotation () const
 
const ossimDptgetScale () const
 
const ossimDptgetTranslate () const
 
const ossimDptgetPivot () const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
- Public Member Functions inherited from ossimImageViewTransform
 ossimImageViewTransform ()
 
virtual void forward (const ossimDpt &input, ossimDpt &output) const
 
virtual void inverse (const ossimDpt &input, ossimDpt &output) const
 
virtual void getImageToViewScale (ossimDpt &resultScale, const ossimDpt &imagePoint, const ossimDpt &deltaImagePointXY) const
 
virtual void getViewToImageScale (ossimDpt &resultScale, const ossimDpt &imagePoint, const ossimDpt &deltaImagePointXY) const
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
ossimDpt imageToView (const ossimDpt &imagePoint) const
 
ossimDpt viewToImage (const ossimDpt &viewPoint) const
 
virtual void getScaleChangeImageToView (ossimDpt &result, const ossimDrect &imageRect)
 
virtual void getScaleChangeViewToImage (ossimDpt &result, const ossimDrect &viewRect)
 
virtual void getRoundTripErrorView (ossimDpt &result, const ossimDpt &viewPt) const
 
virtual ossimDpt getRoundTripErrorView (const ossimDpt &viewPt) const
 
virtual void getRoundTripErrorImage (ossimDpt &result, const ossimDpt &imagePt) const
 
virtual ossimDpt getRoundTripErrorImage (const ossimDpt &imagePt) 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 input rect corners. More...
 
virtual ossimDrect getViewToImageBounds (const ossimDrect &viewRect) const
 Computes the bounding rect in image space of the quad formed by the transformed view points of the input rect corners. More...
 
- Public Member Functions inherited from ossim2dTo2dTransform
virtual void forward (ossimDpt &modify_this) const
 
virtual void inverse (ossimDpt &modify_this) const
 
virtual const ossim2dTo2dTransformoperator= (const ossim2dTo2dTransform &rhs)
 
virtual ossimDpt getOrigin () const
 
void setConvergenceThreshold (const double &new_threshold)
 
void setMaxIterations (int new_max_iters)
 
void setDxDy (const ossimDpt &dxdy)
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
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 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
 
- Public Member Functions inherited from ossimViewInterface
 ossimViewInterface ()
 
 ossimViewInterface (ossimObject *base)
 
virtual ~ossimViewInterface ()
 
virtual void refreshView ()
 
ossimObjectgetBaseObject ()
 

Protected Member Functions

void buildCompositeTransform ()
 
- Protected Member Functions inherited from ossim2dTo2dTransform
 ossim2dTo2dTransform ()
 
virtual ~ossim2dTo2dTransform ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

NEWMAT::Matrix m_transform
 
NEWMAT::Matrix m_inverseTransform
 
ossim_float64 m_rotation
 
ossimDpt m_imageSpaceScale
 
ossimDpt m_scale
 
ossimDpt m_translate
 
ossimDpt m_pivot
 
- Protected Attributes inherited from ossim2dTo2dTransform
double theConvergenceThreshold
 
int theMaxIterations
 
ossimDpt theDxDy
 
- Protected Attributes inherited from ossimViewInterface
ossimObjecttheObject
 

Detailed Description

Definition at line 17 of file ossimImageViewAffineTransform.h.

Constructor & Destructor Documentation

◆ ossimImageViewAffineTransform() [1/2]

ossimImageViewAffineTransform::ossimImageViewAffineTransform ( double  rotateDegrees = 0.0,
double  imageScaleX = 1.0,
double  imageScaleY = 1.0,
double  scaleXValue = 1.0,
double  scaleYValue = 1.0,
double  translateXValue = 0.0,
double  translateYValue = 0.0,
double  pivotXValue = 0.0,
double  pivotYValue = 0.0 
)

Definition at line 18 of file ossimImageViewAffineTransform.cpp.

27  :m_transform(3,3),
28  m_inverseTransform(3,3),
29  m_rotation(rotateDegrees),
30  m_imageSpaceScale(imageScaleX,imageScaleY),
31  m_scale(scaleXValue, scaleYValue),
32  m_translate(translateXValue, translateYValue),
33  m_pivot(pivotXValue, pivotYValue)
34 {
35  m_transform << 1 << 0 << 0
36  << 0 << 1 << 0
37  << 0 << 0 << 1;
38 
39  m_inverseTransform << 1 << 0 << 0
40  << 0 << 1 << 0
41  << 0 << 0 << 1;
42 
43 
44  rotate(rotateDegrees);
45  scale(scaleXValue, scaleYValue);
46  translate(translateXValue, translateYValue);
48 }
double y
Definition: ossimDpt.h:165
virtual void pivot(double originX, double originY)
double x
Definition: ossimDpt.h:164
virtual void scale(double x, double y)
virtual void translate(double deltaX, double deltaY)

◆ ~ossimImageViewAffineTransform()

ossimImageViewAffineTransform::~ossimImageViewAffineTransform ( )
virtual

Definition at line 50 of file ossimImageViewAffineTransform.cpp.

51 {
52 }

◆ ossimImageViewAffineTransform() [2/2]

ossimImageViewAffineTransform::ossimImageViewAffineTransform ( const ossimImageViewAffineTransform src)
inline

Member Function Documentation

◆ buildCompositeTransform()

void ossimImageViewAffineTransform::buildCompositeTransform ( )
protected

Definition at line 176 of file ossimImageViewAffineTransform.cpp.

References ossimMatrix3x3::createRotationZMatrix(), m_imageSpaceScale, m_inverseTransform, m_pivot, m_rotation, m_scale, m_transform, m_translate, ossimDpt::x, and ossimDpt::y.

Referenced by imageSpaceScale(), loadState(), pivot(), rotate(), scale(), and translate().

177 {
178  NEWMAT::Matrix imageSpaceScaleM(3,3);
179  NEWMAT::Matrix scaleM(3, 3);
180  NEWMAT::Matrix rotzM = ossimMatrix3x3::createRotationZMatrix(m_rotation);
181  NEWMAT::Matrix transM(3,3);
182  NEWMAT::Matrix transOriginM(3,3);
183  NEWMAT::Matrix transOriginNegatedM(3,3);
184 
185  transM << 1 << 0 << m_translate.x
186  << 0 << 1 << m_translate.y
187  << 0 << 0 << 1;
188 
189  transOriginM << 1 << 0 << m_pivot.x
190  << 0 << 1 << m_pivot.y
191  << 0 << 0 << 1;
192 
193  transOriginNegatedM << 1 << 0 << -m_pivot.x
194  << 0 << 1 << -m_pivot.y
195  << 0 << 0 << 1;
196 
197  scaleM << m_scale.x << 0 << 0
198  << 0 << m_scale.y << 0
199  << 0 << 0 << 1;
200 
201  imageSpaceScaleM << m_imageSpaceScale.x << 0 << 0
202  << 0 << m_imageSpaceScale.y << 0
203  << 0 << 0 << 1;
204 
205 // m_transform = transOriginM*transM*scaleM*rotzM*transOriginNegatedM;
206  // pivot should just be around the rotation
207  m_transform = transM*scaleM*transOriginM*rotzM*imageSpaceScaleM*transOriginNegatedM;
209 
210 }
double y
Definition: ossimDpt.h:165
static NEWMAT::Matrix createRotationZMatrix(double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
double x
Definition: ossimDpt.h:164

◆ dup()

virtual ossimObject* ossimImageViewAffineTransform::dup ( ) const
inlinevirtual

Reimplemented from ossimObject.

Definition at line 42 of file ossimImageViewAffineTransform.h.

43  {
44  return new ossimImageViewAffineTransform(*this);
45  }
ossimImageViewAffineTransform(double rotateDegrees=0.0, double imageScaleX=1.0, double imageScaleY=1.0, double scaleXValue=1.0, double scaleYValue=1.0, double translateXValue=0.0, double translateYValue=0.0, double pivotXValue=0.0, double pivotYValue=0.0)

◆ getInputMetersPerPixel()

ossimDpt ossimImageViewAffineTransform::getInputMetersPerPixel ( ) const
virtual
Returns
(1, 1) ???????(drb)

Implements ossimImageViewTransform.

Definition at line 312 of file ossimImageViewAffineTransform.cpp.

313 {
314  return ossimDpt(1,1);
315 }

◆ getMatrix()

const NEWMAT::Matrix & ossimImageViewAffineTransform::getMatrix ( ) const

Definition at line 75 of file ossimImageViewAffineTransform.cpp.

References m_transform.

76 {
77  return m_transform;
78 }

◆ getOutputMetersPerPixel()

ossimDpt ossimImageViewAffineTransform::getOutputMetersPerPixel ( ) const
virtual
Returns
(nan, nan) ????????? (drb)

Implements ossimImageViewTransform.

Definition at line 317 of file ossimImageViewAffineTransform.cpp.

References ossimDpt::makeNan().

318 {
319  ossimDpt result;
320 
321  result.makeNan();
322 
323  return result;
324 }
void makeNan()
Definition: ossimDpt.h:65

◆ getPivot()

const ossimDpt& ossimImageViewAffineTransform::getPivot ( ) const
inline

◆ getRotation()

ossim_float64 ossimImageViewAffineTransform::getRotation ( ) const
inline

Definition at line 152 of file ossimImageViewAffineTransform.h.

◆ getScale()

const ossimDpt& ossimImageViewAffineTransform::getScale ( ) const
inline

◆ getTranslate()

const ossimDpt& ossimImageViewAffineTransform::getTranslate ( ) const
inline

◆ getView() [1/2]

ossimObject * ossimImageViewAffineTransform::getView ( )
virtual

Implements ossimViewInterface.

Definition at line 302 of file ossimImageViewAffineTransform.cpp.

303 {
304  return this;
305 }

◆ getView() [2/2]

const ossimObject * ossimImageViewAffineTransform::getView ( ) const
virtual

Implements ossimViewInterface.

Definition at line 307 of file ossimImageViewAffineTransform.cpp.

308 {
309  return this;
310 }

◆ imageSpaceScale()

void ossimImageViewAffineTransform::imageSpaceScale ( double  x,
double  y 
)
virtual

Will allow you to specify an image scale for both the x and y direction.

Definition at line 106 of file ossimImageViewAffineTransform.cpp.

References buildCompositeTransform(), m_imageSpaceScale, x, and y.

Referenced by imageSpaceScaleX(), and imageSpaceScaleY().

◆ imageSpaceScaleX()

void ossimImageViewAffineTransform::imageSpaceScaleX ( double  x)
virtual

Will allow you to specify an image scale along the X direction.

Definition at line 112 of file ossimImageViewAffineTransform.cpp.

References imageSpaceScale(), m_imageSpaceScale, x, and ossimDpt::y.

113 {
115 }
ossim_uint32 x
double y
Definition: ossimDpt.h:165
virtual void imageSpaceScale(double x, double y)

◆ imageSpaceScaleY()

void ossimImageViewAffineTransform::imageSpaceScaleY ( double  y)
virtual

Will allow you to an image scale along the Y direction.

Definition at line 117 of file ossimImageViewAffineTransform.cpp.

References imageSpaceScale(), m_imageSpaceScale, ossimDpt::x, and y.

118 {
120 }
ossim_uint32 y
virtual void imageSpaceScale(double x, double y)
double x
Definition: ossimDpt.h:164

◆ imageToView()

void ossimImageViewAffineTransform::imageToView ( const ossimDpt imagePoint,
ossimDpt viewPoint 
) const
virtual

Reimplemented from ossimImageViewTransform.

Definition at line 54 of file ossimImageViewAffineTransform.cpp.

References m_transform, ossimDpt::x, and ossimDpt::y.

Referenced by ossimChipperUtil::addCrossHairAnnotation().

56 {
57 
58  viewPoint.x = m_transform[0][0]*imagePoint.x + m_transform[0][1]*imagePoint.y + m_transform[0][2];
59  viewPoint.y = m_transform[1][0]*imagePoint.x + m_transform[1][1]*imagePoint.y + m_transform[1][2];
60 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164

◆ isEqualTo()

bool ossimImageViewAffineTransform::isEqualTo ( const ossimObject obj,
ossimCompareType  compareType = OSSIM_COMPARE_FULL 
) const
virtual

Reimplemented from ossimObject.

Definition at line 326 of file ossimImageViewAffineTransform.cpp.

References ossim::almostEqual(), ossimObject::isEqualTo(), ossimDpt::isEqualTo(), m_imageSpaceScale, m_pivot, m_rotation, m_scale, and m_translate.

327 {
328  bool result = ossimImageViewTransform::isEqualTo(obj,compareType);
329 
330  if(result)
331  {
332  result = false;
333  const ossimImageViewAffineTransform* rhs = dynamic_cast<const ossimImageViewAffineTransform*> (&obj);
334  if(rhs)
335  {
336  result = (ossim::almostEqual(m_rotation, rhs->m_rotation)&&
338  (m_scale.isEqualTo(rhs->m_scale))&&
340  (m_pivot.isEqualTo(rhs->m_pivot))
341  );
342  }
343  }
344 
345  return result;
346 }
virtual bool isEqualTo(const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
bool isEqualTo(const ossimDpt &rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
Definition: ossimDpt.cpp:153
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53

◆ isIdentity()

virtual bool ossimImageViewAffineTransform::isIdentity ( ) const
inlinevirtual

derived classes will specify if the imageViewTransform is an identity.

Implements ossimImageViewTransform.

Definition at line 59 of file ossimImageViewAffineTransform.h.

60  {
61  return ((m_transform[0][0] == 1.0)&&
62  (m_transform[0][1] == 0.0)&&
63  (m_transform[0][2] == 0.0)&&
64  (m_transform[1][0] == 0.0)&&
65  (m_transform[1][1] == 1.0)&&
66  (m_transform[1][2] == 0.0)&&
67  (m_transform[2][0] == 0.0)&&
68  (m_transform[2][1] == 0.0)&&
69  (m_transform[2][2] == 1.0));
70  }

◆ isValid()

bool ossimImageViewAffineTransform::isValid ( void  ) const
virtual

Implements ossimImageViewTransform.

Definition at line 281 of file ossimImageViewAffineTransform.cpp.

282 {
283  return true;
284 }

◆ loadState()

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

Method to the load (recreate) the state of the object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimImageViewTransform.

Definition at line 213 of file ossimImageViewAffineTransform.cpp.

References buildCompositeTransform(), ossimKeywordlist::find(), ossimImageViewTransform::loadState(), m_imageSpaceScale, m_pivot, m_rotation, m_scale, m_translate, and ossimDpt::toPoint().

215 {
216  ossimString imageScaleString(kwl.find(prefix,"image_scale"));
217  ossimString scaleString(kwl.find(prefix,"scale"));
218  ossimString pivotString(kwl.find(prefix,"pivot"));
219  ossimString translateString(kwl.find(prefix,"translate"));
220  ossimString rotateString(kwl.find(prefix,"rotate"));
221 
222  if(!imageScaleString.empty())
223  {
224  m_imageSpaceScale.toPoint(imageScaleString);
225  }
226  if(!scaleString.empty())
227  {
228  m_scale.toPoint(scaleString);
229  }
230  if(!pivotString.empty())
231  {
232  m_pivot.toPoint(pivotString);
233  }
234  if(!translateString.empty())
235  {
236  m_translate.toPoint(translateString);
237  }
238  if(!rotateString.empty())
239  {
240  m_rotation = rotateString.toDouble();
241  }
244  return true;
245 }
const char * find(const char *key) const
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimDpt.cpp:192
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)

◆ pivot()

void ossimImageViewAffineTransform::pivot ( double  originX,
double  originY 
)
virtual

Translate the origin for rotation in the x and y direction.

Definition at line 149 of file ossimImageViewAffineTransform.cpp.

References buildCompositeTransform(), m_pivot, ossimDpt::x, and ossimDpt::y.

Referenced by pivotX(), and pivotY().

150 {
151  m_pivot.x = originX;
152  m_pivot.y = originY;
154 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164

◆ pivotX()

void ossimImageViewAffineTransform::pivotX ( double  originX)
virtual

Translate the origin for rotation in the x direction.

Definition at line 156 of file ossimImageViewAffineTransform.cpp.

References m_pivot, pivot(), and ossimDpt::y.

157 {
158  pivot(originX,m_pivot.y);
159 }
double y
Definition: ossimDpt.h:165
virtual void pivot(double originX, double originY)

◆ pivotY()

void ossimImageViewAffineTransform::pivotY ( double  originY)
virtual

Translate the origin for rotation in the y direction.

Definition at line 161 of file ossimImageViewAffineTransform.cpp.

References m_pivot, pivot(), and ossimDpt::x.

162 {
163  pivot(m_pivot.x, originY);
164 }
virtual void pivot(double originX, double originY)
double x
Definition: ossimDpt.h:164

◆ rotate()

void ossimImageViewAffineTransform::rotate ( double  degrees)
virtual

Will apply a rotation

Definition at line 166 of file ossimImageViewAffineTransform.cpp.

References buildCompositeTransform(), and m_rotation.

167 {
168  m_rotation = degrees;
170 // m_transform = (m_transform * ossimMatrix3x3::createRotationZMatrix(degrees));
171 // m_transform = ossimMatrix3x3::createRotationZMatrix(degrees) * m_transform;
172 
173 // m_inverseTransform = m_transform.i();
174 }

◆ saveState()

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

Method to save the state of the object to a keyword list. Return true if ok or false on error.

Reimplemented from ossimImageViewTransform.

Definition at line 247 of file ossimImageViewAffineTransform.cpp.

References ossimKeywordlist::add(), m_imageSpaceScale, m_pivot, m_rotation, m_scale, m_translate, ossimImageViewTransform::saveState(), and ossimDpt::toString().

249 {
250  kwl.add(prefix,
251  "image_scale",
253  true);
254  kwl.add(prefix,
255  "rotation",
256  m_rotation,
257  true);
258 
259  // Fixed for multithread sequencer load, this uses saveState/loadState to
260  // clone image chains and rotate was not cloning, producing invalid tiles
261  kwl.add(prefix,
262  "rotate",
263  m_rotation,
264  true);
265  kwl.add(prefix,
266  "pivot",
267  m_pivot.toString(),
268  true);
269  kwl.add(prefix,
270  "scale",
271  m_scale.toString(),
272  true);
273  kwl.add(prefix,
274  "translate",
276  true);
277 
278  return ossimImageViewTransform::saveState(kwl,prefix);
279 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimDpt.cpp:160

◆ scale()

void ossimImageViewAffineTransform::scale ( double  x,
double  y 
)
virtual

will allow you to specify a scale for both the x and y direction.

Definition at line 122 of file ossimImageViewAffineTransform.cpp.

References buildCompositeTransform(), m_scale, x, and y.

Referenced by ossimKakaduJpipHandler::getTile(), scaleX(), and scaleY().

123 {
124 // NEWMAT::Matrix m(3, 3);
125 
126 // m << x << 0 << 0
127 // << 0 << y << 0
128 // << 0 << 0 << 1;
129 
130 
131 // m_transform = (m*m_transform);
132 
133 // m_inverseTransform = m_transform.i();
134 
135  m_scale = ossimDpt(x,y);
137 }
ossim_uint32 x
ossim_uint32 y

◆ scaleX()

void ossimImageViewAffineTransform::scaleX ( double  x)
virtual

will alow you to specify a scale along the X direction.

Definition at line 139 of file ossimImageViewAffineTransform.cpp.

References m_scale, scale(), x, and ossimDpt::y.

140 {
141  scale(x, m_scale.y);
142 }
ossim_uint32 x
double y
Definition: ossimDpt.h:165
virtual void scale(double x, double y)

◆ scaleY()

void ossimImageViewAffineTransform::scaleY ( double  y)
virtual

Will allow you to scale along the Y direction.

Definition at line 144 of file ossimImageViewAffineTransform.cpp.

References m_scale, scale(), ossimDpt::x, and y.

145 {
146  scale(m_scale.x, y);
147 }
ossim_uint32 y
double x
Definition: ossimDpt.h:164
virtual void scale(double x, double y)

◆ setMatrix()

void ossimImageViewAffineTransform::setMatrix ( NEWMAT::Matrix &  matrix)

◆ setView()

bool ossimImageViewAffineTransform::setView ( ossimObject baseObject)
virtual

The derived classes should overrid this method and return true or false whether it was able to cast the past in view to a view that it can interface to. So if you are a projective view you might cast to an ossimProjection. The ownsTheView specifies whether or not it owns the passed in view pointer. This will specifiy whether or not the derived classes need to re-allocate the pointer or just delete its old pointer and set it to the passed in pointer.

Implements ossimViewInterface.

Definition at line 286 of file ossimImageViewAffineTransform.cpp.

References m_imageSpaceScale, m_inverseTransform, m_pivot, m_rotation, m_scale, m_transform, and m_translate.

◆ translate()

void ossimImageViewAffineTransform::translate ( double  deltaX,
double  deltaY 
)
virtual

Translate in the x and y direction.

Definition at line 80 of file ossimImageViewAffineTransform.cpp.

References buildCompositeTransform(), and m_translate.

Referenced by translateX(), and translateY().

82 {
83  m_translate = ossimDpt(deltaX, deltaY);
85 // NEWMAT::Matrix m(3,3);
86 
87 // m << 1 << 0 << deltaX
88 // << 0 << 1 << deltaY
89 // << 0 << 0 << 1;
90 
91 
92 // m_transform = m*m_transform;
93 // m_inverseTransform = m_transform.i();
94 }

◆ translateX()

void ossimImageViewAffineTransform::translateX ( double  deltaX)
virtual

Translate in the x direction.

Definition at line 96 of file ossimImageViewAffineTransform.cpp.

References m_translate, translate(), and ossimDpt::y.

97 {
98  translate(deltaX, m_translate.y);
99 }
double y
Definition: ossimDpt.h:165
virtual void translate(double deltaX, double deltaY)

◆ translateY()

void ossimImageViewAffineTransform::translateY ( double  deltaY)
virtual

Translate in the Y direction.

Definition at line 101 of file ossimImageViewAffineTransform.cpp.

References m_translate, translate(), and ossimDpt::x.

102 {
103  translate(m_translate.x, deltaY);
104 }
double x
Definition: ossimDpt.h:164
virtual void translate(double deltaX, double deltaY)

◆ viewToImage()

void ossimImageViewAffineTransform::viewToImage ( const ossimDpt viewPoint,
ossimDpt imagePoint 
) const
virtual

Reimplemented from ossimImageViewTransform.

Definition at line 62 of file ossimImageViewAffineTransform.cpp.

References m_inverseTransform, ossimDpt::x, and ossimDpt::y.

64 {
65  imagePoint.x = m_inverseTransform[0][0]*viewPoint.x + m_inverseTransform[0][1]*viewPoint.y + m_inverseTransform[0][2];
66  imagePoint.y = m_inverseTransform[1][0]*viewPoint.x + m_inverseTransform[1][1]*viewPoint.y + m_inverseTransform[1][2];
67 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164

Member Data Documentation

◆ m_imageSpaceScale

ossimDpt ossimImageViewAffineTransform::m_imageSpaceScale
protected

◆ m_inverseTransform

NEWMAT::Matrix ossimImageViewAffineTransform::m_inverseTransform
protected

◆ m_pivot

ossimDpt ossimImageViewAffineTransform::m_pivot
protected

◆ m_rotation

ossim_float64 ossimImageViewAffineTransform::m_rotation
protected

◆ m_scale

ossimDpt ossimImageViewAffineTransform::m_scale
protected

◆ m_transform

NEWMAT::Matrix ossimImageViewAffineTransform::m_transform
protected

This is the transformation from image to viewing coordinates. If this matrix is changed it will perform an inverse to solve the inverse transform.

Definition at line 176 of file ossimImageViewAffineTransform.h.

Referenced by buildCompositeTransform(), getMatrix(), imageToView(), setMatrix(), and setView().

◆ m_translate

ossimDpt ossimImageViewAffineTransform::m_translate
protected

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