Isis Developer Reference
Isis::Pixel Class Reference

Store and/or manipulate pixel values. More...

#include <Pixel.h>

Inheritance diagram for Isis::Pixel:
Inheritance graph
Collaboration diagram for Isis::Pixel:
Collaboration graph

Public Member Functions

 Pixel ()
 Constructs an empty Pixel.
 
 Pixel (int sample, int line, int band, double DN)
 Constructs a Pixel given a line, sample, band, and DN.
 
 Pixel (const Pixel &pixel)
 Constructs a Pixel, given a Pixel.
 
virtual ~Pixel ()
 Default destructor.
 
Pixeloperator= (const Pixel &other)
 Copy assignment operator.
 
int line () const
 
int sample () const
 
int band () const
 
double DN () const
 
unsigned char To8Bit ()
 Converts internal pixel value to an unsigned char pixel with special pixel translations.
 
short int To16Bit ()
 Converts internal pixel value to a short int pixel with special pixel translations.
 
short unsigned int To16Ubit ()
 Converts internal pixel value to a short int pixel with special pixel translations.
 
float To32Bit ()
 Converts internal pixel value to float with special pixel translations.
 
double ToDouble ()
 Converts stored pixel value to a double.
 
float ToFloat ()
 Converts internal pixel value to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)
 
std::string ToString ()
 Returns the name of the pixel type as a string.
 
bool IsSpecial ()
 Returns true if the input pixel is special.
 
bool IsValid ()
 Returns true if the input pixel is valid.
 
bool IsNull ()
 Returns true if the input pixel is null.
 
bool IsHigh ()
 Returns true if the input pixel is one of the high saturation types.
 
bool IsLow ()
 Returns true if the input pixel is one of the low saturation types.
 
bool IsHrs ()
 Returns true if the input pixel is high representation saturation.
 
bool IsHis ()
 Returns true if the input pixel is high instrument saturation.
 
bool IsLis ()
 Returns true if the input pixel is low instrument saturation.
 
bool IsLrs ()
 Returns true if the input pixel is low representation saturation.
 

Static Public Member Functions

static unsigned char To8Bit (const double d)
 Converts double pixels to unsigned char pixels with special pixel translations.
 
static short int To16Bit (const double d)
 Converts double pixels to short int pixels with special pixel translations.
 
static short unsigned int To16UBit (const double d)
 Converts double pixels to short unsigned int pixels with special pixel translations.
 
static float To32Bit (const double d)
 Converts double pixels to float pixels with special pixel translations.
 
static double ToDouble (const unsigned char t)
 Converts unsigned char pixels to double pixels with special pixel translations.
 
static double ToDouble (const short int t)
 Converts short int pixels to double pixels with special pixel translations.
 
static double ToDouble (const short unsigned int t)
 Converts short unsigned int pixels to double pixels with special pixel translations.
 
static double ToDouble (const float t)
 Converts float pixels to double pixels with special pixel translations.
 
static float ToFloat (const unsigned char d)
 Converts unsigned char to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)
 
static float ToFloat (const short int d)
 Converts short int to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)
 
static float ToFloat (const short unsigned int d)
 Converts short unsigned int to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)
 
static float ToFloat (const double d)
 Converts double to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)
 
static std::string ToString (double d)
 Takes a double pixel value and returns the name of the pixel type as a string.
 
static bool IsSpecial (const double d)
 Returns true if the input pixel is special.
 
static bool IsSpecial (const float f)
 Returns true if the input pixel is special.
 
static bool IsValid (const double d)
 Returns true if the input pixel is valid.
 
static bool IsNull (const double d)
 Returns true if the input pixel is null.
 
static bool IsHigh (const double d)
 Returns true if the input pixel is one of the high saturation types.
 
static bool IsLow (const double d)
 Returns true if the input pixel is one of the low saturation types.
 
static bool IsHrs (const double d)
 Returns true if the input pixel is high representation saturation.
 
static bool IsHis (const double d)
 Returns true if the input pixel is high instrument saturation.
 
static bool IsLis (const double d)
 Returns true if the input pixel is low instrument saturation.
 
static bool IsLrs (const double d)
 Returns true if the input pixel is low representation saturation.
 

Detailed Description

Store and/or manipulate pixel values.

This class can store pixel information and also contains utility methods for testing and modifying pixel and special pixel values that can be used without instanteating the class.

Author
2002-04-11 Kris Becker

Constructor & Destructor Documentation

◆ Pixel() [1/3]

Isis::Pixel::Pixel ( )

Constructs an empty Pixel.

Author
2015-08-05 Kristin Berry

References Isis::Null.

◆ Pixel() [2/3]

Isis::Pixel::Pixel ( int sample,
int line,
int band,
double DN )

Constructs a Pixel given a line, sample, band, and DN.

Author
2015-05-08 Kristin Berry
Parameters
lineline coordinate
samplesample coordinate
bandband coordinate
DNdata value for the pixel

References band(), DN(), line(), and sample().

◆ Pixel() [3/3]

Isis::Pixel::Pixel ( const Pixel & pixel)

Constructs a Pixel, given a Pixel.

Author
2015-08-05 Kristin Berry
Parameters
pixelPixel to copy

◆ ~Pixel()

Isis::Pixel::~Pixel ( )
virtual

Default destructor.

Member Function Documentation

◆ band()

int Isis::Pixel::band ( ) const
Returns
int The band coordinate of the Pixel

Referenced by Pixel().

◆ DN()

double Isis::Pixel::DN ( ) const
Returns
double The DN value of the Pixel

Referenced by Pixel().

◆ IsHigh() [1/2]

bool Isis::Pixel::IsHigh ( )
inline

Returns true if the input pixel is one of the high saturation types.

Returns
bool

References IsHigh().

Referenced by IsHigh().

◆ IsHigh() [2/2]

static bool Isis::Pixel::IsHigh ( const double d)
inlinestatic

Returns true if the input pixel is one of the high saturation types.

Parameters
dPixel value to test
Returns
bool

References Isis::HIGH_INSTR_SAT8, and Isis::HIGH_REPR_SAT8.

◆ IsHis() [1/2]

bool Isis::Pixel::IsHis ( )
inline

Returns true if the input pixel is high instrument saturation.

Returns
bool

References IsHis().

Referenced by IsHis(), and ToString().

◆ IsHis() [2/2]

static bool Isis::Pixel::IsHis ( const double d)
inlinestatic

Returns true if the input pixel is high instrument saturation.

Parameters
dPixel value to test
Returns
bool

References Isis::HIGH_INSTR_SAT8.

◆ IsHrs() [1/2]

bool Isis::Pixel::IsHrs ( )
inline

Returns true if the input pixel is high representation saturation.

Returns
bool

References IsHrs().

Referenced by IsHrs(), and ToString().

◆ IsHrs() [2/2]

static bool Isis::Pixel::IsHrs ( const double d)
inlinestatic

Returns true if the input pixel is high representation saturation.

Parameters
dPixel value to test
Returns
bool

References Isis::HIGH_REPR_SAT8.

◆ IsLis() [1/2]

bool Isis::Pixel::IsLis ( )
inline

Returns true if the input pixel is low instrument saturation.

Returns
bool

References IsLis().

Referenced by IsLis(), and ToString().

◆ IsLis() [2/2]

static bool Isis::Pixel::IsLis ( const double d)
inlinestatic

Returns true if the input pixel is low instrument saturation.

Parameters
dPixel value to test
Returns
bool

References Isis::LOW_INSTR_SAT8.

◆ IsLow() [1/2]

bool Isis::Pixel::IsLow ( )
inline

Returns true if the input pixel is one of the low saturation types.

Returns
bool

References IsLow().

Referenced by IsLow().

◆ IsLow() [2/2]

static bool Isis::Pixel::IsLow ( const double d)
inlinestatic

Returns true if the input pixel is one of the low saturation types.

Parameters
dPixel value to test
Returns
bool

References Isis::LOW_INSTR_SAT8, and Isis::LOW_REPR_SAT8.

◆ IsLrs() [1/2]

bool Isis::Pixel::IsLrs ( )
inline

Returns true if the input pixel is low representation saturation.

Returns
bool

References IsLrs().

Referenced by IsLrs(), and ToString().

◆ IsLrs() [2/2]

static bool Isis::Pixel::IsLrs ( const double d)
inlinestatic

Returns true if the input pixel is low representation saturation.

Parameters
dPixel value to test
Returns
bool

References Isis::LOW_REPR_SAT8.

◆ IsNull() [1/2]

bool Isis::Pixel::IsNull ( )
inline

Returns true if the input pixel is null.

Returns
bool

References IsNull().

Referenced by IsNull(), and ToString().

◆ IsNull() [2/2]

static bool Isis::Pixel::IsNull ( const double d)
inlinestatic

Returns true if the input pixel is null.

Parameters
dPixel value to test
Returns
bool

References Isis::NULL8.

◆ IsSpecial() [1/3]

bool Isis::Pixel::IsSpecial ( )
inline

Returns true if the input pixel is special.

Not special implies it is valid to use in computations.

Returns
bool

References IsSpecial().

Referenced by IsSpecial(), and ToString().

◆ IsSpecial() [2/3]

static bool Isis::Pixel::IsSpecial ( const double d)
inlinestatic

Returns true if the input pixel is special.

Not special implies it is valid to use in computations.

Parameters
dPixel value to test
Returns
bool

References Isis::VALID_MIN8.

◆ IsSpecial() [3/3]

static bool Isis::Pixel::IsSpecial ( const float f)
inlinestatic

Returns true if the input pixel is special.

Not special implies it is valid to use in computations. This method applies to a 4-byte floating point rather than an 8-byte double.

Parameters
fPixel value to test
Returns
bool

References Isis::VALID_MIN4.

◆ IsValid() [1/2]

bool Isis::Pixel::IsValid ( )
inline

Returns true if the input pixel is valid.

Valid implies the pixel is neither hrs, lrs, his, lis, nor null.

Returns
bool

References IsValid().

Referenced by IsValid().

◆ IsValid() [2/2]

static bool Isis::Pixel::IsValid ( const double d)
inlinestatic

Returns true if the input pixel is valid.

Valid implies the pixel is neither hrs, lrs, his, lis, nor null.

Parameters
dPixel value to test
Returns
bool

References Isis::VALID_MIN8.

◆ line()

int Isis::Pixel::line ( ) const
Returns
int The line coordinate of the Pixel

Referenced by Pixel().

◆ operator=()

Pixel & Isis::Pixel::operator= ( const Pixel & other)

Copy assignment operator.

Parameters
otherPixel the Pixel to be copied
Returns
Pixel Pointer to self

Referenced by Isis::Spectel::operator=().

◆ sample()

int Isis::Pixel::sample ( ) const
Returns
int The sample coordinate of the Pixel

Referenced by Pixel().

◆ To16Bit() [1/2]

short int Isis::Pixel::To16Bit ( )

Converts internal pixel value to a short int pixel with special pixel translations.

Returns
short int The short int pixel value

References To16Bit().

Referenced by To16Bit().

◆ To16Bit() [2/2]

short int Isis::Pixel::To16Bit ( const double d)
static

Converts double pixels to short int pixels with special pixel translations.

Parameters
dDouble pixel value to be converted to a double
Returns
short int The short int pixel value

References Isis::HIGH_INSTR_SAT2, Isis::HIGH_INSTR_SAT8, Isis::HIGH_REPR_SAT2, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT2, Isis::LOW_INSTR_SAT8, Isis::LOW_REPR_SAT2, Isis::LOW_REPR_SAT8, Isis::NULL2, Isis::NULL8, Isis::VALID_MAX2, Isis::VALID_MIN2, and Isis::VALID_MIN8.

◆ To16Ubit()

short unsigned int Isis::Pixel::To16Ubit ( )

Converts internal pixel value to a short int pixel with special pixel translations.

Returns
short unsigned int The short int pixel value

References To16UBit().

◆ To16UBit()

short unsigned int Isis::Pixel::To16UBit ( const double d)
static

Converts double pixels to short unsigned int pixels with special pixel translations.

Parameters
dDouble pixel value to be converted to a double
Returns
short unsigned int The short int pixel value

References Isis::HIGH_INSTR_SAT8, Isis::HIGH_INSTR_SATU2, Isis::HIGH_REPR_SAT8, Isis::HIGH_REPR_SATU2, Isis::LOW_INSTR_SAT8, Isis::LOW_INSTR_SATU2, Isis::LOW_REPR_SAT8, Isis::LOW_REPR_SATU2, Isis::NULL8, Isis::NULLU2, Isis::VALID_MAX2, Isis::VALID_MIN2, and Isis::VALID_MIN8.

Referenced by To16Ubit().

◆ To32Bit() [1/2]

float Isis::Pixel::To32Bit ( )

Converts internal pixel value to float with special pixel translations.

Returns
float The float pixel value

References To32Bit().

Referenced by To32Bit().

◆ To32Bit() [2/2]

float Isis::Pixel::To32Bit ( const double d)
static

Converts double pixels to float pixels with special pixel translations.

Parameters
dDouble pixel value to be converted to a double
Returns
float The float pixel value

References Isis::HIGH_INSTR_SAT4, Isis::HIGH_INSTR_SAT8, Isis::HIGH_REPR_SAT4, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT4, Isis::LOW_INSTR_SAT8, Isis::LOW_REPR_SAT4, Isis::LOW_REPR_SAT8, Isis::NULL4, Isis::NULL8, Isis::VALID_MAX8, and Isis::VALID_MIN8.

◆ To8Bit() [1/2]

unsigned char Isis::Pixel::To8Bit ( )

Converts internal pixel value to an unsigned char pixel with special pixel translations.

Returns
unsigned char The unsigned char pixel value

References To8Bit().

Referenced by To8Bit().

◆ To8Bit() [2/2]

unsigned char Isis::Pixel::To8Bit ( const double d)
static

Converts double pixels to unsigned char pixels with special pixel translations.

Parameters
dDouble pixel value to be converted to a double
Returns
unsigned char The unsigned char pixel value

References Isis::HIGH_INSTR_SAT1, Isis::HIGH_INSTR_SAT8, Isis::HIGH_REPR_SAT1, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT1, Isis::LOW_INSTR_SAT8, Isis::LOW_REPR_SAT1, Isis::LOW_REPR_SAT8, Isis::NULL1, Isis::NULL8, Isis::VALID_MAX1, Isis::VALID_MIN1, and Isis::VALID_MIN8.

◆ ToDouble() [1/5]

double Isis::Pixel::ToDouble ( )

Converts stored pixel value to a double.

Returns
double The double pixel value

◆ ToDouble() [2/5]

double Isis::Pixel::ToDouble ( const float d)
static

Converts float pixels to double pixels with special pixel translations.

Parameters
dFloat pixel value to be converted to a double
Returns
double The double pixel value

References Isis::HIGH_INSTR_SAT4, Isis::HIGH_INSTR_SAT8, Isis::HIGH_REPR_SAT4, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT4, Isis::LOW_INSTR_SAT8, Isis::LOW_REPR_SAT4, Isis::LOW_REPR_SAT8, Isis::NULL4, Isis::NULL8, Isis::VALID_MAX4, and Isis::VALID_MIN4.

◆ ToDouble() [3/5]

double Isis::Pixel::ToDouble ( const short int d)
static

Converts short int pixels to double pixels with special pixel translations.

Parameters
dShort int pixel value to be converted to a double
Returns
double The double pixel value

References Isis::HIGH_INSTR_SAT2, Isis::HIGH_INSTR_SAT8, Isis::HIGH_REPR_SAT2, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT2, Isis::LOW_INSTR_SAT8, Isis::LOW_REPR_SAT2, Isis::LOW_REPR_SAT8, Isis::NULL2, Isis::NULL8, and Isis::VALID_MIN2.

◆ ToDouble() [4/5]

double Isis::Pixel::ToDouble ( const short unsigned int d)
static

Converts short unsigned int pixels to double pixels with special pixel translations.

Parameters
dShort unsigned int pixel value to be converted to a double
Returns
double The double pixel value

References Isis::HIGH_INSTR_SAT8, Isis::HIGH_INSTR_SATU2, Isis::HIGH_REPR_SAT8, Isis::HIGH_REPR_SATU2, Isis::LOW_INSTR_SAT8, Isis::LOW_INSTR_SATU2, Isis::LOW_REPR_SAT8, Isis::LOW_REPR_SATU2, Isis::NULL8, Isis::NULLU2, and Isis::VALID_MINU2.

◆ ToDouble() [5/5]

double Isis::Pixel::ToDouble ( const unsigned char d)
static

Converts unsigned char pixels to double pixels with special pixel translations.

Parameters
dUnsigned char pixel value to be converted to a double
Returns
double The double pixel value

References Isis::HIGH_INSTR_SAT1, Isis::HIGH_INSTR_SAT8, Isis::HIGH_REPR_SAT1, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT1, Isis::LOW_INSTR_SAT8, Isis::LOW_REPR_SAT1, Isis::LOW_REPR_SAT8, Isis::NULL1, Isis::NULL8, Isis::VALID_MAX1, and Isis::VALID_MIN1.

◆ ToFloat() [1/5]

float Isis::Pixel::ToFloat ( )

Converts internal pixel value to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Returns
float The float pixel value

References ToFloat().

Referenced by ToFloat().

◆ ToFloat() [2/5]

float Isis::Pixel::ToFloat ( const double t)
static

Converts double to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Parameters
tDouble pixel value to be converted to a float
Returns
float The float pixel value

References Isis::HIGH_INSTR_SAT4, Isis::HIGH_INSTR_SAT8, Isis::HIGH_REPR_SAT4, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT4, Isis::LOW_INSTR_SAT8, Isis::LOW_REPR_SAT4, Isis::LOW_REPR_SAT8, Isis::NULL4, Isis::NULL8, Isis::VALID_MAX8, and Isis::VALID_MIN8.

◆ ToFloat() [3/5]

float Isis::Pixel::ToFloat ( const short int t)
static

Converts short int to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Parameters
tShort int pixel value to be converted to a float
Returns
float The float pixel value

References Isis::HIGH_INSTR_SAT2, Isis::HIGH_INSTR_SAT4, Isis::HIGH_REPR_SAT2, Isis::HIGH_REPR_SAT4, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT2, Isis::LOW_INSTR_SAT4, Isis::LOW_REPR_SAT2, Isis::LOW_REPR_SAT4, Isis::NULL2, Isis::NULL4, Isis::VALID_MAX2, and Isis::VALID_MIN2.

◆ ToFloat() [4/5]

float Isis::Pixel::ToFloat ( const short unsigned int t)
static

Converts short unsigned int to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Parameters
tShort unsigned int pixel value to be converted to a float
Returns
float The float pixel value

References Isis::HIGH_INSTR_SAT4, Isis::HIGH_INSTR_SATU2, Isis::HIGH_REPR_SAT4, Isis::HIGH_REPR_SAT8, Isis::HIGH_REPR_SATU2, Isis::LOW_INSTR_SAT4, Isis::LOW_INSTR_SATU2, Isis::LOW_REPR_SAT4, Isis::LOW_REPR_SATU2, Isis::NULL4, Isis::NULLU2, Isis::VALID_MAXU2, and Isis::VALID_MINU2.

◆ ToFloat() [5/5]

float Isis::Pixel::ToFloat ( const unsigned char t)
static

Converts unsigned char to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Parameters
tUnsigned char pixel value to be converted to a float
Returns
float The float pixel value

References Isis::HIGH_INSTR_SAT1, Isis::HIGH_INSTR_SAT4, Isis::HIGH_REPR_SAT1, Isis::HIGH_REPR_SAT4, Isis::HIGH_REPR_SAT8, Isis::LOW_INSTR_SAT1, Isis::LOW_INSTR_SAT4, Isis::LOW_REPR_SAT1, Isis::LOW_REPR_SAT4, Isis::NULL1, Isis::NULL4, Isis::VALID_MAX1, and Isis::VALID_MIN1.

◆ ToString() [1/2]

string Isis::Pixel::ToString ( )

Returns the name of the pixel type as a string.

Returns
string The name of the pixel type

References ToString().

Referenced by ToString().

◆ ToString() [2/2]

string Isis::Pixel::ToString ( double d)
static

Takes a double pixel value and returns the name of the pixel type as a string.

Parameters
dPixel value
Returns
string The name of the pixel type

References IsHis(), IsHrs(), IsLis(), IsLrs(), IsNull(), and IsSpecial().


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