#include <image.h>
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]
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 ImageInf & | getImageInf () |
void | setCornerPnts (int iband, ImageInf &inf) |
void | setCornerPnts (ImageInf &inf) |
ImageState | getImageState () |
void | setImageState (ImageState &state) |
void | setBandSel (ImageState &state) |
void | setMemBuf (bool state) |
ImageFormat * | getFormat () |
Static Public Member Functions | |
static Image * | openImage (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 | |
ImageFormat * | mImgFrmt |
int | mWidth |
int | mHeight |
ImageState | mState |
InMemFormat * | mMemFrmt |
enum Image::MultiFileType |
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().
unsigned char * Image::scaleToUC | ( | DType * | data, | |
double | min, | |||
double | max, | |||
int | len | |||
) | [inline, protected] |
void Image::makeRGBA | ( | unsigned char * | imbits, | |
unsigned char * | rData, | |||
unsigned char * | gData, | |||
unsigned char * | bData, | |||
int | newWidth, | |||
int | newHeight | |||
) | [protected] |
Image * Image::openImage | ( | std::string | fname, | |
MultiFileType | type = GENERIC | |||
) | [static] |
Definition at line 52 of file image.cpp.
References Image(), LSAT7_FASTL7A, LSAT7_GEOTIFF, LSAT7_NLAPS, ImageState::mFileName, ImageState::mType, NlapsFrmt::open(), HdfEosFrmt::open(), GDALFrmt::open(), L7A_Nlaps::open(), L7A_Geotiff::open(), and setImageState().
Referenced by GLIMSProject::create(), GLIMSProject::fromXML(), and GLIMSProject::importGLIMSIngestImageInfo().
QImage * Image::getRect | ( | int | x1, | |
int | y1, | |||
int | w1, | |||
int | h1, | |||
int | w2, | |||
int | h2, | |||
ImageFormat::ScaleType | st = ImageFormat::SCALE_BI | |||
) |
Definition at line 115 of file image.cpp.
References ImageFormat::getBand(), ImageFormat::getBandInfSet(), height(), ImageFormat::INT16, ImageFormat::INT8, makeRGBA(), ImageState::mBlue, ImageState::mGreen, mImgFrmt, ImageState::mRed, mState, scaleToUC(), ImageFormat::UINT16, ImageFormat::UINT8, and width().
Referenced by ImageInterface::getQImage(), ImageInterface::getQImageArea(), and View::paintEvent().
int Image::width | ( | ) |
Definition at line 265 of file image.cpp.
References ImageFormat::getBandInfSet(), ImageState::mBlue, ImageState::mGreen, mImgFrmt, ImageState::mRed, and mState.
Referenced by View::calcDims(), GLIMSProject::exportGLIMSIngest(), getRect(), ImageInterface::getWidth(), Image(), View::paintEvent(), GLIMSDataset::toXML(), and width().
int Image::height | ( | ) |
Definition at line 280 of file image.cpp.
References ImageFormat::getBandInfSet(), ImageState::mBlue, ImageState::mGreen, mImgFrmt, ImageState::mRed, and mState.
Referenced by View::calcDims(), GLIMSProject::exportGLIMSIngest(), ImageInterface::getHeight(), getRect(), height(), Image(), View::paintEvent(), and GLIMSDataset::toXML().
int Image::width | ( | int | iband | ) |
Definition at line 295 of file image.cpp.
References ImageFormat::getBandInfSet(), mImgFrmt, and width().
int Image::height | ( | int | iband | ) |
Definition at line 306 of file image.cpp.
References ImageFormat::getBandInfSet(), height(), and mImgFrmt.
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().
std::string Image::getName | ( | ) | const |
Definition at line 322 of file image.cpp.
References ImageFormat::getName(), and mImgFrmt.
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.
[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().
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.
[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().
const ImageInf& Image::getImageInf | ( | ) | [inline] |
void Image::setCornerPnts | ( | int | iband, | |
ImageInf & | inf | |||
) | [inline] |
Definition at line 133 of file image.h.
Referenced by GLIMSProject::exportGLIMSIngest(), and GLIMSDataset::toXML().
ImageState Image::getImageState | ( | ) | [inline] |
Definition at line 143 of file image.h.
Referenced by View::getHistSet(), View::paintEvent(), MainToolbar::setupProj(), and GLIMSProject::toXML().
void Image::setImageState | ( | ImageState & | state | ) | [inline] |
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().
ImageFormat* Image::getFormat | ( | ) | [inline] |
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().
ImageFormat* Image::mImgFrmt [protected] |
int Image::mWidth [protected] |
int Image::mHeight [protected] |
ImageState Image::mState [protected] |
InMemFormat* Image::mMemFrmt [protected] |
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |