Loading...
Searching...
No Matches
Classes | Enumerations
GraphicsDefs.h File Reference

Graphics-related functions and variables used by the Interface Kit. More...

Classes

struct  pattern
 A pattern to use when drawing. More...
 
struct  rgb_color
 Structure representing a 32 bit RGBA color. More...
 

Enumerations

enum  alpha_function {
  B_ALPHA_OVERLAY = 0 ,
  B_ALPHA_COMPOSITE ,
  B_ALPHA_COMPOSITE_SOURCE_OVER = B_ALPHA_COMPOSITE ,
  B_ALPHA_COMPOSITE_SOURCE_IN ,
  B_ALPHA_COMPOSITE_SOURCE_OUT ,
  B_ALPHA_COMPOSITE_SOURCE_ATOP ,
  B_ALPHA_COMPOSITE_DESTINATION_OVER ,
  B_ALPHA_COMPOSITE_DESTINATION_IN ,
  B_ALPHA_COMPOSITE_DESTINATION_OUT ,
  B_ALPHA_COMPOSITE_DESTINATION_ATOP ,
  B_ALPHA_COMPOSITE_XOR ,
  B_ALPHA_COMPOSITE_CLEAR ,
  B_ALPHA_COMPOSITE_DIFFERENCE ,
  B_ALPHA_COMPOSITE_LIGHTEN ,
  B_ALPHA_COMPOSITE_DARKEN
}
 
enum  source_alpha {
  B_PIXEL_ALPHA = 0 ,
  B_CONSTANT_ALPHA
}
 

Patterns

const pattern B_MIXED_COLORS
 
const pattern B_SOLID_HIGH
 
const pattern B_SOLID_LOW
 
bool operator!= (const pattern &a, const pattern &b)
 Comparison operator for two patterns.
 
bool operator== (const pattern &a, const pattern &b)
 Comparison operator for two patterns.
 

RGB Colors

const rgb_color B_TRANSPARENT_32_BIT
 Transparent color.
 
const uint8 B_TRANSPARENT_8_BIT
 Transparent color.
 
const rgb_color B_TRANSPARENT_COLOR
 A transparent color.
 
const uint8 B_TRANSPARENT_MAGIC_CMAP8
 Transparent color.
 
const uint16 B_TRANSPARENT_MAGIC_RGBA15
 Transparent color.
 
const uint16 B_TRANSPARENT_MAGIC_RGBA15_BIG
 Transparent color.
 
const uint32 B_TRANSPARENT_MAGIC_RGBA32
 Transparent color.
 
const uint32 B_TRANSPARENT_MAGIC_RGBA32_BIG
 Transparent color.
 
rgb_color blend_color (rgb_color color1, rgb_color color2, uint8 amount)
 Mix two colors, respecting their alpha values.
 
rgb_color disable_color (rgb_color color, rgb_color background)
 Calculate a color for a disabled look.
 
rgb_color make_color (uint8 red, uint8 green, uint8 blue, uint8 alpha=255)
 Create a rgb_color from RGBA values.
 
rgb_color mix_color (rgb_color color1, rgb_color color2, uint8 amount)
 Mix two colors without respect for their alpha values.
 

Detailed Description

Graphics-related functions and variables used by the Interface Kit.

Enumeration Type Documentation

◆ alpha_function

Enumerator
B_ALPHA_OVERLAY 

Used for drawing a image with transparency over an opaque background.

Since
BeOS R3
B_ALPHA_COMPOSITE 

Used to composite two or more transparent images together offscreen to produce a new image drawn using B_ALPHA_OVERLAY mode.

Since
BeOS R3
B_ALPHA_COMPOSITE_SOURCE_OVER 

Draws source over destination preserving transparency. Same as B_ALPHA_COMPOSITE.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_SOURCE_IN 

Draws source only where destination is not transparent.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_SOURCE_OUT 

Draws source only where destination is transparent.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_SOURCE_ATOP 

Draws source only where destination is not transparent. Colors from both are used in the result.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_DESTINATION_OVER 

Draws source where destination is transparent, making it appear as if it is drawn behind.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_DESTINATION_IN 

Blends source alpha channel with destination.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_DESTINATION_OUT 

Blends inverse of source alpha channel with destination. Result appears as if source was cut out of destination.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_DESTINATION_ATOP 

Draws source only where it is not transparent. Destination is blended on top of it. Colors from both are used in the result.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_XOR 

Result is transparent only where both source and destination are transparent or opaque.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_CLEAR 

Erases destination to full transparency, regardless of source alpha value.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_DIFFERENCE 

Subtracts both inputs in a way that always yields positive result.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_LIGHTEN 

Retains lighter pixels of both inputs.

-> =

Since
Haiku R1
B_ALPHA_COMPOSITE_DARKEN 

Retains darker pixels of both inputs.

-> =

Since
Haiku R1

◆ source_alpha

Enumerator
B_PIXEL_ALPHA 

Use the alpha value of each pixel when drawing a bitmap.

Since
BeOS R3
B_CONSTANT_ALPHA 

Use the alpha channel of the view's high color.

Since
BeOS R3

Function Documentation

◆ blend_color()

rgb_color blend_color ( rgb_color  color1,
rgb_color  color2,
uint8  amount 
)

Mix two colors, respecting their alpha values.

Parameters
color1First color.
color2Second color.
amountThe relative weight of color1 to mix in.
Returns
The newly-mixed rgb_color.
Since
Haiku R1

◆ disable_color()

rgb_color disable_color ( rgb_color  color,
rgb_color  background 
)

Calculate a color for a disabled look.

Parameters
colorThe color that it would be if the use of your color is not disabled.
backgroundThe background on which will be drawn.
Returns
A newly-mixed rgb_color.
Since
Haiku R1

◆ make_color()

rgb_color make_color ( uint8  red,
uint8  green,
uint8  blue,
uint8  alpha = 255 
)
inline

Create a rgb_color from RGBA values.

Parameters
redThe value for red.
greenThe value for green.
blueThe value for blue.
alphaThe alpha value. Set to opaque by default.
Returns
A new rgb_color set to the selected colors.
Since
Haiku R1

◆ mix_color()

rgb_color mix_color ( rgb_color  color1,
rgb_color  color2,
uint8  amount 
)

Mix two colors without respect for their alpha values.

Parameters
color1First color.
color2Second color.
amountThe relative weight of color1 to mix in.
Returns
The newly-mixed rgb_color.
Since
Haiku R1

◆ operator!=()

bool operator!= ( const pattern a,
const pattern b 
)
inline

Comparison operator for two patterns.

Return values
trueThe patterns do not match
falseThe patterns match
Since
Haiku R1

◆ operator==()

bool operator== ( const pattern a,
const pattern b 
)
inline

Comparison operator for two patterns.

Return values
trueThe patterns match
falseThe patterns do not match
Since
Haiku R1

Variable Documentation

◆ B_MIXED_COLORS

B_MIXED_COLORS
extern

Draw a pattern of the view's high and low colors.

Since
BeOS R3

◆ B_SOLID_HIGH

B_SOLID_HIGH
extern

Draw using the view's high color.

Since
BeOS R3

◆ B_SOLID_LOW

B_SOLID_LOW
extern

Draw using the view's low color.

Since
BeOS R3

◆ B_TRANSPARENT_32_BIT

const rgb_color B_TRANSPARENT_32_BIT
extern

Transparent color.

Since
BeOS R3

◆ B_TRANSPARENT_8_BIT

const uint8 B_TRANSPARENT_8_BIT
extern

Transparent color.

Since
BeOS R3

◆ B_TRANSPARENT_COLOR

const rgb_color B_TRANSPARENT_COLOR
extern

A transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_CMAP8

const uint8 B_TRANSPARENT_MAGIC_CMAP8
extern

Transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_RGBA15

const uint16 B_TRANSPARENT_MAGIC_RGBA15
extern

Transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_RGBA15_BIG

const uint16 B_TRANSPARENT_MAGIC_RGBA15_BIG
extern

Transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_RGBA32

const uint32 B_TRANSPARENT_MAGIC_RGBA32
extern

Transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_RGBA32_BIG

const uint32 B_TRANSPARENT_MAGIC_RGBA32_BIG
extern

Transparent color.

Since
Haiku R1