claw 1.9.0
 
Loading...
Searching...
No Matches
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

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

◆ rgb_pixel() [2/4]

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

◆ rgb_pixel() [3/4]

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

Constructor.

Parameters
pAn RGBA pixel.

Definition at line 111 of file pixel.cpp.

◆ rgb_pixel() [4/4]

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

Constructor from a color name or code.

Parameters
cThe color name or code.

Definition at line 122 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
thatThe pixel to compare to.

Definition at line 162 of file pixel.cpp.

◆ operator!=() [2/2]

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

Compare to a pixel.

Parameters
thatThe pixel to compare to.

Definition at line 171 of file pixel.cpp.

◆ operator==() [1/2]

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

Compare to a pixel.

Parameters
thatThe pixel to compare to.

Definition at line 142 of file pixel.cpp.

◆ operator==() [2/2]

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

Compare to a pixel.

Parameters
thatThe pixel to compare to.

Definition at line 153 of file pixel.cpp.

Member Data Documentation

◆ blue

component_type claw::graphic::rgb_pixel::blue

Blue component.

Definition at line 59 of file pixel.hpp.

◆ green

component_type claw::graphic::rgb_pixel::green

Green component.

Definition at line 56 of file pixel.hpp.

◆ red

component_type claw::graphic::rgb_pixel::red

Red component.

Definition at line 53 of file pixel.hpp.


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