GLIMSView Source Code Documentation

PixelArray Class Reference

#include <PixelArray.h>

List of all members.


Detailed Description

This class manages a group of PixelProfiles.

PixelProfiles can be added, updated, orobtained through this class. The group of PixelProfiles can also be cleared.

Author:
Erica Liszewski 2006-02-15

Definition at line 15 of file PixelArray.h.


Public Member Functions

 PixelArray ()
 ~PixelArray ()
void clearAll ()
 clears all the PixelProfiles leaving an empty PixelArray
int size ()
 return the number of PixelProfiles in this PixelArray
void add (int x, int y)
 creates and adds a new Pixel profile with x = x and y = y
PixelProfilegetPixel (int x, int y)
 returns a pointer to the PixelProfile with the input x and y, returns NULL if no matching PixelProfile is found
void addToProfile (int x, int y, double val)
 updates the PixelProfile with input x and y by adding the value val void addToProfile(int x, int y, double val)
std::string getAsString ()
 all values from all PixelProfiles are output with each PixelProfile on it's own line.
std::string getAsString (std::string delim)
 same as above, but you can specify the Delimiter std::string getAsString(std::string:delim) std::string:delim - the desired Delimiter
std::string getAsString (std::string delim, std::ofstream &f)
std::string runDriverTest ()
 runs a driver that creates test PixelProfiles and adds values to them.

Protected Attributes

std::vector< PixelProfilepixels
 the PixelProfiles
std::vector< PixelProfile >
::iterator 
iter
 a way of navigating

Constructor & Destructor Documentation

PixelArray::PixelArray (  ) 

Definition at line 6 of file PixelArray.cpp.

References iter, and pixels.

PixelArray::~PixelArray (  ) 

Definition at line 10 of file PixelArray.cpp.


Member Function Documentation

void PixelArray::clearAll (  ) 

clears all the PixelProfiles leaving an empty PixelArray

Definition at line 12 of file PixelArray.cpp.

References pixels.

Referenced by ImageSelectionCube::getAsString().

int PixelArray::size (  ) 

return the number of PixelProfiles in this PixelArray

Definition at line 16 of file PixelArray.cpp.

References pixels.

void PixelArray::add ( int  x,
int  y 
)

creates and adds a new Pixel profile with x = x and y = y

Definition at line 20 of file PixelArray.cpp.

References iter, and pixels.

Referenced by ImageSelectionCube::getAsString().

PixelProfile * PixelArray::getPixel ( int  x,
int  y 
)

returns a pointer to the PixelProfile with the input x and y, returns NULL if no matching PixelProfile is found

Definition at line 32 of file PixelArray.cpp.

References iter, and pixels.

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

void PixelArray::addToProfile ( int  x,
int  y,
double  val 
)

updates the PixelProfile with input x and y by adding the value val void addToProfile(int x, int y, double val)

Definition at line 88 of file PixelArray.cpp.

References PixelProfile::add(), and getPixel().

Here is the call graph for this function:

std::string PixelArray::getAsString (  ) 

all values from all PixelProfiles are output with each PixelProfile on it's own line.

Individual values in the PixelProfile are separated by ; std::string getAsString() returns a string representation of this PixelArray

Definition at line 94 of file PixelArray.cpp.

References pixels.

Referenced by ImageSelectionCube::getAsString(), and runDriverTest().

std::string PixelArray::getAsString ( std::string  delim  ) 

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

Todo:
Improve performance if possible

Definition at line 111 of file PixelArray.cpp.

References pixels.

std::string PixelArray::getAsString ( std::string  delim,
std::ofstream &  f 
)

Todo:
Improve performance if possible

Definition at line 127 of file PixelArray.cpp.

References pixels.

std::string PixelArray::runDriverTest (  ) 

runs a driver that creates test PixelProfiles and adds values to them.

The returned string is the getAsString() of this test set. std::string runDriverTest()

Definition at line 135 of file PixelArray.cpp.

References getAsString(), and getPixel().

Here is the call graph for this function:


Member Data Documentation

std::vector<PixelProfile> PixelArray::pixels [protected]

the PixelProfiles

Definition at line 17 of file PixelArray.h.

Referenced by add(), clearAll(), getAsString(), getPixel(), PixelArray(), and size().

std::vector<PixelProfile>::iterator PixelArray::iter [protected]

a way of navigating

Definition at line 18 of file PixelArray.h.

Referenced by add(), getPixel(), and PixelArray().


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

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