#include <imageformat.h>
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]
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 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 | |
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< BandInf > | mBandSet |
ImageInf | mImageInf |
Private Attributes | |
char * | mParms [15] |
Classes | |
struct | BandInf |
Structure to hold metadata about the bands in the image. More... |
Definition at line 45 of file imageformat.h.
ImageFormat::ImageFormat | ( | ) |
Definition at line 5 of file imageformat.cpp.
ImageFormat::~ImageFormat | ( | ) | [virtual] |
Definition at line 9 of file imageformat.cpp.
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().
void ImageFormat::xyToMeter | ( | int | iband, | |
double & | x, | |||
double & | y | |||
) | [protected] |
Definition at line 493 of file imageformat.cpp.
References M_PI, mBandSet, ImageFormat::BandInf::proj, ImageFormat::BandInf::res, ImageFormat::BandInf::rot, ImageFormat::BandInf::ulx, and ImageFormat::BandInf::uly.
Referenced by xyToLL().
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().
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().
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().
projPJ ImageFormat::createProj | ( | int | iband | ) | [protected] |
Definition at line 629 of file imageformat.cpp.
References mBandSet, mParms, ImageFormat::BandInf::parms, ImageFormat::BandInf::proj, and ImageFormat::BandInf::UTMZ.
Referenced by llToMeter(), and meterToLL().
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().
virtual bool ImageFormat::open | ( | std::string | fname | ) | [pure virtual] |
Implemented in GDALFrmt, HdfEosFrmt, InMemFormat, L7A_Fast, L7A_Geotiff, L7A_Nlaps, and NlapsFrmt.
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] |
Implemented in GDALFrmt, HdfEosFrmt, InMemFormat, L7A_Fast, L7A_Geotiff, L7A_Nlaps, and NlapsFrmt.
Referenced by InMemFormat::getBand(), ImageInterface::getCubeLatLong(), Image::getRect(), and InMemFormat::stateToMem().
virtual void ImageFormat::getLL | ( | int | iband, | |
double & | i, | |||
double & | j | |||
) | [pure virtual] |
Implemented in GDALFrmt, HdfEosFrmt, InMemFormat, L7A_Fast, L7A_Geotiff, L7A_Nlaps, and NlapsFrmt.
Referenced by ImageInterface::getCube(), Image::getLL(), ImageInterface::getLL(), ImageInterface::getSliceScaled(), and setCornerPnts().
virtual void ImageFormat::getXY | ( | int | iband, | |
double & | i, | |||
double & | j | |||
) | [pure virtual] |
Implemented in GDALFrmt, HdfEosFrmt, InMemFormat, L7A_Fast, L7A_Geotiff, L7A_Nlaps, and NlapsFrmt.
Referenced by ImageInterface::getCube(), ImageInterface::getCubeLatLong(), ImageInterface::getSliceScaled(), Image::getXY(), and ImageInterface::getXY().
std::vector< ImageFormat::BandInf > & ImageFormat::getBandInfSet | ( | ) |
Definition at line 20 of file imageformat.cpp.
References mBandSet.
Referenced by Image::getBandInfSet(), Image::getRect(), Image::height(), Image::Image(), InMemFormat::InMemFormat(), L7A_Nlaps::open(), L7A_Fast::open(), InMemFormat::stateToMem(), and Image::width().
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] |
Definition at line 92 of file imageformat.cpp.
References FLOAT16, FLOAT32, FLOAT64, INT16, INT32, INT64, INT8, NOT_DEFINED, UINT16, UINT32, UINT64, and UINT8.
Referenced by NlapsFrmt::getBand(), HdfEosFrmt::getBand(), and InMemFormat::stateToMem().
bool ImageFormat::isFloat | ( | ImageFormat::DataType | dt | ) | [static] |
char * ImageFormat::scaleData | ( | char ** | orig, | |
int | ow, | |||
int | oh, | |||
int | nw, | |||
int | nh, | |||
DataType | dt, | |||
ScaleType | st, | |||
bool | del = true | |||
) | const |
Definition at line 198 of file imageformat.cpp.
Referenced by NlapsFrmt::getBand(), HdfEosFrmt::getBand(), and InMemFormat::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 |
Definition at line 209 of file imageformat.cpp.
References FLOAT32, FLOAT64, INT16, INT8, SCALE_BI, SCALE_NN, scl_bilinear(), scl_nearestneighbor(), UINT16, and 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] |
DType * ImageFormat::scl_nearestneighbor | ( | DType * | orig, | |
int | ox, | |||
int | oy, | |||
int | ow, | |||
int | oh, | |||
int | fw, | |||
int | fh, | |||
int | nw, | |||
int | nh | |||
) | const [inline] |
DType * ImageFormat::scl_bilinear | ( | DType * | orig, | |
int | ox, | |||
int | oy, | |||
int | ow, | |||
int | oh, | |||
int | fw, | |||
int | fh, | |||
int | nw, | |||
int | nh | |||
) | const [inline] |
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.
char* ImageFormat::mParms[15] [private] |
std::string ImageFormat::mFName [protected] |
Definition at line 86 of file imageformat.h.
Referenced by NlapsFrmt::getBand(), HdfEosFrmt::getBandMetaData(), getName(), NlapsFrmt::open(), HdfEosFrmt::open(), GDALFrmt::open(), and NlapsFrmt::readFile().
std::vector<BandInf> ImageFormat::mBandSet [protected] |
Definition at line 87 of file imageformat.h.
Referenced by createProj(), NlapsFrmt::fillBandInf(), NlapsFrmt::fillImageInf(), NlapsFrmt::getBand(), L7A_Nlaps::getBand(), L7A_Geotiff::getBand(), L7A_Fast::getBand(), HdfEosFrmt::getBand(), GDALFrmt::getBand(), getBandInf(), getBandInfSet(), HdfEosFrmt::getBandMetaData(), L7A_Nlaps::getFrmt(), L7A_Fast::getFrmt(), L7A_Nlaps::getLL(), L7A_Geotiff::getLL(), L7A_Fast::getLL(), HdfEosFrmt::getLL(), getULCorners(), L7A_Nlaps::getXY(), L7A_Geotiff::getXY(), L7A_Fast::getXY(), HdfEosFrmt::getXY(), llToMeter(), llToXY(), meterToLL(), L7A_Nlaps::open(), L7A_Geotiff::open(), L7A_Fast::open(), HdfEosFrmt::open(), GDALFrmt::open(), setCornerPnts(), xyToLL(), and xyToMeter().
ImageInf ImageFormat::mImageInf [protected] |
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 |