colours.h
Go to the documentation of this file.00001
#ifndef DEF_COLOURS
00002
#define DEF_COLOURS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#include <volume_io.h>
00020
00021 #define COMPOSITE_COLOURS( result, front, back ) \
00022
{ \
00023
int _rf, _gf, _bf, _af, _rb, _gb, _bb, _ab, _weight; \
00024
int _r, _g, _b, _a; \
00025
_af = get_Colour_a(front); \
00026
_ab = get_Colour_a(back); \
00027
if( _af == 255 || _ab == 0 ) \
00028
(result) = front; \
00029
else if( _af == 0 ) \
00030
(result) = back; \
00031
else \
00032
{ \
00033
_rf = get_Colour_r(front); \
00034
_gf = get_Colour_g(front); \
00035
_bf = get_Colour_b(front); \
00036
_rb = get_Colour_r(back); \
00037
_gb = get_Colour_g(back); \
00038
_bb = get_Colour_b(back); \
00039
_weight = (255 - _af) * _ab; \
00040
_af *= 255; \
00041
_r = _af * _rf + _weight * _rb; \
00042
_g = _af * _gf + _weight * _gb; \
00043
_b = _af * _bf + _weight * _bb; \
00044
_a = _af + _weight; \
00045
if( _a > 0 ) \
00046
{ \
00047
_r /= _a; \
00048
_g /= _a; \
00049
_b /= _a; \
00050
_a /= 255; \
00051
} \
00052
(result) = make_rgba_Colour( _r, _g, _b, _a ); \
00053
} \
00054
}
00055
00056 typedef enum {
RGB_SPACE,
HSL_SPACE }
Colour_spaces;
00057
00058
#undef BLACK
00059
#undef RED
00060
#undef GREEN
00061
#undef BLUE
00062
#undef CYAN
00063
#undef MAGENTA
00064
#undef YELLOW
00065
#undef WHITE
00066
00067 #define ALICE_BLUE make_Colour_0_1( 0.941176, 0.972549, 1.0 )
00068 #define ANTIQUE_WHITE make_Colour_0_1( 0.980392, 0.921569, 0.843137 )
00069 #define AQUAMARINE make_Colour_0_1( 0.498039, 1.0, 0.831373 )
00070 #define AZURE make_Colour_0_1( 0.941176, 1.0, 1.0 )
00071 #define BEIGE make_Colour_0_1( 0.960784, 0.960784, 0.862745 )
00072 #define BISQUE make_Colour_0_1( 1.0, 0.894118, 0.768627 )
00073 #define BLACK make_Colour_0_1( 0.0, 0.0, 0.0 )
00074 #define BLANCHED_ALMOND make_Colour_0_1( 1.0, 0.921569, 0.803922 )
00075 #define BLUE make_Colour_0_1( 0.0, 0.0, 1.0 )
00076 #define BLUE_VIOLET make_Colour_0_1( 0.541176, 0.168627, 0.886275 )
00077 #define BRIGHT_MUSTARD make_Colour_0_1( 1.0, 0.752941, 0.188235 )
00078 #define BROWN make_Colour_0_1( 1.0, 0.25098, 0.25098 )
00079 #define BURLYWOOD make_Colour_0_1( 0.870588, 0.721569, 0.529412 )
00080 #define CADET_BLUE make_Colour_0_1( 0.372549, 0.619608, 0.627451 )
00081 #define CHARTREUSE make_Colour_0_1( 0.498039, 1.0, 0.0 )
00082 #define CHOCOLATE make_Colour_0_1( 0.823529, 0.411765, 0.117647 )
00083 #define CORAL make_Colour_0_1( 1.0, 0.447059, 0.337255 )
00084 #define CORNFLOWER_BLUE make_Colour_0_1( 0.392157, 0.584314, 0.929412 )
00085 #define CORNSILK make_Colour_0_1( 1.0, 0.972549, 0.862745 )
00086 #define CYAN make_Colour_0_1( 0.0, 1.0, 1.0 )
00087 #define DARK_BROWN make_Colour_0_1( 0.313725, 0.156863, 0.117647 )
00088 #define DARK_FIREBRICK make_Colour_0_1( 0.52549, 0.101961, 0.101961 )
00089 #define DARK_GOLDENROD make_Colour_0_1( 1.0, 0.72549, 0.0588235 )
00090 #define DARK_GREEN make_Colour_0_1( 0.0, 0.392157, 0.0 )
00091 #define DARK_KHAKI make_Colour_0_1( 0.741176, 0.717647, 0.419608 )
00092 #define DARK_OLIVE_GREEN make_Colour_0_1( 0.792157, 1.0, 0.439216 )
00093 #define DARK_ORANGE make_Colour_0_1( 1.0, 0.54902, 0.0 )
00094 #define DARK_ORCHID make_Colour_0_1( 0.74902, 0.243137, 1.0 )
00095 #define DARK_RED make_Colour_0_1( 0.501961, 0.0, 0.0 )
00096 #define DARK_SALMON make_Colour_0_1( 0.913725, 0.588235, 0.478431 )
00097 #define DARK_SEA_GREEN make_Colour_0_1( 0.756863, 1.0, 0.756863 )
00098 #define DARK_SLATE_BLUE make_Colour_0_1( 0.282353, 0.239216, 0.545098 )
00099 #define DARK_SLATE_GRAY make_Colour_0_1( 0.592157, 1.0, 1.0 )
00100 #define DARK_SLATE_GREY make_Colour_0_1( 0.184314, 0.309804, 0.309804 )
00101 #define DARK_TURQUOISE make_Colour_0_1( 0.0, 0.807843, 0.819608 )
00102 #define DARK_VIOLET make_Colour_0_1( 0.580392, 0.0, 0.827451 )
00103 #define DEEP_PINK make_Colour_0_1( 1.0, 0.0784314, 0.576471 )
00104 #define DEEP_SKY_BLUE make_Colour_0_1( 0.0, 0.74902, 1.0 )
00105 #define DIM_GRAY make_Colour_0_1( 0.411765, 0.411765, 0.411765 )
00106 #define DIM_GREY make_Colour_0_1( 0.411765, 0.411765, 0.411765 )
00107 #define DODGER_BLUE make_Colour_0_1( 0.117647, 0.564706, 1.0 )
00108 #define FIREBRICK make_Colour_0_1( 0.698039, 0.133333, 0.133333 )
00109 #define FLORAL_WHITE make_Colour_0_1( 1.0, 0.980392, 0.941176 )
00110 #define FOREST_GREEN make_Colour_0_1( 0.133333, 0.545098, 0.133333 )
00111 #define GAINSBORO make_Colour_0_1( 0.862745, 0.862745, 0.862745 )
00112 #define GHOST_WHITE make_Colour_0_1( 0.972549, 0.972549, 1.0 )
00113 #define GOLDENROD make_Colour_0_1( 1.0, 0.756863, 0.145098 )
00114 #define GOLD make_Colour_0_1( 1.0, 0.843137, 0.0 )
00115 #define GRAY make_Colour_0_1( 0.752941, 0.752941, 0.752941 )
00116 #define GREEN make_Colour_0_1( 0.0, 1.0, 0.0 )
00117 #define GREEN_YELLOW make_Colour_0_1( 0.678431, 1.0, 0.184314 )
00118 #define GREY make_Colour_0_1( 0.752941, 0.752941, 0.752941 )
00119 #define HONEYDEW make_Colour_0_1( 0.941176, 1.0, 0.941176 )
00120 #define HOT_PINK make_Colour_0_1( 1.0, 0.431373, 0.705882 )
00121 #define INDIAN_RED make_Colour_0_1( 1.0, 0.415686, 0.415686 )
00122 #define IVORY make_Colour_0_1( 1.0, 1.0, 0.941176 )
00123 #define KHAKI make_Colour_0_1( 1.0, 0.964706, 0.560784 )
00124 #define LAVENDER_BLUSH make_Colour_0_1( 1.0, 0.941176, 0.960784 )
00125 #define LAVENDER make_Colour_0_1( 0.901961, 0.901961, 0.980392 )
00126 #define LAWN_GREEN make_Colour_0_1( 0.486275, 0.988235, 0.0 )
00127 #define LEMON_CHIFFON make_Colour_0_1( 1.0, 0.980392, 0.803922 )
00128 #define LIGHT_BLUE make_Colour_0_1( 0.74902, 0.937255, 1.0 )
00129 #define LIGHT_CORAL make_Colour_0_1( 0.941176, 0.501961, 0.501961 )
00130 #define LIGHT_CYAN make_Colour_0_1( 0.878431, 1.0, 1.0 )
00131 #define LIGHT_GOLDENROD make_Colour_0_1( 1.0, 0.92549, 0.545098 )
00132 #define LIGHT_GOLDENROD_YELLOW make_Colour_0_1( 0.980392, 0.980392, 0.823529 )
00133 #define LIGHT_GRAY make_Colour_0_1( 0.827451, 0.827451, 0.827451 )
00134 #define LIGHT_GREY make_Colour_0_1( 0.827451, 0.827451, 0.827451 )
00135 #define LIGHT_PINK make_Colour_0_1( 1.0, 0.713725, 0.756863 )
00136 #define LIGHT_SALMON make_Colour_0_1( 1.0, 0.627451, 0.478431 )
00137 #define LIGHT_SEA_GREEN make_Colour_0_1( 0.12549, 0.698039, 0.666667 )
00138 #define LIGHT_SKY_BLUE make_Colour_0_1( 0.529412, 0.807843, 0.980392 )
00139 #define LIGHT_SLATE_BLUE make_Colour_0_1( 0.517647, 0.439216, 1.0 )
00140 #define LIGHT_SLATE_GRAY make_Colour_0_1( 0.466667, 0.533333, 0.6 )
00141 #define LIGHT_SLATE_GREY make_Colour_0_1( 0.466667, 0.533333, 0.6 )
00142 #define LIGHT_STEEL_BLUE make_Colour_0_1( 0.792157, 0.882353, 1.0 )
00143 #define LIGHT_YELLOW make_Colour_0_1( 1.0, 1.0, 0.878431 )
00144 #define LIME_GREEN make_Colour_0_1( 0.196078, 0.803922, 0.196078 )
00145 #define LINEN make_Colour_0_1( 0.980392, 0.941176, 0.901961 )
00146 #define MAGENTA make_Colour_0_1( 1.0, 0.0, 1.0 )
00147 #define MAROON make_Colour_0_1( 1.0, 0.203922, 0.701961 )
00148 #define MEDIUM_AQUAMARINE make_Colour_0_1( 0.4, 0.803922, 0.666667 )
00149 #define MEDIUM_BLUE make_Colour_0_1( 0.0, 0.0, 0.803922 )
00150 #define MEDIUM_ORCHID make_Colour_0_1( 0.729412, 0.333333, 0.827451 )
00151 #define MEDIUM_PURPLE make_Colour_0_1( 0.670588, 0.509804, 1.0 )
00152 #define MEDIUM_SEA_GREEN make_Colour_0_1( 0.235294, 0.701961, 0.443137 )
00153 #define MEDIUM_SLATE_BLUE make_Colour_0_1( 0.482353, 0.407843, 0.933333 )
00154 #define MEDIUM_SPRING_GREEN make_Colour_0_1( 0.0, 0.980392, 0.603922 )
00155 #define MEDIUM_TURQUOISE make_Colour_0_1( 0.282353, 0.819608, 0.8 )
00156 #define MEDIUM_VIOLET_RED make_Colour_0_1( 0.780392, 0.0823529, 0.521569 )
00157 #define MIAMI_PINK make_Colour_0_1( 1.0, 0.501961, 0.564706 )
00158 #define MIAMI_TURQUOISE make_Colour_0_1( 0.313725, 1.0, 1.0 )
00159 #define MIDNIGHT_BLUE make_Colour_0_1( 0.0980392, 0.0980392, 0.439216 )
00160 #define MINT_CREAM make_Colour_0_1( 0.960784, 1.0, 0.980392 )
00161 #define MISTY_ROSE make_Colour_0_1( 1.0, 0.894118, 0.882353 )
00162 #define MOCCASIN make_Colour_0_1( 1.0, 0.894118, 0.709804 )
00163 #define NAVAJO_WHITE make_Colour_0_1( 1.0, 0.870588, 0.678431 )
00164 #define NAVY_BLUE make_Colour_0_1( 0.0, 0.0, 0.501961 )
00165 #define NAVY make_Colour_0_1( 0.0, 0.0, 0.501961 )
00166 #define OLD_LACE make_Colour_0_1( 0.992157, 0.960784, 0.901961 )
00167 #define OLIVE_DRAB make_Colour_0_1( 0.419608, 0.556863, 0.137255 )
00168 #define ORANGE make_Colour_0_1( 1.0, 0.647059, 0.0 )
00169 #define ORANGE_RED make_Colour_0_1( 1.0, 0.270588, 0.0 )
00170 #define ORCHID make_Colour_0_1( 0.854902, 0.439216, 0.839216 )
00171 #define PALE_GOLDENROD make_Colour_0_1( 0.933333, 0.909804, 0.666667 )
00172 #define PALE_GREEN make_Colour_0_1( 0.603922, 1.0, 0.603922 )
00173 #define PALE_TURQUOISE make_Colour_0_1( 0.733333, 1.0, 1.0 )
00174 #define PALE_VIOLET_RED make_Colour_0_1( 1.0, 0.509804, 0.670588 )
00175 #define PAPAYA_WHIP make_Colour_0_1( 1.0, 0.937255, 0.835294 )
00176 #define PEACH_PUFF make_Colour_0_1( 1.0, 0.854902, 0.72549 )
00177 #define PERU make_Colour_0_1( 0.803922, 0.521569, 0.247059 )
00178 #define PINK make_Colour_0_1( 1.0, 0.752941, 0.796078 )
00179 #define PLUM make_Colour_0_1( 1.0, 0.733333, 1.0 )
00180 #define POWDER_BLUE make_Colour_0_1( 0.690196, 0.878431, 0.901961 )
00181 #define PURPLE make_Colour_0_1( 0.627451, 0.12549, 0.941176 )
00182 #define RED make_Colour_0_1( 1.0, 0.0, 0.0 )
00183 #define ROSY_BROWN make_Colour_0_1( 1.0, 0.756863, 0.756863 )
00184 #define ROYAL_BLUE make_Colour_0_1( 0.282353, 0.462745, 1.0 )
00185 #define SADDLE_BROWN make_Colour_0_1( 0.545098, 0.270588, 0.0745098 )
00186 #define SALMON make_Colour_0_1( 1.0, 0.54902, 0.411765 )
00187 #define SANDY_BROWN make_Colour_0_1( 0.956863, 0.643137, 0.376471 )
00188 #define SEASHELL make_Colour_0_1( 1.0, 0.960784, 0.933333 )
00189 #define SEA_GREEN make_Colour_0_1( 0.329412, 1.0, 0.623529 )
00190 #define SIENNA make_Colour_0_1( 1.0, 0.509804, 0.278431 )
00191 #define SKY_BLUE make_Colour_0_1( 0.529412, 0.807843, 1.0 )
00192 #define SLATE_BLUE make_Colour_0_1( 0.513725, 0.435294, 1.0 )
00193 #define SLATE_GRAY make_Colour_0_1( 0.776471, 0.886275, 1.0 )
00194 #define SLATE_GREY make_Colour_0_1( 0.439216, 0.501961, 0.564706 )
00195 #define SNOW make_Colour_0_1( 1.0, 0.980392, 0.980392 )
00196 #define SPRING_GREEN make_Colour_0_1( 0.0, 1.0, 0.498039 )
00197 #define STEEL_BLUE make_Colour_0_1( 0.388235, 0.721569, 1.0 )
00198 #define TAN make_Colour_0_1( 1.0, 0.647059, 0.309804 )
00199 #define THISTLE make_Colour_0_1( 1.0, 0.882353, 1.0 )
00200 #define TOMATO make_Colour_0_1( 1.0, 0.388235, 0.278431 )
00201 #define TURQUOISE make_Colour_0_1( 0.25098, 0.878431, 0.815686 )
00202 #define VIOLET make_Colour_0_1( 0.933333, 0.509804, 0.933333 )
00203 #define VIOLET_RED make_Colour_0_1( 1.0, 0.243137, 0.588235 )
00204 #define WHEAT make_Colour_0_1( 1.0, 0.905882, 0.729412 )
00205 #define WHITE make_Colour_0_1( 1.0, 1.0, 1.0 )
00206 #define WHITE_SMOKE make_Colour_0_1( 0.960784, 0.960784, 0.960784 )
00207 #define YELLOW make_Colour_0_1( 1.0, 1.0, 0.0 )
00208 #define YELLOW_GREEN make_Colour_0_1( 0.603922, 0.803922, 0.196078 )
00209
00210
#endif
Generated on Wed Jul 28 09:10:56 2004 for BICPL by
1.3.7