Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

PixelRGB96 Class Reference

#include <PixelRGB96.h>


Public Member Functions

 PixelRGB96 ()
 PixelRGB96 (int red, int green, int blue)
PixelRGB96operator= (PixelRGB96 &p)
int & operator[] (int i)
const int & operator[] (int i) const
 operator int * ()
bool operator== (PixelRGB96 &p)
bool operator!= (PixelRGB96 &p)
PixelRGB96operator+= (PixelRGB96 &p)
PixelRGB96operator-= (PixelRGB96 &p)
PixelRGB96operator *= (double k)
PixelRGB96operator *= (PixelRGB96 &p)
PixelRGB96operator/= (PixelRGB96 &p)

Protected Attributes

int pixel [3]
 The pixels data as an array of ints.

Friends

ostream & operator<< (ostream &os, PixelRGB96 &p)


Detailed Description

A Single pixel consisting of red, green and blue fields

The pixel is stored as an array of three ints which can be access as seperate colour fields using the FieldSelector enum in the ImageRGB class.

Definition at line 31 of file PixelRGB96.h.


Constructor & Destructor Documentation

PixelRGB96::PixelRGB96  )  [inline]
 

The default constructor.

This zero's the values of the red, green and blue colour fields.

Definition at line 68 of file PixelRGB96.h.

References pixel.

PixelRGB96::PixelRGB96 int  red,
int  green,
int  blue
[inline]
 

Create a pixel with the specified values.

This constructor creates a new pixel with the red, green and blue values specified as arguments.

Definition at line 78 of file PixelRGB96.h.

References pixel.


Member Function Documentation

PixelRGB96& PixelRGB96::operator *= double  k  )  [inline]
 

Overloaded multiplication operator.

Multiply the fields of this pixel by a scalar value.

Parameters:
k The scalar to multiply by.
Returns:
A reference to this object.

Definition at line 237 of file PixelRGB96.h.

References pixel.

PixelRGB96::operator int *  )  [inline]
 

Overloaded Cast operator.

This operator allows the pixel to be easily cast to an int pointer. Since the pixel data is just an array of ints, this operator allows the pixel to be treated as such.

Definition at line 145 of file PixelRGB96.h.

References pixel.

bool PixelRGB96::operator!= PixelRGB96 p  )  [inline]
 

Overloaded test for none equality

This tests whether the pixel and the one specified are not equal i.e. they have at least one field in which their values differ.

Parameters:
p The pixel to test none-equality with.
Returns:
true - if pixels are different false - if all fields are the same.

Definition at line 182 of file PixelRGB96.h.

References pixel.

PixelRGB96& PixelRGB96::operator+= PixelRGB96 p  )  [inline]
 

Overloaded addition operator.

Add the values of the pixel specified to the fields of this pixel. Note NO checking that values are within range 0-255 is done.

Parameters:
p The pixel to add the values from.
Returns:
A reference to this object.

Definition at line 200 of file PixelRGB96.h.

References pixel.

PixelRGB96& PixelRGB96::operator-= PixelRGB96 p  )  [inline]
 

Overloaded subtraction(difference) operator.

Assign the difference of the values of the pixel specified and this pixel to the fields of this pixel.

Parameters:
p The pixel to difference the values with.
Returns:
A reference to this object.

Definition at line 219 of file PixelRGB96.h.

References pixel.

PixelRGB96& PixelRGB96::operator= PixelRGB96 p  )  [inline]
 

Overloaded assignment operator.

Assign the values of the pixel specified to the fields of this pixel.

Parameters:
p The pixel to assign the values from.
Returns:
A reference to this object.

Definition at line 96 of file PixelRGB96.h.

References pixel.

bool PixelRGB96::operator== PixelRGB96 p  )  [inline]
 

Overloaded equality operator.

This tests whether this pixel and the one specified are equal i.e. have the same values for all fields.

Parameters:
p The pixel to test equality with.
Returns:
true - if pixels are equal. false - if pixels differ in any fields.

Definition at line 162 of file PixelRGB96.h.

References pixel.

const int& PixelRGB96::operator[] int  i  )  const [inline]
 

Overloaded array operator.

This operator allows easy access to the data of the pixel as if you were refering to the data directly.

Parameters:
i The index of the field to return.
Returns:
The value of the field.

Definition at line 131 of file PixelRGB96.h.

References pixel.

int& PixelRGB96::operator[] int  i  )  [inline]
 

Overloaded array operator.

This operator allows easy access to the data of the pixel as if you were refering to the data directly.

Parameters:
i The index of the field to return.
Returns:
The value of the field.

Definition at line 116 of file PixelRGB96.h.

References pixel.


Friends And Related Function Documentation

ostream& operator<< ostream &  os,
PixelRGB96 p
[friend]
 

Outputs a pixel to the output stream

This overlaoded operator inserts a representation of the pixel into the output stream (os) in the form '(r,g,b)' where r, g, b are the red, green and blue fields respectively.

Parameters:
os The output stream.
p The pixel to output.
Returns:
A reference to the output stream for chained calls.

Definition at line 52 of file PixelRGB96.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 24 11:59:12 2006 for VETLib by  doxygen 1.4.4