Isis Developer Reference
Isis::Transform Class Reference

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
 Allows the retrieval of the calculated number of samples in the output image. More...
 
virtual int OutputLines () const
 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)
 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

Constructor & Destructor Documentation

◆ Transform()

Isis::Transform::Transform ( )
inline

Constructs a Transform object.

◆ ~Transform()

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

Destroy the Transform object.

Member Function Documentation

◆ OutputLines()

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

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

Returns
int The number of lines in the output image.

Reimplemented in Isis::Enlarge.

◆ OutputSamples()

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

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

Returns
int The number of samples in the output image.

Reimplemented in Isis::Enlarge.

◆ Xform()

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

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

Reimplemented in Isis::Enlarge.


The documentation for this class was generated from the following file:
Isis::Transform::OutputSamples
virtual int OutputSamples() const
Allows the retrieval of the calculated number of samples in the output image.
Definition: Transform.h:93
Isis::Transform::Transform
Transform()
Constructs a Transform object.
Definition: Transform.h:80
Isis::Transform::OutputLines
virtual int OutputLines() const
Allows the retrieval of the calculated number of lines in the output image.
Definition: Transform.h:103