#include <inmemformat.h>
Instead it holds a file based ImageFormat and masks its I/O routines with its own. At all times, the selected bands of an image will be held in memory instead of the usual file buffering that is done. This allows for faster access and display. The Image class uses this a little different then normal ImageFormat's.
Definition at line 24 of file inmemformat.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 | |
InMemFormat (ImageFormat *frmt, ImageState *imgstate) | |
~InMemFormat () | |
void | stateToMem () |
virtual bool | open (std::string) |
virtual void * | getBand (int iband, int x1, int y1, int w1, int h1, int w2, int h2, ScaleType st=SCALE_BI) const |
virtual void | getLL (int iband, double &i, double &j) |
virtual void | getXY (int iband, double &i, double &j) |
ImageFormat * | getFormat () |
std::vector< BandInf > & | getBandInfSet () |
unsigned int | getNumBands () |
const BandInf & | getBandInf (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 |
ImageInf & | getImageInf () |
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 | |
bool | inMemSet (int iband) |
char * | getMemRect (int iband, int x, int y, int w, int h, int ow, int oh, ScaleType st) const |
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 | |
ImageFormat * | mEmulateFormat |
ImageState * | mImgState |
std::vector< MemBandInf > | mMemBandSet |
std::string | mFName |
std::vector< BandInf > | mBandSet |
ImageInf | mImageInf |
Classes | |
struct | MemBandInf |
Structure to metadata about the bands in an image. More... |
enum ImageFormat::ScaleType [inherited] |
enum ImageFormat::DataType [inherited] |
Definition at line 45 of file imageformat.h.
InMemFormat::InMemFormat | ( | ImageFormat * | frmt, | |
ImageState * | imgstate | |||
) | [inline] |
Definition at line 56 of file inmemformat.h.
References ImageFormat::getBandInfSet().
InMemFormat::~InMemFormat | ( | ) | [inline] |
Definition at line 63 of file inmemformat.h.
bool InMemFormat::inMemSet | ( | int | iband | ) | [inline, protected] |
char * InMemFormat::getMemRect | ( | int | iband, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h, | |||
int | ow, | |||
int | oh, | |||
ScaleType | st | |||
) | const [protected] |
Definition at line 4 of file inmemformat.cpp.
References mMemBandSet, and ImageFormat::scaleData().
Referenced by getBand().
void InMemFormat::stateToMem | ( | ) |
Definition at line 22 of file inmemformat.cpp.
References InMemFormat::MemBandInf::data, InMemFormat::MemBandInf::dtype, ImageFormat::dtypeSize(), ImageFormat::getBand(), ImageFormat::getBandInfSet(), InMemFormat::MemBandInf::height, InMemFormat::MemBandInf::iband, inMemSet(), ImageState::mBlue, mEmulateFormat, ImageState::mGreen, mImgState, mMemBandSet, ImageState::mRed, InMemFormat::MemBandInf::sz_dtype, and InMemFormat::MemBandInf::width.
virtual bool InMemFormat::open | ( | std::string | ) | [inline, virtual] |
void * InMemFormat::getBand | ( | int | iband, | |
int | x1, | |||
int | y1, | |||
int | w1, | |||
int | h1, | |||
int | w2, | |||
int | h2, | |||
ScaleType | st = SCALE_BI | |||
) | const [virtual] |
Implements ImageFormat.
Definition at line 89 of file inmemformat.cpp.
References ImageFormat::getBand(), getMemRect(), mEmulateFormat, and mMemBandSet.
virtual void InMemFormat::getLL | ( | int | iband, | |
double & | i, | |||
double & | j | |||
) | [inline, virtual] |
virtual void InMemFormat::getXY | ( | int | iband, | |
double & | i, | |||
double & | j | |||
) | [inline, virtual] |
ImageFormat* InMemFormat::getFormat | ( | ) | [inline] |
void ImageFormat::xyToLL | ( | int | iband, | |
double & | x, | |||
double & | y | |||
) | [protected, inherited] |
Definition at line 618 of file imageformat.cpp.
References ImageFormat::mBandSet, ImageFormat::meterToLL(), and ImageFormat::xyToMeter().
Referenced by NlapsFrmt::fillImageInf(), NlapsFrmt::getLL(), and HdfEosFrmt::getLL().
void ImageFormat::xyToMeter | ( | int | iband, | |
double & | x, | |||
double & | y | |||
) | [protected, inherited] |
Definition at line 493 of file imageformat.cpp.
References M_PI, ImageFormat::mBandSet, ImageFormat::BandInf::proj, ImageFormat::BandInf::res, ImageFormat::BandInf::rot, ImageFormat::BandInf::ulx, and ImageFormat::BandInf::uly.
Referenced by ImageFormat::xyToLL().
void ImageFormat::meterToLL | ( | int | iband, | |
double & | x, | |||
double & | y | |||
) | [protected, inherited] |
Definition at line 533 of file imageformat.cpp.
References ImageFormat::createProj(), and ImageFormat::mBandSet.
Referenced by ImageFormat::xyToLL().
void ImageFormat::llToMeter | ( | int | iband, | |
double & | lon, | |||
double & | lat | |||
) | [protected, inherited] |
Definition at line 550 of file imageformat.cpp.
References ImageFormat::createProj(), and ImageFormat::mBandSet.
Referenced by ImageFormat::getULCorners(), and ImageFormat::llToXY().
void ImageFormat::llToXY | ( | int | iband, | |
double & | lon, | |||
double & | lat | |||
) | [protected, inherited] |
Definition at line 568 of file imageformat.cpp.
References ImageFormat::llToMeter(), M_PI, and ImageFormat::mBandSet.
Referenced by NlapsFrmt::getXY(), and HdfEosFrmt::getXY().
projPJ ImageFormat::createProj | ( | int | iband | ) | [protected, inherited] |
Definition at line 629 of file imageformat.cpp.
References ImageFormat::mBandSet, ImageFormat::mParms, ImageFormat::BandInf::parms, ImageFormat::BandInf::proj, and ImageFormat::BandInf::UTMZ.
Referenced by ImageFormat::llToMeter(), and ImageFormat::meterToLL().
void ImageFormat::getULCorners | ( | ) | [protected, inherited] |
Definition at line 663 of file imageformat.cpp.
References ImageFormat::llToMeter(), ImageFormat::mBandSet, ImageFormat::BandInf::proj, ImageFormat::BandInf::ulx, and ImageFormat::BandInf::uly.
Referenced by NlapsFrmt::fillBandInf(), and HdfEosFrmt::open().
std::vector< ImageFormat::BandInf > & ImageFormat::getBandInfSet | ( | ) | [inherited] |
Definition at line 20 of file imageformat.cpp.
References ImageFormat::mBandSet.
Referenced by Image::getBandInfSet(), Image::getRect(), Image::height(), Image::Image(), InMemFormat(), L7A_Nlaps::open(), L7A_Fast::open(), stateToMem(), and Image::width().
unsigned int ImageFormat::getNumBands | ( | ) | [inline, inherited] |
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 | ) | [inherited] |
Definition at line 24 of file imageformat.cpp.
References ImageFormat::mBandSet.
Referenced by L7A_Geotiff::open().
std::string ImageFormat::getName | ( | ) | const [inherited] |
Definition at line 28 of file imageformat.cpp.
References ImageFormat::mFName.
Referenced by HdfEosFrmt::getBandMetaData(), and Image::getName().
std::string ImageFormat::dtypeToString | ( | ImageFormat::DataType | dt | ) | [static, inherited] |
Definition at line 32 of file imageformat.cpp.
References ImageFormat::FLOAT16, ImageFormat::FLOAT32, ImageFormat::FLOAT64, ImageFormat::INT16, ImageFormat::INT32, ImageFormat::INT64, ImageFormat::INT8, ImageFormat::NOT_DEFINED, ImageFormat::UINT16, ImageFormat::UINT32, ImageFormat::UINT64, and ImageFormat::UINT8.
Referenced by BandChooserDlg::reloadList().
int ImageFormat::dtypeSize | ( | ImageFormat::DataType | dt | ) | [static, inherited] |
Definition at line 92 of file imageformat.cpp.
References ImageFormat::FLOAT16, ImageFormat::FLOAT32, ImageFormat::FLOAT64, ImageFormat::INT16, ImageFormat::INT32, ImageFormat::INT64, ImageFormat::INT8, ImageFormat::NOT_DEFINED, ImageFormat::UINT16, ImageFormat::UINT32, ImageFormat::UINT64, and ImageFormat::UINT8.
Referenced by NlapsFrmt::getBand(), HdfEosFrmt::getBand(), and stateToMem().
bool ImageFormat::isFloat | ( | ImageFormat::DataType | dt | ) | [static, inherited] |
Definition at line 152 of file imageformat.cpp.
References ImageFormat::INT16, ImageFormat::INT32, ImageFormat::INT64, ImageFormat::INT8, ImageFormat::NOT_DEFINED, ImageFormat::UINT16, ImageFormat::UINT32, ImageFormat::UINT64, and ImageFormat::UINT8.
char * ImageFormat::scaleData | ( | char ** | orig, | |
int | ow, | |||
int | oh, | |||
int | nw, | |||
int | nh, | |||
DataType | dt, | |||
ScaleType | st, | |||
bool | del = true | |||
) | const [inherited] |
Definition at line 198 of file imageformat.cpp.
Referenced by NlapsFrmt::getBand(), HdfEosFrmt::getBand(), and getMemRect().
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 [inherited] |
Definition at line 209 of file imageformat.cpp.
References ImageFormat::FLOAT32, ImageFormat::FLOAT64, ImageFormat::INT16, ImageFormat::INT8, ImageFormat::SCALE_BI, ImageFormat::SCALE_NN, ImageFormat::scl_bilinear(), ImageFormat::scl_nearestneighbor(), ImageFormat::UINT16, and ImageFormat::UINT8.
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, inherited] |
Definition at line 322 of file imageformat.cpp.
References ImageFormat::SCALE_BC, ImageFormat::SCALE_BI, and ImageFormat::SCALE_NN.
DType * ImageFormat::scl_nearestneighbor | ( | DType * | orig, | |
int | ox, | |||
int | oy, | |||
int | ow, | |||
int | oh, | |||
int | fw, | |||
int | fh, | |||
int | nw, | |||
int | nh | |||
) | const [inline, inherited] |
DType * ImageFormat::scl_bilinear | ( | DType * | orig, | |
int | ox, | |||
int | oy, | |||
int | ow, | |||
int | oh, | |||
int | fw, | |||
int | fh, | |||
int | nw, | |||
int | nh | |||
) | const [inline, inherited] |
unsigned char * ImageFormat::scl_bicubic | ( | unsigned char * | orig, | |
int | ow, | |||
int | oh, | |||
int | nw, | |||
int | nh, | |||
int | szd | |||
) | const [inherited] |
Definition at line 454 of file imageformat.cpp.
ImageInf& ImageFormat::getImageInf | ( | ) | [inline, inherited] |
Definition at line 197 of file imageformat.h.
void ImageFormat::setCornerPnts | ( | int | iband, | |
ImageInf & | inf | |||
) | [inherited] |
Definition at line 463 of file imageformat.cpp.
References ImageFormat::getLL(), ImageFormat::mBandSet, ImageInf::mP1, ImageInf::mP2, ImageInf::mP3, ImageInf::mP4, Node::x, Node::y, and Node::z.
ImageFormat* InMemFormat::mEmulateFormat [protected] |
ImageState* InMemFormat::mImgState [protected] |
std::vector<MemBandInf> InMemFormat::mMemBandSet [protected] |
Definition at line 42 of file inmemformat.h.
Referenced by getBand(), getMemRect(), and stateToMem().
std::string ImageFormat::mFName [protected, inherited] |
Definition at line 86 of file imageformat.h.
Referenced by NlapsFrmt::getBand(), HdfEosFrmt::getBandMetaData(), ImageFormat::getName(), NlapsFrmt::open(), HdfEosFrmt::open(), GDALFrmt::open(), and NlapsFrmt::readFile().
std::vector<BandInf> ImageFormat::mBandSet [protected, inherited] |
Definition at line 87 of file imageformat.h.
Referenced by ImageFormat::createProj(), NlapsFrmt::fillBandInf(), NlapsFrmt::fillImageInf(), NlapsFrmt::getBand(), L7A_Nlaps::getBand(), L7A_Geotiff::getBand(), L7A_Fast::getBand(), HdfEosFrmt::getBand(), GDALFrmt::getBand(), ImageFormat::getBandInf(), ImageFormat::getBandInfSet(), HdfEosFrmt::getBandMetaData(), L7A_Nlaps::getFrmt(), L7A_Fast::getFrmt(), L7A_Nlaps::getLL(), L7A_Geotiff::getLL(), L7A_Fast::getLL(), HdfEosFrmt::getLL(), ImageFormat::getULCorners(), L7A_Nlaps::getXY(), L7A_Geotiff::getXY(), L7A_Fast::getXY(), HdfEosFrmt::getXY(), ImageFormat::llToMeter(), ImageFormat::llToXY(), ImageFormat::meterToLL(), L7A_Nlaps::open(), L7A_Geotiff::open(), L7A_Fast::open(), HdfEosFrmt::open(), GDALFrmt::open(), ImageFormat::setCornerPnts(), ImageFormat::xyToLL(), and ImageFormat::xyToMeter().
ImageInf ImageFormat::mImageInf [protected, inherited] |
Definition at line 88 of file imageformat.h.
Referenced by NlapsFrmt::fillImageInf(), L7A_Nlaps::open(), L7A_Geotiff::open(), L7A_Fast::open(), HdfEosFrmt::open(), and GDALFrmt::open().
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |