Isis 3 Programmer Reference
Isis::Transform Class Referenceabstract

Pixel transformation. More...

#include <Transform.h>

Inheritance diagram for Isis::Transform:
Inheritance graph
Collaboration diagram for Isis::Transform:
Collaboration graph

Public Member Functions

 Transform ()
 Constructs a Transform object. More...
 
virtual ~Transform ()
 Destroy the Transform object. More...
 
virtual int OutputSamples () const =0
 Allows the retrieval of the calculated number of samples in the output image. More...
 
virtual int OutputLines () const =0
 Allows the retrieval of the calculated number of lines in the output image. More...
 
virtual bool Xform (double &inSample, double &inLine, const double outSample, const double outLine)=0
 Transforms the given output line and sample to the corresponding output line and sample. More...
 

Detailed Description

Pixel transformation.

This class is used as a virtual base class for rubbersheeting (geometric warping) of image data. In Isis, rubbersheeting is performed by a transform from output space to input space, where a space could be a disk cube or an internalized memory cube. In particular, the transform must provide a method for converting output pixel locations (sample,line) to input pixel locations. A very simple example of a transform is a translation (shifting the cube left/right and up/down). More complex transforms can be created such as rotations, scaling, and converting to a map projection. The Transform class is "pure virtual" and should never be instantiated but instead used in an inheriting class. Using the translation example:

class Translate : public Transform {
public: Translate (IsisCube &cube, double sampOffset, double lineOffset)
{
p_lines = cube.Lines();
p_samples = cube.Samples();
p_lineOffset = lineOffset;
p_sampOffset = sampOffset;
}
~Translate () {};
int OutputSamples () { return p_samples; };
int OutputLines() { return p_lines; };
void Transform (double &insamp, double &inline, const double outsamp,
const double outline)
{
insamp = outsamp + p_sampOffset; inline = outline + p_lineOffset;
}
private:
double p_sampOffset;
double p_lineOffset;
int p_lines;
int p_samples;
};

If you are developing an application program whose intent is to geometrically manipulate the pixels in a cube, you should investigate the RubberSheet object which will deals nicely with a significant amount of the cube access and user input. Also, check out other applications which use the RubberSheet object such as "rotate" or "translate".

If you would like to see Transform being used in implementation, see transform.cpp

Author
2002-10-14 Stuart Sides
History:

2002-11-14 Stuart Sides - Modified documentation after review by Jeff Anderson

2003-05-16 Stuart Sides - Modified schema from astrogeology... isis.astrogeology...

2004-06-22 Jeff Anderson - Modified Transform method so that it was not const

2005-02-22 Elizabeth Ribelin - Modified file to support Doxygen documentation

Todo:
2005-02-22 Stuart Sides - finish documentation

Definition at line 89 of file Transform.h.

Constructor & Destructor Documentation

◆ Transform()

Isis::Transform::Transform ( )
inline

Constructs a Transform object.

Definition at line 97 of file Transform.h.

◆ ~Transform()

virtual Isis::Transform::~Transform ( )
inlinevirtual

Destroy the Transform object.

Definition at line 100 of file Transform.h.

Member Function Documentation

◆ OutputLines()

virtual int Isis::Transform::OutputLines ( ) const
pure virtual

Allows the retrieval of the calculated number of lines in the output image.

Returns
int The number of lines in the output image.

Implemented in Isis::Enlarge.

◆ OutputSamples()

virtual int Isis::Transform::OutputSamples ( ) const
pure virtual

Allows the retrieval of the calculated number of samples in the output image.

Returns
int The number of samples in the output image.

Implemented in Isis::Enlarge.

◆ Xform()

virtual bool Isis::Transform::Xform ( double &  inSample,
double &  inLine,
const double  outSample,
const double  outLine 
)
pure virtual

Transforms the given output line and sample to the corresponding output line and sample.

Parameters
inSampleThe calculated input sample where the output pixel came from.
inLineThe calculated input line where the output pixel came from.
outSampleThe output sample for which an input line and sample is being sought
outLineThe output line for which an input line and sample is being sought

Implemented in Isis::Enlarge.

Referenced by Isis::ProcessRubberSheet::TestLine().


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