GLIMSView Source Code Documentation

ImageFormat Class Reference

#include <imageformat.h>

Inheritance diagram for ImageFormat:

Inheritance graph
[legend]

List of all members.


Detailed Description

An abstract class that provides an interface to a basic image format.

Requirements are things like I/O and georeferencing as well as general information about the image.

To add a new image format to glimsview, all one needs to do is extend this class, override and implement its abstract routines, and fill in the mImageInf member. A recompilation of the source will be necessary.

Notes: An additional feature to glimsview would be to reimplement this as another plugin interface that dynamically loads the image formats available to the application on start that would be stored in a particular directory, i.e. ./formats/. This would allow anyone to append their own file format without the source. [Dan Mingus]

Author:
Dan Mingus

Definition at line 37 of file imageformat.h.


Public Types

enum  ScaleType { SCALE_NN = 1, SCALE_BI, SCALE_BC }
enum  DataType {
  NOT_DEFINED, INT8, UINT8, INT16,
  UINT16, INT32, UINT32, INT64,
  UINT64, FLOAT16, FLOAT32, FLOAT64
}

Public Member Functions

 ImageFormat ()
virtual ~ImageFormat ()
virtual bool open (std::string fname)=0
virtual void * getBand (int iband, int x1, int y1, int w1, int h1, int w2, int h2, ScaleType st=SCALE_BI) const =0
virtual void getLL (int iband, double &i, double &j)=0
virtual void getXY (int iband, double &i, double &j)=0
std::vector< BandInf > & getBandInfSet ()
unsigned int getNumBands ()
const BandInfgetBandInf (int iband)
std::string getName () const
char * scaleData (char **orig, int ow, int oh, int nw, int nh, DataType dt, ScaleType st, bool del=true) const
char * scaleData (char **orig, int ox, int oy, int ow, int oh, int fw, int fh, int nw, int nh, DataType dt, ScaleType st, bool del=true) const
template<class DType>
DType * scaleDT (DType *orig, int ox, int oy, int ow, int oh, int fw, int fh, int nw, int nh, ScaleType st) const
template<typename DType>
DType * scl_nearestneighbor (DType *orig, int ox, int oy, int ow, int oh, int fw, int fh, int nw, int nh) const
template<class DType>
DType * scl_bilinear (DType *orig, int ox, int oy, int ow, int oh, int fw, int fh, int nw, int nh) const
unsigned char * scl_bicubic (unsigned char *orig, int ow, int oh, int nw, int nh, int szd) const
ImageInfgetImageInf ()
void setCornerPnts (int iband, ImageInf &inf)

Static Public Member Functions

static std::string dtypeToString (DataType dt)
static int dtypeSize (DataType dt)
static bool isFloat (DataType dt)

Protected Member Functions

void xyToLL (int iband, double &x, double &y)
void xyToMeter (int iband, double &x, double &y)
void meterToLL (int iband, double &x, double &y)
void llToMeter (int iband, double &lon, double &lat)
void llToXY (int iband, double &lon, double &lat)
projPJ createProj (int iband)
void getULCorners ()

Protected Attributes

std::string mFName
std::vector< BandInfmBandSet
ImageInf mImageInf

Private Attributes

char * mParms [15]

Classes

struct  BandInf
 Structure to hold metadata about the bands in the image. More...

Member Enumeration Documentation

Enumerator:
SCALE_NN 
SCALE_BI 
SCALE_BC 

Definition at line 39 of file imageformat.h.

Enumerator:
NOT_DEFINED 
INT8 
UINT8 
INT16 
UINT16 
INT32 
UINT32 
INT64 
UINT64 
FLOAT16 
FLOAT32 
FLOAT64 

Definition at line 45 of file imageformat.h.


Constructor & Destructor Documentation

ImageFormat::ImageFormat (  ) 

Definition at line 5 of file imageformat.cpp.

ImageFormat::~ImageFormat (  )  [virtual]

Definition at line 9 of file imageformat.cpp.


Member Function Documentation

void ImageFormat::xyToLL ( int  iband,
double &  x,
double &  y 
) [protected]

Definition at line 618 of file imageformat.cpp.

References mBandSet, meterToLL(), and xyToMeter().

Referenced by NlapsFrmt::fillImageInf(), NlapsFrmt::getLL(), and HdfEosFrmt::getLL().

Here is the call graph for this function:

void ImageFormat::xyToMeter ( int  iband,
double &  x,
double &  y 
) [protected]

void ImageFormat::meterToLL ( int  iband,
double &  x,
double &  y 
) [protected]

Definition at line 533 of file imageformat.cpp.

References createProj(), and mBandSet.

Referenced by xyToLL().

Here is the call graph for this function:

void ImageFormat::llToMeter ( int  iband,
double &  lon,
double &  lat 
) [protected]

Definition at line 550 of file imageformat.cpp.

References createProj(), and mBandSet.

Referenced by getULCorners(), and llToXY().

Here is the call graph for this function:

void ImageFormat::llToXY ( int  iband,
double &  lon,
double &  lat 
) [protected]

Definition at line 568 of file imageformat.cpp.

References llToMeter(), M_PI, and mBandSet.

Referenced by NlapsFrmt::getXY(), and HdfEosFrmt::getXY().

Here is the call graph for this function:

projPJ ImageFormat::createProj ( int  iband  )  [protected]

void ImageFormat::getULCorners (  )  [protected]

Definition at line 663 of file imageformat.cpp.

References llToMeter(), mBandSet, ImageFormat::BandInf::proj, ImageFormat::BandInf::ulx, and ImageFormat::BandInf::uly.

Referenced by NlapsFrmt::fillBandInf(), and HdfEosFrmt::open().

Here is the call graph for this function:

virtual bool ImageFormat::open ( std::string  fname  )  [pure virtual]

virtual void* ImageFormat::getBand ( int  iband,
int  x1,
int  y1,
int  w1,
int  h1,
int  w2,
int  h2,
ScaleType  st = SCALE_BI 
) const [pure virtual]

virtual void ImageFormat::getLL ( int  iband,
double &  i,
double &  j 
) [pure virtual]

virtual void ImageFormat::getXY ( int  iband,
double &  i,
double &  j 
) [pure virtual]

std::vector< ImageFormat::BandInf > & ImageFormat::getBandInfSet (  ) 

unsigned int ImageFormat::getNumBands (  )  [inline]

Definition at line 123 of file imageformat.h.

Referenced by ImageInterface::getBands(), L7A_Nlaps::getFrmt(), and L7A_Fast::getFrmt().

const ImageFormat::BandInf & ImageFormat::getBandInf ( int  iband  ) 

Definition at line 24 of file imageformat.cpp.

References mBandSet.

Referenced by L7A_Geotiff::open().

std::string ImageFormat::getName (  )  const

Definition at line 28 of file imageformat.cpp.

References mFName.

Referenced by HdfEosFrmt::getBandMetaData(), and Image::getName().

std::string ImageFormat::dtypeToString ( ImageFormat::DataType  dt  )  [static]

Definition at line 32 of file imageformat.cpp.

References FLOAT16, FLOAT32, FLOAT64, INT16, INT32, INT64, INT8, NOT_DEFINED, UINT16, UINT32, UINT64, and UINT8.

Referenced by BandChooserDlg::reloadList().

int ImageFormat::dtypeSize ( ImageFormat::DataType  dt  )  [static]

bool ImageFormat::isFloat ( ImageFormat::DataType  dt  )  [static]

Definition at line 152 of file imageformat.cpp.

References INT16, INT32, INT64, INT8, NOT_DEFINED, UINT16, UINT32, UINT64, and UINT8.

char * ImageFormat::scaleData ( char **  orig,
int  ow,
int  oh,
int  nw,
int  nh,
DataType  dt,
ScaleType  st,
bool  del = true 
) const

char * ImageFormat::scaleData ( char **  orig,
int  ox,
int  oy,
int  ow,
int  oh,
int  fw,
int  fh,
int  nw,
int  nh,
DataType  dt,
ScaleType  st,
bool  del = true 
) const

Definition at line 209 of file imageformat.cpp.

References FLOAT32, FLOAT64, INT16, INT8, SCALE_BI, SCALE_NN, scl_bilinear(), scl_nearestneighbor(), UINT16, and UINT8.

Here is the call graph for this function:

template<class DType>
DType * ImageFormat::scaleDT ( DType *  orig,
int  ox,
int  oy,
int  ow,
int  oh,
int  fw,
int  fh,
int  nw,
int  nh,
ScaleType  st 
) const [inline]

Definition at line 322 of file imageformat.cpp.

References SCALE_BC, SCALE_BI, and SCALE_NN.

template<typename DType>
DType * ImageFormat::scl_nearestneighbor ( DType *  orig,
int  ox,
int  oy,
int  ow,
int  oh,
int  fw,
int  fh,
int  nw,
int  nh 
) const [inline]

Definition at line 354 of file imageformat.cpp.

Referenced by scaleData().

template<class DType>
DType * ImageFormat::scl_bilinear ( DType *  orig,
int  ox,
int  oy,
int  ow,
int  oh,
int  fw,
int  fh,
int  nw,
int  nh 
) const [inline]

Definition at line 399 of file imageformat.cpp.

Referenced by scaleData().

unsigned char * ImageFormat::scl_bicubic ( unsigned char *  orig,
int  ow,
int  oh,
int  nw,
int  nh,
int  szd 
) const

Definition at line 454 of file imageformat.cpp.

ImageInf& ImageFormat::getImageInf (  )  [inline]

Definition at line 197 of file imageformat.h.

void ImageFormat::setCornerPnts ( int  iband,
ImageInf inf 
)

Definition at line 463 of file imageformat.cpp.

References getLL(), mBandSet, ImageInf::mP1, ImageInf::mP2, ImageInf::mP3, ImageInf::mP4, Node::x, Node::y, and Node::z.

Here is the call graph for this function:


Member Data Documentation

char* ImageFormat::mParms[15] [private]

Definition at line 83 of file imageformat.h.

Referenced by createProj().

std::string ImageFormat::mFName [protected]

std::vector<BandInf> ImageFormat::mBandSet [protected]


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

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov