USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::Transform Class Reference
[Geometry]

Pixel transformation. More...

#include <Transform.h>

Inherited by Isis::Enlarge.

List of all members.

Public Member Functions

 Transform ()
 Constructs a Transform object.
virtual ~Transform ()
 Destroy the Transform object.
virtual int OutputSamples () const =0
 Allows the retrieval of the calculated number of samples in the output image.
virtual int OutputLines () const =0
 Allows the retrieval of the calculated number of lines in the output image.
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.

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

Isis::Transform::Transform (  )  [inline]

Constructs a Transform object.

virtual Isis::Transform::~Transform (  )  [inline, virtual]

Destroy the Transform object.


Member Function Documentation

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.

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.

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:
inSample The calculated input sample where the output pixel came from.
inLine The calculated input line where the output pixel came from.
outSample The output sample for which an input line and sample is being sought
outLine The output line for which an input line and sample is being sought

Implemented in Isis::Enlarge.


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