|
WXP C++ Library Version 6.74.9
|
This class defines an image. More...
#include "../include/Image.h"
Public Types | |
| enum | Query { ALL , INQ } |
| enum | Type { UNK , IMG , GINI , AREA } |
| enum | ByteOrder { LSB , MSB } |
| enum | ColorType { TRUECOL , INDEX , VALUE } |
Public Member Functions | |
| int | initClass () |
| int | init () |
| Image () | |
| Image (const Image &image) | |
| ~Image () | |
| int | copy (Image &image) |
| int | copyInfo (Image &image) |
| int | copyData (Image &image) |
| Image | operator= (const Image &image) |
| int | set (int rwidth, int rheight, int rdepth) |
| int | set (Domain &rdomain, int rdepth) |
| int | set (DomainVal &rdv, int rdepth) |
| int | allocData () |
| int | clearData () |
| bool | validData () |
| int | allocColors (int num) |
| int | hasColors () |
| int | setSource (int val) |
| int | setType (int val) |
| int | setDate (int secs) |
| int | setDate (DateVal &dv) |
| int | setDate (Date &d) |
| int | getDate (Date &rdate) |
| Date | getDate () |
| int | setDatim (const char *str) |
| int | setDatim (String &str) |
| char * | getDatim () |
| int | setInfo (const char *str) |
| int | setInfo (String &str) |
| char * | getInfo () |
| int | setDomain (DomainVal &val) |
| int | setDomain (Domain &dom) |
| int | getDomainProj () |
| Domain | getDomain () |
| int | getDomain (Domain &dom) |
| DomainVal | getDomainVal () |
| float | getPLat () |
| float | getPLon () |
| int | getWidth () |
| int | getHeight () |
| int | getDepth () |
| int | getBytes () |
| int | getBytesLine () |
| int | getColorType () |
| int | getNumColors () |
| float | getRed (int ind) |
| float | getGrn (int ind) |
| float | getBlu (int ind) |
| int | setWidth (int val) |
| int | setHeight (int val) |
| int | setDepth (int val) |
| int | setBitsPixel (int val) |
| int | setBytesLine (int val) |
| int | setBytesLine () |
| int | setColorType (int val) |
| int | setByteOrder (int val) |
| int | setRedMask (unsigned long) |
| unsigned int | getRedMask () |
| int | setGrnMask (unsigned long) |
| unsigned int | getGrnMask () |
| int | setBluMask (unsigned long) |
| unsigned int | getBluMask () |
| int | setRed (int ind, float val) |
| int | setGrn (int ind, float val) |
| int | setBlu (int ind, float val) |
| int | setColor (int ind, float r, float g, float b) |
| int | setColor (int ind, RGB &rgb) |
| int | setRGB (int ind, RGB &rgb) |
| int | getRGB (int ind, RGB &rgb) |
| int | setTransColor (int clr) |
| bool | hasTransColor () |
| int | getTransColor () |
| int | setColorVal (int ind, int val) |
| int | getColorVal (int ind) |
| int | setPixAve (bool val) |
| int | setCutBase (int val) |
| int | setCutoff (int ind, int val) |
| int | setCutoff (char *str) |
| bool | hasCutoff () |
| int | getCutBase () |
| int | getCutoff (int i) |
| int | getNumCut () |
| int | print () |
| int | printInt () |
| int | printValues () |
| int | printColors () |
| int | printHist () |
| int | printData (EarthPoint &ept) |
| int | getPixel (int x, int y) |
| int | getVal (int x, int y) |
| bool | isPixelTrans (int x, int y) |
| int | getRGB (int x, int y, RGB &rgb) |
| int | getRow (int row, unsigned char *odata) |
| const unsigned char * | getData () |
| int | getPixel (float x, float y) |
| int | getPixel (GridPoint gpt) |
| int | getPixel (EarthPoint ept) |
| int | getPixel (Point pt) |
| int | allocValues () |
| bool | hasValues () |
| int | setValue (int ind, float val) |
| int | setValues (FloatArray &array) |
| float | getValue (int ind) |
| int | getIndex (float val) |
| float | getValue (int x, int y) |
| float | getValue (float x, float y) |
| float | getValue (Point &pt) |
| float | getValue (GridPoint &gpt) |
| float | getValue (EarthPoint &ept) |
| int | getVal (EarthPoint &ept) |
| int | setPixel (int x, int y, int val) |
| int | setPixel (int val) |
| int | setPixel (GridPoint gpt, int val) |
| int | setValue (int x, int y, float val) |
| Rect | getLimits () |
| int | getProj () |
| int | tran (EarthPoint ept, Point &pt) |
| int | tran (Point pt, EarthPoint &ept) |
| int | tran (GridPoint gpt, Point &pt) |
| int | tran (Point pt, GridPoint &gpt) |
| int | tran (EarthPoint ept, GridPoint &gpt) |
| int | tran (GridPoint gpt, EarthPoint &ept) |
| float | getDx () |
Static Public Member Functions | |
| static int | copyInfo (Image &image1, const Image &image2) |
| static int | copyData (Image &image1, const Image &image2) |
| static int | copy (Image &image1, const Image &image2) |
Friends | |
| class | ImageMath |
This class defines an image.
| Image::Image | ( | ) |
Constructor. Initializes class values
References init().
| Image::Image | ( | const Image & | image | ) |
Copy constructor for the image class
| image | Image class to copy from |
| Image::~Image | ( | ) |
Destructor. Frees allocated data
| int Image::allocColors | ( | int | num | ) |
Allocates the color table for the image
| num | Number of colors in color table |
Referenced by WXP::ImageTool::addColor(), WXP::GifFile::read(), WXP::LZWComp::read(), WXP::PngFile::read(), WXP::ImageMath::toGray(), WXP::ImageMath::toIndex(), and WXP::ImageMath::toIndex().
| int Image::allocData | ( | ) |
Allocates the data for the image
Referenced by WXP::NidsImage::addSite(), WXP::MdrImage::addSite(), WXP::ImageMath::clip(), WXP::XWindow::getImage(), WXP::GifFile::read(), WXP::KavradFile::read(), WXP::LritFile::read(), WXP::LZWComp::read(), WXP::NowradFile::read(), WXP::PngFile::read(), WXP::TiffFile::read(), WXP::GiniFile::readData(), WXP::SatCdfFile::readData(), WXP::SatUniFile::readData(), WXP::AreaFile::readData(), WXP::ImgWxpFile::readData(), WXP::ImageMath::remap(), WXP::ImageMath::scale(), WXP::ImagePiece::set(), WXP::NidsImage::setImage(), WXP::ImageMath::toGray(), WXP::ImageMath::toIndex(), WXP::ImageMath::toIndex(), and WXP::ImageMath::toTrueColor().
| int Image::clearData | ( | ) |
Resets all values back to 0
| float Image::getDx | ( | ) |
Gets the X grid/pixel spacing of the image
References WXP::Domain::getDx().
Referenced by WXP::NidsImage::addSite(), and WXP::NidsImage::setImage().
| Rect Image::getLimits | ( | ) |
Gets the domain limits (domain space) of the image
References WXP::Domain::getLimits().
Referenced by WXP::ImageMath::merge(), WXP::ImageMath::remap(), and WXP::ImageMath::scale().
| int Image::getPixel | ( | float | x, |
| float | y | ||
| ) |
Gets the pixel value at a location in the image. Will interpolate between pixel locations.
| x | The X location |
| y | The Y location |
References hasColors().
| int Image::getPixel | ( | GridPoint | gpt | ) |
Gets the pixel value at a location in the image. Will interpolate between pixel locations.
| gpt | GridPoint location |
References getPixel().
| int Image::getPixel | ( | int | x, |
| int | y | ||
| ) |
Gets a pixel color value from the image
| x | X location of pixel |
| y | Y location of pixel |
References WXP::ImageColor::val.
Referenced by WXP::ImagePiece::add(), WXP::ImagePiece::add(), WXP::NidsImage::addSite(), WXP::MdrImage::addSite(), WXP::ImagePlot::callback(), WXP::SatPlot::callback(), WXP::ImageMath::clip(), WXP::XWindow::drawImage(), WXP::XWindow::drawImage(), getPixel(), WXP::ImageMath::merge(), WXP::SatUniFile::readData(), WXP::ImageMath::remap(), WXP::ImageMath::scale(), WXP::NidsImage::setImage(), WXP::ImageMath::toTrueColor(), WXP::ImgWxpFile::write(), and WXP::PngFile::write().
| int Image::getRGB | ( | int | x, |
| int | y, | ||
| RGB & | rgb | ||
| ) |
Gets the RGB values at a specific location
| x | The X location |
| y | The Y location |
| rgb | The output RGB class |
References WXP::ImageColor::b, WXP::RGB::blu, WXP::ImageColor::g, getVal(), WXP::RGB::grn, WXP::ImageColor::r, and WXP::RGB::red.
| int Image::getRow | ( | int | row, |
| unsigned char * | odata | ||
| ) |
Gets a row of pixel data from the image
| row | Row of image to get data from |
| odata | Buffer to put data into (preallocated) |
Referenced by WXP::PngFile::write().
| int Image::getVal | ( | int | x, |
| int | y | ||
| ) |
Gets the raw pixel value at a specific location (integral, exact location)
| x | The X location |
| y | The Y location |
Referenced by WXP::NidsImage::applyMask(), WXP::ImageMath::compressColor(), WXP::MdrPlot::draw(), getRGB(), WXP::ImageMath::toTrueColor(), WXP::GifFile::write(), and WXP::LZWComp::write().
|
inline |
Returns if image has colormap with it
Referenced by WXP::ImageTool::addColor(), and getPixel().
| int Image::init | ( | ) |
Initializes class values
References WXP::Date::init(), WXP::Domain::init(), and WXP::Const::MISS.
Referenced by WXP::SatFile::getHeader(), WXP::XWindow::getImage(), Image(), WXP::SatFile::read(), WXP::GifFile::read(), WXP::KavradFile::read(), WXP::LritFile::read(), WXP::LZWComp::read(), WXP::NowradFile::read(), WXP::TiffFile::read(), WXP::SatCdfFile::readHeader(), WXP::SatUniFile::readHeader(), WXP::AreaFile::readHeader(), WXP::ImgWxpFile::readHeader(), WXP::RcmDecode::setup(), WXP::ImageMath::toGray(), WXP::ImageMath::toIndex(), WXP::ImageMath::toIndex(), and WXP::ImageMath::toTrueColor().
Assignment operator. Used to overload copying
| strings | String class to copy from |
| int Image::print | ( | ) |
Prints image values to standard output
References WXP::Const::MISS, WXP::Date::print(), and WXP::Domain::print().
Referenced by WXP::RcmPlot::draw().
| int Image::set | ( | Domain & | rdomain, |
| int | rdepth | ||
| ) |
Sets basic image parameters
| rdomain | Domain of image (sets size from nx, ny domain parameters) |
| rdepth | Bit depth of image |
References WXP::Domain::get(), WXP::DomainVal::nx, and WXP::DomainVal::ny.
| int Image::set | ( | DomainVal & | rdv, |
| int | rdepth | ||
| ) |
Sets basic image parameters
| rdv | Domain of image (sets size from nx, ny domain parameters) |
| rdepth | Bit depth of image |
References WXP::Domain::set(), and set().
| int Image::set | ( | int | rwidth, |
| int | rheight, | ||
| int | rdepth | ||
| ) |
Sets basic image parameters
| rwidth | Width of image |
| rheight | Height of image |
| rdepth | Bit depth of image |
Referenced by WXP::NidsImage::addSite(), WXP::MdrImage::addSite(), WXP::KavradFile::read(), WXP::NowradFile::read(), WXP::ImgWxpFile::readHeader(), set(), and WXP::NidsImage::setImage().
| int Image::setBlu | ( | int | ind, |
| float | val | ||
| ) |
Sets the blue color value in the color table
| ind | Index in color table |
| val | Blue color value (0-1) |
References WXP::ImageColor::b.
Referenced by WXP::GifFile::read(), WXP::LZWComp::read(), and WXP::PngFile::read().
| int Image::setColorVal | ( | int | ind, |
| int | val | ||
| ) |
Sets the device specific color value in color table
| ind | Index in color table |
| val | Device specific color value |
References WXP::ImageColor::val.
Referenced by WXP::XWindow::drawImage(), and WXP::XWindow::drawImage().
| int Image::setCutoff | ( | char * | str | ) |
Sets the cutoff values for pixel interpolation.
| str | String containing cutoff values. |
| int Image::setGrn | ( | int | ind, |
| float | val | ||
| ) |
Sets the green color value in the color table
| ind | Index in color table |
| val | Green color value (0-1) |
References WXP::ImageColor::g.
Referenced by WXP::GifFile::read(), WXP::LZWComp::read(), and WXP::PngFile::read().
| int Image::setPixAve | ( | bool | val | ) |
Sets whether pixel interpolation is using averaging or nearest value
| val | true=average, false=nearest value |
Referenced by WXP::ImagePlot::drawImage().
| int Image::setPixel | ( | GridPoint | gpt, |
| int | val | ||
| ) |
Sets the value of a pixel in the image
| gpt | GridPoint location of pixel |
| val | Pixel value to set |
References setPixel().
| int Image::setPixel | ( | int | x, |
| int | y, | ||
| int | val | ||
| ) |
Sets the value of a pixel in the image
| x | X location of pixel |
| y | Y location of pixel |
| val | Pixel value to set |
Referenced by WXP::ImagePiece::add(), WXP::ImagePiece::add(), WXP::NidsImage::addSite(), WXP::MdrImage::addSite(), WXP::NidsImage::applyMask(), WXP::ImageMath::blank(), WXP::ImageMath::blank(), WXP::ImageMath::clip(), WXP::ImageMath::compressColor(), WXP::XWindow::getImage(), WXP::ImageMath::maskGreater(), WXP::ImageMath::maskLesser(), WXP::ImageMath::merge(), WXP::GifFile::read(), WXP::KavradFile::read(), WXP::LritFile::read(), WXP::LZWComp::read(), WXP::NowradFile::read(), WXP::PngFile::read(), WXP::TiffFile::read(), WXP::GiniFile::readData(), WXP::SatCdfFile::readData(), WXP::SatUniFile::readData(), WXP::AreaFile::readData(), WXP::ImgWxpFile::readData(), WXP::ImageMath::remap(), WXP::ImageMath::scale(), WXP::ImagePiece::set(), WXP::NidsImage::setImage(), setPixel(), setValue(), WXP::ImageMath::toGray(), WXP::ImageMath::toIndex(), WXP::ImageMath::toIndex(), and WXP::ImageMath::toTrueColor().
| int Image::setRed | ( | int | ind, |
| float | val | ||
| ) |
Sets the red color value in the color table
| ind | Index in color table |
| val | Red color value (0-1) |
References WXP::ImageColor::r.
Referenced by WXP::GifFile::read(), WXP::LZWComp::read(), and WXP::PngFile::read().
| int Image::setValue | ( | int | x, |
| int | y, | ||
| float | val | ||
| ) |
Sets the pixel in the image from a float value
| x | X location in image |
| y | Y location in image |
| val | Value to set |
References setPixel().
| int Image::tran | ( | EarthPoint | ept, |
| GridPoint & | gpt | ||
| ) |
Translates coordinates given the domain of the grid
| ept | Input earth point |
| gpt | Output grid point |
References WXP::Domain::tran().
| int Image::tran | ( | EarthPoint | ept, |
| Point & | pt | ||
| ) |
Translates coordinates given the domain of the grid
| ept | Input earth point |
| pt | Output point on projection plane |
References WXP::Domain::tran().
Referenced by WXP::ImagePiece::add(), WXP::NidsImage::addSite(), WXP::NidsImage::applyMask(), WXP::ImageMath::blank(), WXP::ImageMath::blank(), WXP::ImagePlot::callback(), WXP::SatPlot::callback(), WXP::ImageMath::clip(), WXP::ImageMath::maskGreater(), WXP::ImageMath::maskLesser(), WXP::ImageMath::merge(), WXP::ImageMath::remap(), and WXP::NidsImage::setImage().
| int Image::tran | ( | GridPoint | gpt, |
| EarthPoint & | ept | ||
| ) |
Translates coordinates given the domain of the grid
| gpt | Input grid point |
| ept | Output earth point |
References WXP::Domain::tran().
Translates coordinates given the domain of the grid
| gpt | Input grid point |
| pt | Output point on projection plane |
References WXP::Domain::tran().
| int Image::tran | ( | Point | pt, |
| EarthPoint & | ept | ||
| ) |
Translates coordinates given the domain of the grid
| pt | Input point on projection plane |
| ept | Output earth point |
References WXP::Domain::tran().
Translates coordinates given the domain of the grid
| pt | Input point on projection plane |
| gpt | Output grid point |
References WXP::Domain::tran().
| bool Image::validData | ( | ) |
Determines whether the image has valid data
Referenced by WXP::XWindow::drawImage(), and WXP::XWindow::drawImage().