#include <kino_plugin_types.h>
Collaboration diagram for kino::basic_rgb< SampleType, SampleTraits >:

Public Types | |
| typedef SampleType | sample_type |
| typedef SampleTraits | sample_traits |
| typedef basic_rgb< sample_type, sample_traits > | this_type |
Public Member Functions | |
| basic_rgb () | |
| Default constructor sets all samples to zero. | |
| basic_rgb (const sample_type Red, const sample_type Green, const sample_type Blue) | |
| Constructor that takes red, green, and blue samples. | |
| template<typename ForeignType, typename ForeignTraits> | |
| basic_rgb (const basic_luma< ForeignType, ForeignTraits > &RHS) | |
| template<typename ForeignType, typename ForeignTraits> | |
| basic_rgb (const basic_rgb< ForeignType, ForeignTraits > &RHS) | |
| template<typename ForeignType, typename ForeignTraits> | |
| basic_rgb (const basic_rgba< ForeignType, ForeignTraits > &RHS) | |
| basic_rgb (const basic_hsv &RHS) | |
Public Attributes | |
| sample_type | red |
| sample_type | green |
| sample_type | blue |
Friends | |
| std::ostream & | operator<< (std::ostream &Stream, const basic_rgb< sample_type, sample_traits > &RHS) |
| Serialization. | |
| std::istream & | operator>> (std::istream &Stream, basic_rgb< sample_type, sample_traits > &RHS) |
| Deserialization. | |
Definition at line 317 of file kino_plugin_types.h.
|
|||||
|
Definition at line 321 of file kino_plugin_types.h. |
|
|||||
|
Definition at line 320 of file kino_plugin_types.h. |
|
|||||
|
Definition at line 322 of file kino_plugin_types.h. |
|
|||||||||
|
Default constructor sets all samples to zero.
Definition at line 325 of file kino_plugin_types.h. 00325 : 00326 red(sample_traits::minimum()), 00327 green(sample_traits::minimum()), 00328 blue(sample_traits::minimum()) 00329 { 00330 }
|
|
||||||||||||||||||||
|
Constructor that takes red, green, and blue samples.
Definition at line 333 of file kino_plugin_types.h.
|
|
||||||||||||||
|
Definition at line 341 of file kino_plugin_types.h. 00341 : 00342 red(sample_traits::convert(RHS.luma)), 00343 green(sample_traits::convert(RHS.luma)), 00344 blue(sample_traits::convert(RHS.luma)) 00345 { 00346 }
|
|
||||||||||||||
|
Definition at line 349 of file kino_plugin_types.h. 00349 : 00350 red(sample_traits::convert(RHS.red)), 00351 green(sample_traits::convert(RHS.green)), 00352 blue(sample_traits::convert(RHS.blue)) 00353 { 00354 }
|
|
||||||||||||||
|
Definition at line 357 of file kino_plugin_types.h. 00357 : 00358 red(sample_traits::convert(RHS.red)), 00359 green(sample_traits::convert(RHS.green)), 00360 blue(sample_traits::convert(RHS.blue)) 00361 { 00362 }
|
|
||||||||||
|
Definition at line 364 of file kino_plugin_types.h. References kino::basic_rgb< SampleType, SampleTraits >::blue, kino::basic_rgb< SampleType, SampleTraits >::green, kino::basic_hsv::hue, kino::basic_rgb< SampleType, SampleTraits >::red, kino::basic_hsv::saturation, and kino::basic_hsv::value. 00365 {
00366 // Easiest case - saturation is zero
00367 if(0 == RHS.saturation)
00368 {
00369 red = green = blue = sample_traits::convert(RHS.value);
00370 return;
00371 }
00372
00373 const double h = RHS.hue / 60;
00374 const double i = floor(h);
00375 const double f = h - i;
00376 const double p = RHS.value * (1 - RHS.saturation);
00377 const double q = RHS.value * (1 - (RHS.saturation * f));
00378 const double t = RHS.value * (1 - (RHS.saturation * (1 - f)));
00379
00380 if(0.0 == i)
00381 {
00382 red = sample_traits::convert(RHS.value);
00383 green = sample_traits::convert(t);
00384 blue = sample_traits::convert(p);
00385 }
00386 else if(1.0 == i)
00387 {
00388 red = sample_traits::convert(q);
00389 green = sample_traits::convert(RHS.value);
00390 blue = sample_traits::convert(p);
00391 }
00392 else if(2.0 == i)
00393 {
00394 red = sample_traits::convert(p);
00395 green = sample_traits::convert(RHS.value);
00396 blue = sample_traits::convert(t);
00397 }
00398 else if(3.0 == i)
00399 {
00400 red = sample_traits::convert(p);
00401 green = sample_traits::convert(q);
00402 blue = sample_traits::convert(RHS.value);
00403 }
00404 else if(4.0 == i)
00405 {
00406 red = sample_traits::convert(t);
00407 green = sample_traits::convert(p);
00408 blue = sample_traits::convert(RHS.value);
00409 }
00410 else if(5.0 == i)
00411 {
00412 red = sample_traits::convert(RHS.value);
00413 green = sample_traits::convert(p);
00414 blue = sample_traits::convert(q);
00415 }
00416 }
|
|
||||||||||||||||
|
Serialization.
Definition at line 419 of file kino_plugin_types.h. 00420 {
00421 Stream << RHS.red << " " << RHS.green << " " << RHS.blue;
00422 return Stream;
00423 }
|
|
||||||||||||||||
|
Deserialization.
Definition at line 426 of file kino_plugin_types.h. 00427 {
00428 Stream >> RHS.red >> RHS.green >> RHS.blue;
00429 return Stream;
00430 }
|
|
|||||
|
Definition at line 434 of file kino_plugin_types.h. Referenced by kino::basic_rgb< SampleType, SampleTraits >::basic_rgb(). |
|
|||||
|
Definition at line 433 of file kino_plugin_types.h. Referenced by kino::basic_rgb< SampleType, SampleTraits >::basic_rgb(). |
|
|||||
|
Definition at line 432 of file kino_plugin_types.h. Referenced by kino::basic_rgb< SampleType, SampleTraits >::basic_rgb(). |
1.4.2