49 ( 0, 0, 0, std::numeric_limits<rgba_pixel::component_type>::max() );
51 ( std::numeric_limits<rgba_pixel::component_type>::max(),
52 std::numeric_limits<rgba_pixel::component_type>::max(),
53 std::numeric_limits<rgba_pixel::component_type>::max(),
54 std::numeric_limits<rgba_pixel::component_type>::max() );
57 ( 0, 0, std::numeric_limits<rgba_pixel::component_type>::max(),
58 std::numeric_limits<rgba_pixel::component_type>::max() );
60 ( 0, std::numeric_limits<rgba_pixel::component_type>::max(), 0,
61 std::numeric_limits<rgba_pixel::component_type>::max() );
63 ( std::numeric_limits<rgba_pixel::component_type>::max(), 0, 0,
64 std::numeric_limits<rgba_pixel::component_type>::max() );
67 ( std::numeric_limits<rgba_pixel::component_type>::max(),
68 std::numeric_limits<rgba_pixel::component_type>::max(), 0,
69 std::numeric_limits<rgba_pixel::component_type>::max() );
71 ( std::numeric_limits<rgba_pixel::component_type>::max(), 0,
72 std::numeric_limits<rgba_pixel::component_type>::max(),
73 std::numeric_limits<rgba_pixel::component_type>::max() );
75 ( 0, std::numeric_limits<rgba_pixel::component_type>::max(),
76 std::numeric_limits<rgba_pixel::component_type>::max(),
77 std::numeric_limits<rgba_pixel::component_type>::max() );
104 components.green = g;
115 components.red = p.components.red;
116 components.green = p.components.green;
117 components.blue = p.components.blue;
127 std::istringstream iss(c);
133 if ( !(iss >> std::hex >> color) )
134 throw std::invalid_argument(c);
136 components.red = (color & 0xFF0000) >> (CHAR_BIT * 2);
137 components.green = (color & 0x00FF00) >> CHAR_BIT;
138 components.blue = color & 0x0000FF;
148 return (components.red == that.components.
red)
149 && (components.green == that.components.
green)
150 && (components.blue == that.components.
blue);
170 return !(*
this == that);
180 return !(*
this == that);
203 components.red = that.components.
red;
204 components.green = that.components.
green;
205 components.blue = that.components.
blue;
206 components.alpha = 255;
221 components.green = g;
223 components.alpha = a;
233 std::istringstream iss(c);
240 has_alpha = c.length() > 7;
243 has_alpha = c.length() > 6;
245 if ( !((iss >> std::hex >> color) && (iss.rdbuf()->in_avail() == 0)) )
246 throw std::invalid_argument(c);
249 components.alpha = (color & 0xFF000000) >> (CHAR_BIT * 3);
251 components.alpha = std::numeric_limits<component_type>::max();
253 components.red = (color & 0xFF0000) >> (CHAR_BIT * 2);
254 components.green = (color & 0x00FF00) >> CHAR_BIT;
255 components.blue = color & 0x0000FF;
267 components.
red = that.components.
red;
268 components.green = that.components.
green;
269 components.blue = that.components.
blue;
270 components.alpha = 255;
282 return pixel == that.
pixel;
292 return pixel != that.
pixel;
308 return ((
unsigned int)components.red * 183
309 + (
unsigned int)components.green * 54
310 + (
unsigned int)components.blue * 18