claw::graphic::rgb_pixel Struct Reference

RGB pixel. More...

#include <pixel.hpp>

List of all members.

Public Types

typedef unsigned char component_type

Public Member Functions

 rgb_pixel ()
 Default constructor.
 rgb_pixel (component_type r, component_type g, component_type b)
 Constructor.
 rgb_pixel (const rgba_pixel &p)
 Constructor.
bool operator== (const rgb_pixel &that) const
 Compare to a pixel.
bool operator== (const rgba_pixel &that) const
 Compare to a pixel.
bool operator!= (const rgb_pixel &that) const
 Compare to a pixel.
bool operator!= (const rgba_pixel &that) const
 Compare to a pixel.

Public Attributes

struct {
   component_type   red
 Red component.
   component_type   green
 Green component.
   component_type   blue
 Blue component.
components
 Component by component representation.

Detailed Description

RGB pixel.

Definition at line 42 of file pixel.hpp.


Member Typedef Documentation

Definition at line 44 of file pixel.hpp.


Constructor & Destructor Documentation

claw::graphic::rgb_pixel::rgb_pixel (  ) 

Default constructor.

Definition at line 76 of file pixel.cpp.

Referenced by operator==().

00077 {
00078 
00079 } // rgb_pixel::rgb_pixel()

claw::graphic::rgb_pixel::rgb_pixel ( component_type  r,
component_type  g,
component_type  b 
)

Constructor.

Parameters:
r The value of the red field.
g The value of the green field.
b The value of the blue field.

Definition at line 89 of file pixel.cpp.

00090 { 
00091   components.red = r;
00092   components.green = g;
00093   components.blue = b;
00094 } // rgb_pixel::rgb_pixel()

claw::graphic::rgb_pixel::rgb_pixel ( const rgba_pixel p  ) 

Constructor.

Parameters:
p An RGBA pixel.

Definition at line 101 of file pixel.cpp.

References claw::graphic::rgba_pixel::blue, claw::graphic::rgba_pixel::components, components, claw::graphic::rgba_pixel::green, and claw::graphic::rgba_pixel::red.

00102 { 
00103   components.red = p.components.red;
00104   components.green = p.components.green;
00105   components.blue = p.components.blue;
00106 } // rgb_pixel::rgb_pixel()


Member Function Documentation

bool claw::graphic::rgb_pixel::operator!= ( const rgba_pixel that  )  const

Compare to a pixel.

Parameters:
that The pixel to compare to.

Definition at line 145 of file pixel.cpp.

00146 { 
00147   return !(*this == that);
00148 } // rgb_pixel::operator!=()

bool claw::graphic::rgb_pixel::operator!= ( const rgb_pixel that  )  const

Compare to a pixel.

Parameters:
that The pixel to compare to.

Definition at line 135 of file pixel.cpp.

00136 { 
00137   return !(*this == that);
00138 } // rgb_pixel::operator!=()

bool claw::graphic::rgb_pixel::operator== ( const rgba_pixel that  )  const

Compare to a pixel.

Parameters:
that The pixel to compare to.

Definition at line 125 of file pixel.cpp.

References rgb_pixel().

00126 { 
00127   return *this == rgb_pixel(that);
00128 } // rgb_pixel::operator==()

bool claw::graphic::rgb_pixel::operator== ( const rgb_pixel that  )  const

Compare to a pixel.

Parameters:
that The pixel to compare to.

Definition at line 113 of file pixel.cpp.

References blue, components, green, and red.

00114 { 
00115   return (components.red == that.components.red)
00116     && (components.green == that.components.green)
00117     && (components.blue == that.components.blue);
00118 } // rgb_pixel::operator==()


Member Data Documentation

Blue component.

Definition at line 56 of file pixel.hpp.

Referenced by claw::graphic::rgba_pixel::operator=(), and operator==().

Component by component representation.

Referenced by claw::graphic::rgba_pixel::operator=(), operator==(), and rgb_pixel().

Green component.

Definition at line 53 of file pixel.hpp.

Referenced by claw::graphic::rgba_pixel::operator=(), and operator==().

Red component.

Definition at line 50 of file pixel.hpp.

Referenced by claw::graphic::rgba_pixel::operator=(), and operator==().


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

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1