CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
Public Types | Public Member Functions | Public Attributes
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

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 78 of file pixel.cpp.

{

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

Constructor.

Parameters:
rThe value of the red field.
gThe value of the green field.
bThe value of the blue field.

Definition at line 91 of file pixel.cpp.

{ 
  components.red = r;
  components.green = g;
  components.blue = b;
} // rgb_pixel::rgb_pixel()
claw::graphic::rgb_pixel::rgb_pixel ( const rgba_pixel p)

Constructor.

Parameters:
pAn RGBA pixel.

Definition at line 103 of file pixel.cpp.

References claw::graphic::rgba_pixel::components.

{ 
  components.red = p.components.red;
  components.green = p.components.green;
  components.blue = p.components.blue;
} // rgb_pixel::rgb_pixel()

Member Function Documentation

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

Compare to a pixel.

Parameters:
thatThe pixel to compare to.

Definition at line 137 of file pixel.cpp.

{ 
  return !(*this == that);
} // rgb_pixel::operator!=()
bool claw::graphic::rgb_pixel::operator!= ( const rgba_pixel that) const

Compare to a pixel.

Parameters:
thatThe pixel to compare to.

Definition at line 147 of file pixel.cpp.

{ 
  return !(*this == that);
} // rgb_pixel::operator!=()
bool claw::graphic::rgb_pixel::operator== ( const rgb_pixel that) const

Compare to a pixel.

Parameters:
thatThe pixel to compare to.

Definition at line 115 of file pixel.cpp.

References blue, components, green, and red.

{ 
  return (components.red == that.components.red)
    && (components.green == that.components.green)
    && (components.blue == that.components.blue);
} // rgb_pixel::operator==()
bool claw::graphic::rgb_pixel::operator== ( const rgba_pixel that) const

Compare to a pixel.

Parameters:
thatThe pixel to compare to.

Definition at line 127 of file pixel.cpp.

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

Member Data Documentation

Blue component.

Definition at line 56 of file pixel.hpp.

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

Green component.

Definition at line 53 of file pixel.hpp.

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

Red component.

Definition at line 50 of file pixel.hpp.

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


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