GLIMSView Source Code Documentation

PixelProfile Class Reference

#include <PixelProfile.h>

List of all members.


Detailed Description

PixelProfile.h.

Author:
Erica Liszewski 2006-02-15 PixelProfile is designed to hold multiple values for a single pixel. The intent is to hold values for a given pixel through muliple layers in an image cube. The PixelProfile holds the x and y of it's pixel, as well as any values added to it.
because data may be in different forms depending on the format of the image, the add() function is overridden to handle each case. If more formats are needed, more add() functions can be created. All values in the PixelProfile are stored as double.

Definition at line 26 of file PixelProfile.h.


Public Member Functions

 PixelProfile (int newx, int newy)
 ~PixelProfile ()
void add (int val)
 void add(int val) casts an int to a double and adds
void add (double val)
 void add(double val) adds a double value
void add (float val)
 void add(float val) casts a float to a double and adds
void add (char *val)
 void add(char* val) translates a char* to a double, and adds
int getX ()
 int getX() returns the x value of the pixel
int getY ()
 int getY() returns the y value of the pixel
int size ()
 int size() returns the number of values stored in this PixelArray
double valueAt (int loc)
 double valueAt(int loc) returns the double value stored at location loc witing the array of values
std::string getAsString ()
 std::string getAsString() returns a string of this PixelProfile.
std::string getAsString (std::string delim)
 std::string getAsString(std::string delim) std::string delim - the desired Delimiter same as above, but you can spcify the Delimiter
std::string runDriverTest ()
 std::string runDriverTest() creates several test values and adds them to this PixelProfile.

Protected Attributes

int x
 x value
int y
 y value
std::vector< double > values

Constructor & Destructor Documentation

PixelProfile::PixelProfile ( int  newx,
int  newy 
)

Definition at line 4 of file PixelProfile.cpp.

References x, and y.

PixelProfile::~PixelProfile (  ) 

Definition at line 9 of file PixelProfile.cpp.


Member Function Documentation

void PixelProfile::add ( int  val  ) 

void add(int val) casts an int to a double and adds

Definition at line 11 of file PixelProfile.cpp.

References values.

Referenced by PixelArray::addToProfile(), and ImageSelectionCube::getAsString().

void PixelProfile::add ( double  val  ) 

void add(double val) adds a double value

Definition at line 15 of file PixelProfile.cpp.

References values.

void PixelProfile::add ( float  val  ) 

void add(float val) casts a float to a double and adds

Definition at line 18 of file PixelProfile.cpp.

References values.

void PixelProfile::add ( char *  val  ) 

void add(char* val) translates a char* to a double, and adds

Definition at line 21 of file PixelProfile.cpp.

References values.

int PixelProfile::getX (  ) 

int getX() returns the x value of the pixel

Definition at line 25 of file PixelProfile.cpp.

References x.

int PixelProfile::getY (  ) 

int getY() returns the y value of the pixel

Definition at line 28 of file PixelProfile.cpp.

References y.

int PixelProfile::size (  ) 

int size() returns the number of values stored in this PixelArray

Definition at line 32 of file PixelProfile.cpp.

References values.

double PixelProfile::valueAt ( int  loc  ) 

double valueAt(int loc) returns the double value stored at location loc witing the array of values

Definition at line 36 of file PixelProfile.cpp.

References values.

std::string PixelProfile::getAsString (  ) 

std::string getAsString() returns a string of this PixelProfile.

Each value is output on a single line with ; as Delimiters

Definition at line 40 of file PixelProfile.cpp.

References values, x, and y.

Referenced by runDriverTest().

std::string PixelProfile::getAsString ( std::string  delim  ) 

std::string getAsString(std::string delim) std::string delim - the desired Delimiter same as above, but you can spcify the Delimiter

Definition at line 58 of file PixelProfile.cpp.

References values, x, and y.

std::string PixelProfile::runDriverTest (  ) 

std::string runDriverTest() creates several test values and adds them to this PixelProfile.

the returned string is the getAsString() of this test setup.

Definition at line 75 of file PixelProfile.cpp.

References getAsString().

Here is the call graph for this function:


Member Data Documentation

int PixelProfile::x [protected]

x value

Definition at line 28 of file PixelProfile.h.

Referenced by getAsString(), getX(), and PixelProfile().

int PixelProfile::y [protected]

y value

Definition at line 29 of file PixelProfile.h.

Referenced by getAsString(), getY(), and PixelProfile().

std::vector<double> PixelProfile::values [protected]

Definition at line 30 of file PixelProfile.h.

Referenced by add(), getAsString(), size(), and valueAt().


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

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov