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.
| rgb_pixel (const rgba_pixel &p)
| Constructor.
| rgb_pixel (const std::string &c)
| Constructor from a color name or code.
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. More...
component_type green |
| Green component. More...
component_type blue |
| Blue component. More...
} | components
| Component by component representation.

## Detailed Description

RGB pixel.

Definition at line 44 of file pixel.hpp.

## Member Typedef Documentation

## component_type

typedef unsigned char claw::graphic::rgb_pixel::component_type

The type of the components of the color.

Definition at line 47 of file pixel.hpp.

## Constructor & Destructor Documentation

## rgb_pixel() [1/4]

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

Default constructor.

Definition at line 88 of file pixel.cpp.

Referenced by operator!=(), operator==(), and operator==().

## rgb_pixel() [2/4]

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

References components.

## rgb_pixel() [3/4]

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::blue, components, claw::graphic::rgba_pixel::components, claw::graphic::rgba_pixel::green, and claw::graphic::rgba_pixel::red.

## rgb_pixel() [4/4]

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.

References components.

## 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.

References rgb_pixel().

## 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, red, and rgb_pixel().

## 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.

References rgb_pixel().

## Member Data Documentation

## blue

component_type claw::graphic::rgb_pixel::blue

Blue component.

Definition at line 59 of file pixel.hpp.

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

## green

component_type claw::graphic::rgb_pixel::green

Green component.

Definition at line 56 of file pixel.hpp.

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

## red

component_type claw::graphic::rgb_pixel::red

Red component.

Definition at line 53 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:

- pixel.hpp
- code/pixel.cpp