WXP::Image Class Reference

This class defines an image. More...

#include "../include/Image.h"

List of all members.

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 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)
float getValue (int ind)
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)
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

Detailed Description

This class defines an image.

Author:
Dan Vietor

Constructor & Destructor Documentation

Image::Image (  ) 

Constructor. Initializes class values

References init().

Image::Image ( const Image image  ) 

Copy constructor for the image class

Parameters:
image Image class to copy from
Image::~Image (  ) 

Destructor. Frees allocated data


Member Function Documentation

int Image::allocColors ( int  num  ) 

Allocates the color table for the image

Parameters:
num Number of colors in color table

Referenced by WXP::GifFile::read(), WXP::ImageMath::toGray(), and WXP::ImageMath::toIndex().

int Image::allocData (  ) 
int Image::clearData (  ) 

Resets all values back to 0

int Image::copy ( Image image1,
const Image image2 
) [static]

Copies one image to another allocating data where appropriate

Parameters:
image1 Image to copy to
image2 Image to copy from
float Image::getDx (  ) 

Gets the X grid/pixel spacing of the image

Returns:
X grid/pixel spacing of image

References WXP::Domain::getDx().

Referenced by WXP::NidsImage::setImage().

Rect Image::getLimits (  ) 

Gets the domain limits (domain space) of the image

Returns:
Rect class with the domain limits

References WXP::Domain::getLimits().

Referenced by WXP::ImageMath::merge(), and WXP::ImageMath::remap().

int Image::getPixel ( GridPoint  gpt  ) 

Gets the pixel value at a location in the image. Will interpolate between pixel locations.

Parameters:
gpt GridPoint location
Returns:
Pixel value

References getPixel().

int Image::getPixel ( float  x,
float  y 
)

Gets the pixel value at a location in the image. Will interpolate between pixel locations.

Parameters:
x The X location
y The Y location
Returns:
Pixel value
int Image::getPixel ( int  x,
int  y 
)
int Image::getRGB ( int  x,
int  y,
RGB rgb 
)

Gets the RGB values at a specific location

Parameters:
x The X location
y The Y location
Return values:
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

Parameters:
row Row of image to get data from
Return values:
odata Buffer to put data into (preallocated)
Returns:
Number of bytes transfered

Referenced by WXP::PngFile::write().

int Image::getVal ( int  x,
int  y 
)

Gets the raw pixel value at a specific location (integral, exact location)

Parameters:
x The X location
y The Y location

Referenced by WXP::MdrPlot::draw(), getRGB(), WXP::ImageMath::toTrueColor(), and WXP::GifFile::write().

int Image::init (  ) 
Image Image::operator= ( const Image image  ) 

Assignment operator. Used to overload copying

Parameters:
strings String class to copy from
int Image::print (  ) 

Prints image values to standard output

References WXP::Const::MISS, WXP::Domain::print(), and WXP::Date::print().

Referenced by WXP::RcmPlot::draw().

int Image::set ( DomainVal rdv,
int  rdepth 
)

Sets basic image parameters

Parameters:
rdv Domain of image (sets size from nx, ny domain parameters)
rdepth Bit depth of image

References WXP::Domain::set().

int Image::set ( Domain rdomain,
int  rdepth 
)

Sets basic image parameters

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 ( int  rwidth,
int  rheight,
int  rdepth 
)

Sets basic image parameters

Parameters:
rwidth Width of image
rheight Height of image
rdepth Bit depth of image

Referenced by WXP::NowradFile::read(), WXP::KavradFile::read(), WXP::ImgWxpFile::readHeader(), and WXP::NidsImage::setImage().

int Image::setBlu ( int  ind,
float  val 
)

Sets the blue color value in the color table

Parameters:
ind Index in color table
val Blue color value (0-1)

References WXP::ImageColor::b.

Referenced by WXP::GifFile::read().

int Image::setColorVal ( int  ind,
int  val 
)

Sets the device specific color value in color table

Parameters:
ind Index in color table
val Device specific color value

References WXP::ImageColor::val.

Referenced by WXP::XWindow::drawImage().

int Image::setCutoff ( char *  str  ) 

Sets the cutoff values for pixel interpolation.

Parameters:
str String containing cutoff values.
int Image::setGrn ( int  ind,
float  val 
)

Sets the green color value in the color table

Parameters:
ind Index in color table
val Green color value (0-1)

References WXP::ImageColor::g.

Referenced by WXP::GifFile::read().

int Image::setPixAve ( bool  val  ) 

Sets whether pixel interpolation is using averaging or nearest value

Parameters:
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

Parameters:
gpt GridPoint location of pixel
val Pixel value to set

References setPixel().

int Image::setPixel ( int  x,
int  y,
int  val 
)
int Image::setRed ( int  ind,
float  val 
)

Sets the red color value in the color table

Parameters:
ind Index in color table
val Red color value (0-1)

References WXP::ImageColor::r.

Referenced by WXP::GifFile::read().

int Image::tran ( GridPoint  gpt,
EarthPoint ept 
)

Translates coordinates given the domain of the grid

Parameters:
gpt Input grid point
Return values:
ept Output earth point

References WXP::Domain::tran().

int Image::tran ( EarthPoint  ept,
GridPoint gpt 
)

Translates coordinates given the domain of the grid

Parameters:
ept Input earth point
Return values:
gpt Output grid point

References WXP::Domain::tran().

int Image::tran ( Point  pt,
GridPoint gpt 
)

Translates coordinates given the domain of the grid

Parameters:
pt Input point on projection plane
Return values:
gpt Output grid point

References WXP::Domain::tran().

int Image::tran ( GridPoint  gpt,
Point pt 
)

Translates coordinates given the domain of the grid

Parameters:
gpt Input grid point
Return values:
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

Parameters:
pt Input point on projection plane
Return values:
ept Output earth point

References WXP::Domain::tran().

int Image::tran ( EarthPoint  ept,
Point pt 
)

Translates coordinates given the domain of the grid

Parameters:
ept Input earth point
Return values:
pt Output point on projection plane

References WXP::Domain::tran().

Referenced by WXP::ImageMath::blank(), WXP::SatPlot::callback(), WXP::ImageMath::clip(), WXP::ImageMath::maskGreater(), WXP::ImageMath::maskLesser(), WXP::ImageMath::merge(), WXP::ImageMath::remap(), and WXP::NidsImage::setImage().

bool Image::validData (  ) 

Determines whether the image has valid data

Returns:
true if valid

Referenced by WXP::XWindow::drawImage().


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

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1