1/* 2 * Copyright 2013 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * John Scipione, jscipione@gmail.com 7 * 8 * Corresponds to: 9 * headers/os/interface/GraphicsDefs.h hrev45737 10 * src/kits/interface/GraphicsDefs.cpp hrev45737 11 */ 12 13 14/*! 15 \file GraphicsDefs.h 16 \ingroup interface 17 \ingroup libbe 18 \brief Graphics-related functions and variables used by the Interface Kit. 19*/ 20 21 22/*! 23 \struct pattern 24 \ingroup interface 25 \ingroup libbe 26 \brief A pattern to use when drawing. 27 28 \since BeOS R3 29*/ 30 31 32/*! 33 \var B_SOLID_HIGH 34 35 Draw using the view's high color. 36 37 \since BeOS R3 38*/ 39 40 41/*! 42 \var B_MIXED_COLORS 43 44 Draw a pattern of the view's high and low colors. 45 46 \since BeOS R3 47*/ 48 49 50/*! 51 \var B_SOLID_LOW 52 53 Draw using the view's low color. 54 55 \since BeOS R3 56*/ 57 58 59/*! 60 \enum source_alpha 61 \ingroup interface 62 63 Blending alpha mode constants. 64 65 \since BeOS R3 66*/ 67 68 69/*! 70 \var source_alpha B_PIXEL_ALPHA 71 72 Use the alpha value of each pixel when drawing a bitmap. 73 74 \since BeOS R3 75*/ 76 77 78/*! 79 \var source_alpha B_CONSTANT_ALPHA 80 81 Use the alpha channel of the view's high color. 82 83 \since BeOS R3 84*/ 85 86 87/*! 88 \enum alpha_function 89 \ingroup interface 90 91 Blending alpha function constants. 92 93 \since BeOS R3 94*/ 95 96 97/*! 98 \var alpha_function B_ALPHA_OVERLAY 99 100 Used for drawing a image with transparency over an opaque background. 101 102 \since BeOS R3 103*/ 104 105 106/*! 107 \var alpha_function B_ALPHA_COMPOSITE 108 109 Used to composite two or more transparent images together offscreen to 110 produce a new image drawn using \c B_ALPHA_OVERLAY mode. 111 112 \since BeOS R3 113*/ 114 115 116/*! 117 \var alpha_function B_ALPHA_COMPOSITE_SOURCE_OVER 118 119 Draws source over destination preserving transparency. Same as 120 \c B_ALPHA_COMPOSITE. 121 122 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 123 -> 124 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 125 = 126 \image{inline} html B_ALPHA_COMPOSITE_SOURCE_OVER.png "Result" 127 128 \since Haiku R1 129*/ 130 131 132/*! 133 \var alpha_function B_ALPHA_COMPOSITE_SOURCE_IN 134 135 Draws source only where destination is not transparent. 136 137 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 138 -> 139 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 140 = 141 \image{inline} html B_ALPHA_COMPOSITE_SOURCE_IN.png "Result" 142 143 \since Haiku R1 144*/ 145 146 147/*! 148 \var alpha_function B_ALPHA_COMPOSITE_SOURCE_OUT 149 150 Draws source only where destination is transparent. 151 152 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 153 -> 154 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 155 = 156 \image{inline} html B_ALPHA_COMPOSITE_SOURCE_OUT.png "Result" 157 158 \since Haiku R1 159*/ 160 161 162/*! 163 \var alpha_function B_ALPHA_COMPOSITE_SOURCE_ATOP 164 165 Draws source only where destination is not transparent. Colors from both 166 are used in the result. 167 168 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 169 -> 170 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 171 = 172 \image{inline} html B_ALPHA_COMPOSITE_SOURCE_ATOP.png "Result" 173 174 \since Haiku R1 175*/ 176 177 178/*! 179 \var alpha_function B_ALPHA_COMPOSITE_DESTINATION_OVER 180 181 Draws source where destination is transparent, making it appear as if it 182 is drawn behind. 183 184 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 185 -> 186 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 187 = 188 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION_OVER.png "Result" 189 190 \since Haiku R1 191*/ 192 193 194/*! 195 \var alpha_function B_ALPHA_COMPOSITE_DESTINATION_IN 196 197 Blends source alpha channel with destination. 198 199 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 200 -> 201 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 202 = 203 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION_IN.png "Result" 204 205 \since Haiku R1 206*/ 207 208 209/*! 210 \var alpha_function B_ALPHA_COMPOSITE_DESTINATION_OUT 211 212 Blends inverse of source alpha channel with destination. Result appears as 213 if source was cut out of destination. 214 215 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 216 -> 217 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 218 = 219 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION_OUT.png "Result" 220 221 \since Haiku R1 222*/ 223 224 225/*! 226 \var alpha_function B_ALPHA_COMPOSITE_DESTINATION_ATOP 227 228 Draws source only where it is not transparent. Destination is blended on 229 top of it. Colors from both are used in the result. 230 231 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 232 -> 233 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 234 = 235 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION_ATOP.png "Result" 236 237 \since Haiku R1 238*/ 239 240 241/*! 242 \var alpha_function B_ALPHA_COMPOSITE_XOR 243 244 Result is transparent only where both source and destination are transparent 245 or opaque. 246 247 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 248 -> 249 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 250 = 251 \image{inline} html B_ALPHA_COMPOSITE_XOR.png "Result" 252 253 \since Haiku R1 254*/ 255 256 257/*! 258 \var alpha_function B_ALPHA_COMPOSITE_CLEAR 259 260 Erases destination to full transparency, regardless of source alpha value. 261 262 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 263 -> 264 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 265 = 266 \image{inline} html B_ALPHA_COMPOSITE_CLEAR.png "Result" 267 268 \since Haiku R1 269*/ 270 271 272/*! 273 \var alpha_function B_ALPHA_COMPOSITE_DIFFERENCE 274 275 Subtracts both inputs in a way that always yields positive result. 276 277 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 278 -> 279 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 280 = 281 \image{inline} html B_ALPHA_COMPOSITE_DIFFERENCE.png "Result" 282 283 \since Haiku R1 284*/ 285 286 287/*! 288 \var alpha_function B_ALPHA_COMPOSITE_LIGHTEN 289 290 Retains lighter pixels of both inputs. 291 292 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 293 -> 294 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 295 = 296 \image{inline} html B_ALPHA_COMPOSITE_LIGHTEN.png "Result" 297 298 \since Haiku R1 299*/ 300 301 302/*! 303 \var alpha_function B_ALPHA_COMPOSITE_DARKEN 304 305 Retains darker pixels of both inputs. 306 307 \image{inline} html B_ALPHA_COMPOSITE_SOURCE.png "Source" 308 -> 309 \image{inline} html B_ALPHA_COMPOSITE_DESTINATION.png "Destination" 310 = 311 \image{inline} html B_ALPHA_COMPOSITE_DARKEN.png "Result" 312 313 \since Haiku R1 314*/ 315