Classes
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...
 

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. More...
 
bool operator== (const pattern &a, const pattern &b)
 Comparison operator for two patterns. More...
 

RGB Colors

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

Drawing Modes

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
}
 

Detailed Description

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

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

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

Since
BeOS R3

◆ B_SOLID_HIGH

B_SOLID_HIGH

Draw using the view's high color.

Since
BeOS R3

◆ B_SOLID_LOW

B_SOLID_LOW

Draw using the view's low color.

Since
BeOS R3

◆ B_TRANSPARENT_32_BIT

const rgb_color B_TRANSPARENT_32_BIT

Transparent color.

Since
BeOS R3

◆ B_TRANSPARENT_8_BIT

const uint8 B_TRANSPARENT_8_BIT

Transparent color.

Since
BeOS R3

◆ B_TRANSPARENT_COLOR

const rgb_color B_TRANSPARENT_COLOR

A transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_CMAP8

const uint8 B_TRANSPARENT_MAGIC_CMAP8

Transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_RGBA15

const uint16 B_TRANSPARENT_MAGIC_RGBA15

Transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_RGBA15_BIG

const uint16 B_TRANSPARENT_MAGIC_RGBA15_BIG

Transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_RGBA32

const uint32 B_TRANSPARENT_MAGIC_RGBA32

Transparent color.

Since
Haiku R1

◆ B_TRANSPARENT_MAGIC_RGBA32_BIG

const uint32 B_TRANSPARENT_MAGIC_RGBA32_BIG

Transparent color.

Since
Haiku R1