claw::graphic::rgb_pixel Struct Reference

RGB pixel. More...

`#include <pixel.hpp>`

## Public Types

typedef unsigned char | component_type
| The type of the components of the color.

## Public Member Functions

| rgb_pixel ()
| Default constructor.
| rgb_pixel (component_type r, component_type g, component_type b)
| Constructor. More...
| rgb_pixel (const rgba_pixel &p)
| Constructor. More...
| rgb_pixel (const std::string &c)
| Constructor from a color name or code. More...
bool | operator== (const rgb_pixel &that) const
| Compare to a pixel. More...
bool | operator== (const rgba_pixel &that) const
| Compare to a pixel. More...
bool | operator!= (const rgb_pixel &that) const
| Compare to a pixel. More...
bool | operator!= (const rgba_pixel &that) const
| Compare to a pixel. More...

## 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 44 of file pixel.hpp.

## Constructor & Destructor Documentation

## rgb_pixel() [1/3]

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

## rgb_pixel() [2/3]

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

Constructor.

Parameters

  p | An RGBA pixel.

Definition at line 113 of file pixel.cpp.

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

## rgb_pixel() [3/3]

claw::graphic::rgb_pixel::rgb_pixel | ( | const std::string & | c | ) |

explicit

Constructor from a color name or code.

Parameters

  c | The color name or code.

Definition at line 125 of file pixel.cpp.

## Member Function Documentation

## operator!=() [1/2]

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

## operator!=() [2/2]

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

## operator==() [1/2]

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

References blue, components, green, and red.

## operator==() [2/2]

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

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

- pixel.hpp
- code/pixel.cpp