GLIMSView Source Code Documentation

Image Class Reference

#include <image.h>

List of all members.


Detailed Description

This provides access to the ImageFormats through a single interface.

A static open routine test all available formats for usability with the given filename.

Notes: Basically an abstract factory + manager or possibly proxy of a sort to instantiate the correct subclass of ImageFormat (abstract parent to instrument-specific and otherwise varying image data file format handling subclasses) and possibly provide a generic interface to the data. In some cases, it appears Image object is bypassed and the programmer goes directly to the ImageFormat object to gain access to the data (see Threshhold plug-in). [2006-01-16 Deborah Lee Soltesz]

Author:
Dan Mingus

Definition at line 36 of file image.h.


Public Types

enum  ResampleMethod { NEAREST_NEIGHBOR, BILINEAR, BICUBIC }
enum  MultiFileType { LSAT7_GEOTIFF, LSAT7_NLAPS, LSAT7_FASTL7A, GENERIC }

Public Member Functions

 Image (ImageFormat *)
 ~Image ()
QImage * getRect (int x1, int y1, int w1, int h1, int w2, int h2, ImageFormat::ScaleType st=ImageFormat::SCALE_BI)
int width ()
int height ()
int width (int iband)
int height (int iband)
std::vector
< ImageFormat::BandInf > & 
getBandInfSet () const
std::string getName () const
void getLL (double &x, double &y)
 The values of x and y, assumed to be in XY coordinates, are modified to the corresponding latitude and longitude.
void getXY (double &x, double &y)
 The values of x and y, assumed to be latitude-longitude coordinates, are modified to the corresponding XY coordinates.
const ImageInfgetImageInf ()
void setCornerPnts (int iband, ImageInf &inf)
void setCornerPnts (ImageInf &inf)
ImageState getImageState ()
void setImageState (ImageState &state)
void setBandSel (ImageState &state)
void setMemBuf (bool state)
ImageFormatgetFormat ()

Static Public Member Functions

static ImageopenImage (std::string fname, MultiFileType type=GENERIC)

Static Public Attributes

static std::string MFF_NAMES []
static int NUM_MFF = 3

Protected Member Functions

template<class DType>
unsigned char * scaleToUC (DType *data, double min, double max, int len)
void makeRGBA (unsigned char *imbits, unsigned char *rData, unsigned char *gData, unsigned char *bData, int newWidth, int newHeight)

Protected Attributes

ImageFormatmImgFrmt
int mWidth
int mHeight
ImageState mState
InMemFormatmMemFrmt

Member Enumeration Documentation

Enumerator:
NEAREST_NEIGHBOR 
BILINEAR 
BICUBIC 

Definition at line 38 of file image.h.

Enumerator:
LSAT7_GEOTIFF 
LSAT7_NLAPS 
LSAT7_FASTL7A 
GENERIC 

Definition at line 44 of file image.h.


Constructor & Destructor Documentation

Image::Image ( ImageFormat imgf  ) 

Definition at line 21 of file image.cpp.

References ImageFormat::getBandInfSet(), height(), ImageState::mBlue, ImageState::mColor, ImageState::mGreen, mHeight, mMemFrmt, ImageState::mRed, mState, mWidth, and width().

Referenced by openImage().

Here is the call graph for this function:

Image::~Image (  ) 

Definition at line 44 of file image.cpp.

References mImgFrmt, and mMemFrmt.


Member Function Documentation

template<class DType>
unsigned char * Image::scaleToUC ( DType *  data,
double  min,
double  max,
int  len 
) [inline, protected]

Definition at line 327 of file image.cpp.

Referenced by getRect().

void Image::makeRGBA ( unsigned char *  imbits,
unsigned char *  rData,
unsigned char *  gData,
unsigned char *  bData,
int  newWidth,
int  newHeight 
) [protected]

Definition at line 341 of file image.cpp.

Referenced by getRect().

Image * Image::openImage ( std::string  fname,
MultiFileType  type = GENERIC 
) [static]

QImage * Image::getRect ( int  x1,
int  y1,
int  w1,
int  h1,
int  w2,
int  h2,
ImageFormat::ScaleType  st = ImageFormat::SCALE_BI 
)

int Image::width (  ) 

int Image::height (  ) 

int Image::width ( int  iband  ) 

Definition at line 295 of file image.cpp.

References ImageFormat::getBandInfSet(), mImgFrmt, and width().

Here is the call graph for this function:

int Image::height ( int  iband  ) 

Definition at line 306 of file image.cpp.

References ImageFormat::getBandInfSet(), height(), and mImgFrmt.

Here is the call graph for this function:

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

Definition at line 318 of file image.cpp.

References ImageFormat::getBandInfSet(), and mImgFrmt.

Referenced by ImageInterface::getBandNames(), ImageInterface::getSliceScaled(), ImageInterface::getValueAsDouble(), and BandChooserDlg::reloadList().

Here is the call graph for this function:

std::string Image::getName (  )  const

Definition at line 322 of file image.cpp.

References ImageFormat::getName(), and mImgFrmt.

Here is the call graph for this function:

void Image::getLL ( double &  x,
double &  y 
)

The values of x and y, assumed to be in XY coordinates, are modified to the corresponding latitude and longitude.

Parameters:
[in,out] x The X coordinate of a point in the image. When the function returns, x holds the longitude corresponding to the input XY location.
[in,out] y The Y coordinate of a point in the image. When the function returns, y holds the latitude corresponding to the input XY location.

Definition at line 362 of file image.cpp.

References ImageFormat::getLL(), mImgFrmt, ImageState::mRed, and mState.

Referenced by GLIMSLineData::addLine(), GLIMSGIDData::addNode(), GLIMSProject::exportGLIMSIngest(), GLIMSLineData::insertLineNode(), View::mouseMoveEvent(), GLIMSLineData::moveLineNode(), GLIMSGIDData::moveNode(), GLIMSLineData::reinsertLineNode(), GLIMSLineData::rejoinLine(), GLIMSLineData::restoreJoinedLines(), GLIMSLineData::restoreLine(), GLIMSLineData::restoreMovedLineNode(), and GLIMSDataset::toXML().

Here is the call graph for this function:

void Image::getXY ( double &  x,
double &  y 
)

The values of x and y, assumed to be latitude-longitude coordinates, are modified to the corresponding XY coordinates.

Parameters:
[in,out] x The longitude coordinate of a point in the image. When the function returns, x holds the X coordinate corresponding to the input lat-lon location.
[in,out] y The latitude coordinate of a point in the image. When the function returns, y holds the Y coordinate corresponding to the input lat-lon location.

Definition at line 366 of file image.cpp.

References ImageFormat::getXY(), mImgFrmt, ImageState::mRed, and mState.

Referenced by GLIMSGIDData::addGID(), GLIMSLineData::addLineLL(), GLIMSLineData::addLineNodeLL(), GLIMSLineData::toXY(), and VectorData::transformDataset().

Here is the call graph for this function:

const ImageInf& Image::getImageInf (  )  [inline]

Definition at line 129 of file image.h.

Referenced by GLIMSDataset::GLIMSDataset().

void Image::setCornerPnts ( int  iband,
ImageInf inf 
) [inline]

Definition at line 133 of file image.h.

Referenced by GLIMSProject::exportGLIMSIngest(), and GLIMSDataset::toXML().

void Image::setCornerPnts ( ImageInf inf  )  [inline]

Definition at line 139 of file image.h.

ImageState Image::getImageState (  )  [inline]

void Image::setImageState ( ImageState state  )  [inline]

Definition at line 146 of file image.h.

Referenced by openImage().

void Image::setBandSel ( ImageState state  )  [inline]

Definition at line 152 of file image.h.

References ImageState::mBlue, ImageState::mGreen, and ImageState::mRed.

Referenced by GLIMSProject::fromXML(), and BandChooserDlg::loadBands().

void Image::setMemBuf ( bool  state  ) 

Definition at line 370 of file image.cpp.

References InMemFormat::getFormat(), mImgFrmt, mMemFrmt, and mState.

Referenced by MainToolbar::setMemBuf().

Here is the call graph for this function:

ImageFormat* Image::getFormat (  )  [inline]

Definition at line 163 of file image.h.


Member Data Documentation

std::string Image::MFF_NAMES [static]

Initial value:

 {
"Landsat 7 Geotiff",
"Landsat 7 NLAPS",
"Landsat 7 FastL7A"
}

Definition at line 51 of file image.h.

Referenced by ImageDlg::ImageDlg(), and ProjectDlg::ProjectDlg().

int Image::NUM_MFF = 3 [static]

Definition at line 52 of file image.h.

Referenced by ImageDlg::ImageDlg(), and ProjectDlg::ProjectDlg().

Definition at line 55 of file image.h.

Referenced by getBandInfSet(), getLL(), getName(), getRect(), getXY(), height(), setMemBuf(), width(), and ~Image().

int Image::mWidth [protected]

Definition at line 56 of file image.h.

Referenced by Image().

int Image::mHeight [protected]

Definition at line 57 of file image.h.

Referenced by Image().

Definition at line 58 of file image.h.

Referenced by getLL(), getRect(), getXY(), height(), Image(), setMemBuf(), and width().

Definition at line 59 of file image.h.

Referenced by Image(), setMemBuf(), and ~Image().


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

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