claw
1.9.0
Toggle main menu visibility
Loading...
Searching...
No Matches
pixel.hpp
Go to the documentation of this file.
1
/*
2
CLAW - a C++ Library Absolutely Wonderful
3
4
CLAW is a free library without any particular aim but being useful to
5
anyone.
6
7
Copyright (C) 2005-2011 Julien Jorge
8
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Lesser General Public
11
License as published by the Free Software Foundation; either
12
version 2.1 of the License, or (at your option) any later version.
13
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
23
contact: julien.jorge@stuff-o-matic.com
24
*/
30
#ifndef __CLAW_PIXEL_HPP_
31
#define __CLAW_PIXEL_HPP_
32
33
#include <string>
34
35
namespace
claw
36
{
37
namespace
graphic
38
{
39
struct
rgba_pixel
;
40
44
struct
rgb_pixel
45
{
47
typedef
unsigned
char
component_type
;
48
50
struct
51
{
53
component_type
red
;
54
56
component_type
green
;
57
59
component_type
blue
;
60
61
}
components
;
62
63
public
:
64
rgb_pixel
();
65
rgb_pixel
(
component_type
r,
component_type
g,
component_type
b);
66
rgb_pixel
(
const
rgba_pixel
& p);
67
explicit
rgb_pixel
(
const
std::string& c);
68
69
bool
operator==
(
const
rgb_pixel
& that)
const
;
70
bool
operator==
(
const
rgba_pixel
& that)
const
;
71
bool
operator!=
(
const
rgb_pixel
& that)
const
;
72
bool
operator!=
(
const
rgba_pixel
& that)
const
;
73
74
};
// struct rgb_pixel
75
79
struct
rgba_pixel
80
{
82
typedef
unsigned
char
component_type
;
83
84
union
85
{
87
unsigned
int
pixel
;
88
90
struct
91
{
93
component_type
red
;
94
96
component_type
green
;
97
99
component_type
blue
;
100
102
component_type
alpha
;
103
104
}
components
;
105
};
106
107
public
:
108
rgba_pixel
();
109
rgba_pixel
(
const
rgb_pixel& that);
110
rgba_pixel
(
component_type
r,
component_type
g,
component_type
b,
111
component_type
a);
112
explicit
rgba_pixel
(
const
std::string& c);
113
114
rgba_pixel
&
operator=
(
const
rgb_pixel& that);
115
bool
operator==
(
const
rgba_pixel
& that)
const
;
116
bool
operator!=
(
const
rgba_pixel
& that)
const
;
117
118
component_type
luminosity
()
const
;
119
120
};
// struct rgba_pixel
121
123
typedef
rgb_pixel
rgb_pixel_8
;
124
126
typedef
rgba_pixel
rgba_pixel_8
;
127
131
133
extern
rgba_pixel
transparent_pixel
;
134
136
extern
rgba_pixel
black_pixel
;
137
139
extern
rgba_pixel
white_pixel
;
140
142
extern
rgba_pixel
blue_pixel
;
143
145
extern
rgba_pixel
green_pixel
;
146
148
extern
rgba_pixel
red_pixel
;
149
151
extern
rgba_pixel
yellow_pixel
;
152
154
extern
rgba_pixel
magenta_pixel
;
155
157
extern
rgba_pixel
cyan_pixel
;
158
160
161
}
162
}
163
164
#endif
// __CLAW_PIXEL_HPP__
claw::graphic::cyan_pixel
rgba_pixel cyan_pixel
The cyan color.
claw::graphic::green_pixel
rgba_pixel green_pixel
The green color.
claw::graphic::transparent_pixel
rgba_pixel transparent_pixel
A transparent color.
claw::graphic::red_pixel
rgba_pixel red_pixel
The red color.
claw::graphic::white_pixel
rgba_pixel white_pixel
The white color.
claw::graphic::black_pixel
rgba_pixel black_pixel
The black color.
claw::graphic::yellow_pixel
rgba_pixel yellow_pixel
The yellow color.
claw::graphic::magenta_pixel
rgba_pixel magenta_pixel
The magenta color.
claw::graphic::blue_pixel
rgba_pixel blue_pixel
The blue color.
claw::graphic
Everything about image structures and processing.
Definition
claw.hpp:58
claw::graphic::rgba_pixel_8
rgba_pixel rgba_pixel_8
A color with 8 bits per component and an alpha channel.
Definition
pixel.hpp:126
claw::graphic::rgb_pixel_8
rgb_pixel rgb_pixel_8
A color with 8 bits per component.
Definition
pixel.hpp:123
claw
This is the main namespace.
Definition
application.hpp:50
claw::graphic::rgb_pixel
RGB pixel.
Definition
pixel.hpp:45
claw::graphic::rgb_pixel::components
struct claw::graphic::rgb_pixel::@217001364276256254254300335037210026331301104326 components
Component by component representation.
claw::graphic::rgb_pixel::red
component_type red
Red component.
Definition
pixel.hpp:53
claw::graphic::rgb_pixel::blue
component_type blue
Blue component.
Definition
pixel.hpp:59
claw::graphic::rgb_pixel::operator==
bool operator==(const rgb_pixel &that) const
Compare to a pixel.
Definition
pixel.cpp:142
claw::graphic::rgb_pixel::component_type
unsigned char component_type
The type of the components of the color.
Definition
pixel.hpp:47
claw::graphic::rgb_pixel::green
component_type green
Green component.
Definition
pixel.hpp:56
claw::graphic::rgb_pixel::operator!=
bool operator!=(const rgb_pixel &that) const
Compare to a pixel.
Definition
pixel.cpp:162
claw::graphic::rgb_pixel::rgb_pixel
rgb_pixel()
Default constructor.
Definition
pixel.cpp:90
claw::graphic::rgba_pixel
RGBA pixel.
Definition
pixel.hpp:80
claw::graphic::rgba_pixel::component_type
unsigned char component_type
The type of the components of the color.
Definition
pixel.hpp:82
claw::graphic::rgba_pixel::operator=
rgba_pixel & operator=(const rgb_pixel &that)
Assignement operator.
Definition
pixel.cpp:248
claw::graphic::rgba_pixel::red
component_type red
Red component.
Definition
pixel.hpp:93
claw::graphic::rgba_pixel::luminosity
component_type luminosity() const
Get the luminosity of the pixel.
Definition
pixel.cpp:286
claw::graphic::rgba_pixel::components
struct claw::graphic::rgba_pixel::@243011111317154221214371326113376113353054140240::@062221254366262347154034240363361326201063204322 components
Component by component representation.
claw::graphic::rgba_pixel::operator!=
bool operator!=(const rgba_pixel &that) const
Tell if two pixels are different.
Definition
pixel.cpp:271
claw::graphic::rgba_pixel::operator==
bool operator==(const rgba_pixel &that) const
Tell if two pixels are equal.
Definition
pixel.cpp:262
claw::graphic::rgba_pixel::alpha
component_type alpha
Translucy.
Definition
pixel.hpp:102
claw::graphic::rgba_pixel::green
component_type green
Green component.
Definition
pixel.hpp:96
claw::graphic::rgba_pixel::blue
component_type blue
Blue component.
Definition
pixel.hpp:99
claw::graphic::rgba_pixel::pixel
unsigned int pixel
Compressed representation.
Definition
pixel.hpp:87
claw::graphic::rgba_pixel::rgba_pixel
rgba_pixel()
Default constructor.
Definition
pixel.cpp:179
lib
graphic
include
claw
graphic
pixel.hpp
Generated by
1.17.0