|
Public Types |
typedef RGB_converter::component_type | component_type |
typedef component_type | distance_type |
typedef RGB_converter | converter_type |
Public Methods |
| Basic_color () |
| Basic_color (const char r, const char g, const char b) |
| Basic_color (const float r, const float g, const float b) |
| Basic_color (const double r, const double g, const double b) |
| Basic_color (const Basic_color< RGB_converter > &c) |
Basic_color< RGB_converter > & | operator= (const Basic_color< RGB_converter > &c) |
bool | operator== (const Basic_color< RGB_converter > &c) const |
bool | operator!= (const Basic_color< RGB_converter > &c) const |
bool | is_not_a_color () const |
| Test if the color is not initialzed.
|
void | write_to_bytes (std::ostream &out) const |
| Write the color in a binary format to a stream.
|
void | read_from_bytes (std::istream &in) |
| Read the color in a binary format from a stream.
|
|
void | get_RGB (char *const r, char *const g, char *const b) const |
| Return the RGB components.
|
void | get_RGB (float *const r, float *const g, float *const b) const |
| Return the RGB components.
|
void | get_RGB (double *const r, double *const g, double *const b) const |
| Return the RGB components.
|
|
void | get_space_position (component_type *const x_space, component_type *const y_space, component_type *const z_space) const |
| Return the 3D position in the color space.
|
template<typename Space_vector> void | get_space_position (Space_vector *const space_vector) const |
|
void | set_space_position (const component_type x_space, const component_type y_space, const component_type z_space) |
| Change the 3D position in the color space.
|
template<typename Space_vector> void | set_space_position (const Space_vector &space_vector) |
Static Public Methods |
distance_type | square_distance (const Basic_color< RGB_converter > &c1, const Basic_color< RGB_converter > &c2) |
| Compute the square distance in the color space.
|
distance_type | distance (const Basic_color< RGB_converter > &c1, const Basic_color< RGB_converter > &c2) |
| Compute the distance in the color space.
|
void | main_conversion_output (std::ostream &out=std::cout) |
void | cycle (const double alpha, Basic_color< RGB_converter > *const result, const Basic_color< RGB_converter > &clr_0=red, const Basic_color< RGB_converter > &clr_1=blue, const Basic_color< RGB_converter > &clr_2=yellow, const Basic_color< RGB_converter > &clr_3=magenta) |
|
template<typename Basic_color_iterator> void | mean (Basic_color_iterator first, Basic_color_iterator last, Basic_color< RGB_converter > *const result) |
| Compute the mean color of a color set.
|
template<typename Basic_color_iterator, typename Weight_iterator> void | mean (Basic_color_iterator first_clr, Basic_color_iterator last_clr, Weight_iterator first_w, Weight_iterator last_w, Basic_color< RGB_converter > *const result) |
| Compute the mean color of a color set.
|
|
template<typename Basic_color_iterator> void | robust_mean (Basic_color_iterator first, Basic_color_iterator last, Basic_color< RGB_converter > *const result, const unsigned int n_iter=1) |
| Compute a robust mean of a color set. The colors whose distance to the mean is over the standard deviation are discarded.
|
template<typename Basic_color_iterator, typename Weight_iterator> void | robust_mean (Basic_color_iterator first_clr, Basic_color_iterator last_clr, Weight_iterator first_w, Weight_iterator last_w, Basic_color< RGB_converter > *const result, const unsigned int n_iter=1) |
| Compute a robust mean of a color set. The colors whose distance to the mean is over the standard deviation are discarded.
|
|
template<typename Basic_color_iterator> distance_type | square_deviation (const Basic_color_iterator first, const Basic_color_iterator last) |
| Compute the variance of color set.
|
template<typename Basic_color_iterator> distance_type | square_deviation (const Basic_color_iterator first, const Basic_color_iterator last, Basic_color< RGB_converter > *const mean_color) |
| Compute the variance of color set.
|
Static Public Attributes |
|
const Basic_color< RGB_converter > | black |
| Predefined color.
|
const Basic_color< RGB_converter > | grey |
| Predefined color.
|
const Basic_color< RGB_converter > | white |
| Predefined color.
|
const Basic_color< RGB_converter > | red |
| Predefined color.
|
const Basic_color< RGB_converter > | green |
| Predefined color.
|
const Basic_color< RGB_converter > | blue |
| Predefined color.
|
const Basic_color< RGB_converter > | cyan |
| Predefined color.
|
const Basic_color< RGB_converter > | magenta |
| Predefined color.
|
const Basic_color< RGB_converter > | yellow |
| Predefined color.
|
Friends |
std::ostream & | operator (std::ostream &s, const Basic_color< RGB_converter > &c) |
| "ASCII" output
|