|
NetSurf
|
plotter style interfaces, generic styles and style colour helpers. More...
Go to the source code of this file.
Data Structures | |
| struct | plot_style_s |
| Plot style for stroke/fill plotters. More... | |
| struct | plot_font_style |
| Font style for plotting. More... | |
Macros | |
| #define | WIDGET_BASEC 0xd9d9d9 |
| light grey widget base colour More... | |
| #define | WIDGET_BLOBC 0x000000 |
| black blob colour More... | |
| #define | NS_TRANSPARENT 0x01000000 |
| Transparent colour value. More... | |
| #define | PLOT_STYLE_RADIX (10) |
| 22:10 fixed point More... | |
| #define | PLOT_STYLE_SCALE (1 << PLOT_STYLE_RADIX) |
| Scaling factor for plot styles. More... | |
| #define | plot_style_int_to_fixed(v) ((v) << PLOT_STYLE_RADIX) |
| #define | plot_style_fixed_to_int(v) ((v) >> PLOT_STYLE_RADIX) |
| #define | plot_style_fixed_to_float(v) (((float)v) / PLOT_STYLE_SCALE) |
| #define | plot_style_fixed_to_double(v) (((double)v) / PLOT_STYLE_SCALE) |
| #define | half_darken_colour(c1) |
| #define | darken_colour(c1) |
| #define | double_darken_colour(c1) |
| #define | half_lighten_colour(c1) |
| #define | lighten_colour(c1) |
| #define | double_lighten_colour(c1) |
| #define | blend_colour(c0, c1) |
| #define | colour_lightness(c0) |
| Obtain the luminance of a colour according to ITU BT.601. More... | |
| #define | colour_to_bw_nearest(c0) ((colour_lightness(c0) > (0xff / 2)) ? 0xffffff : 0x000000) |
| #define | colour_to_bw_furthest(c0) ((colour_lightness(c0) > (0xff / 2)) ? 0x000000 : 0xffffff) |
| #define | mix_colour(c0, c1, p) |
| #define | red_from_colour(c) ((c ) & 0xff) |
| #define | green_from_colour(c) ((c >> 8) & 0xff) |
| #define | blue_from_colour(c) ((c >> 16) & 0xff) |
| #define | colour_rb_swap(c) |
Typedefs | |
| typedef int32_t | plot_style_fixed |
| typedef struct plot_style_s | plot_style_t |
| Plot style for stroke/fill plotters. More... | |
| typedef struct plot_font_style | plot_font_style_t |
| Font style for plotting. More... | |
Enumerations | |
| enum | plot_operation_type_t { PLOT_OP_TYPE_NONE = 0 , PLOT_OP_TYPE_SOLID , PLOT_OP_TYPE_DOT , PLOT_OP_TYPE_DASH } |
| Type of plot operation. More... | |
| enum | plot_font_generic_family_t { PLOT_FONT_FAMILY_SANS_SERIF = 0 , PLOT_FONT_FAMILY_SERIF , PLOT_FONT_FAMILY_MONOSPACE , PLOT_FONT_FAMILY_CURSIVE , PLOT_FONT_FAMILY_FANTASY , PLOT_FONT_FAMILY_COUNT } |
| Generic font family type. More... | |
| enum | plot_font_flags_t { FONTF_NONE = 0 , FONTF_ITALIC = 1 , FONTF_OBLIQUE = 2 , FONTF_SMALLCAPS = 4 } |
| Font plot flags. More... | |
| enum | plot_colour_component { PLOT_COLOUR_COMPONENT_RED , PLOT_COLOUR_COMPONENT_GREEN , PLOT_COLOUR_COMPONENT_BLUE , PLOT_COLOUR_COMPONENT_ALPHA } |
| Colour components. More... | |
Functions | |
| static colour | colour_engorge_component (colour col, bool dark, enum plot_colour_component comp) |
| Engorge a particular colour channel. More... | |
plotter style interfaces, generic styles and style colour helpers.
Definition in file plot_style.h.
| #define blend_colour | ( | c0, | |
| c1 | |||
| ) |
Definition at line 163 of file plot_style.h.
| #define blue_from_colour | ( | c | ) | ((c >> 16) & 0xff) |
Definition at line 213 of file plot_style.h.
| #define colour_lightness | ( | c0 | ) |
Obtain the luminance of a colour according to ITU BT.601.
ITU BT.601 formula is Y = 0.299 R + 0.587 G + 0.114 B actual values are Y = 76/255 R + 150/255 G + 29/255 B Y = 0.298 R + 0.588 G + 0.113 B
Definition at line 181 of file plot_style.h.
| #define colour_rb_swap | ( | c | ) |
Definition at line 217 of file plot_style.h.
| #define colour_to_bw_furthest | ( | c0 | ) | ((colour_lightness(c0) > (0xff / 2)) ? 0x000000 : 0xffffff) |
Definition at line 193 of file plot_style.h.
| #define colour_to_bw_nearest | ( | c0 | ) | ((colour_lightness(c0) > (0xff / 2)) ? 0xffffff : 0x000000) |
Definition at line 188 of file plot_style.h.
| #define darken_colour | ( | c1 | ) |
Definition at line 133 of file plot_style.h.
| #define double_darken_colour | ( | c1 | ) |
Definition at line 138 of file plot_style.h.
| #define double_lighten_colour | ( | c1 | ) |
Definition at line 156 of file plot_style.h.
| #define green_from_colour | ( | c | ) | ((c >> 8) & 0xff) |
Definition at line 209 of file plot_style.h.
| #define half_darken_colour | ( | c1 | ) |
Definition at line 128 of file plot_style.h.
| #define half_lighten_colour | ( | c1 | ) |
Definition at line 144 of file plot_style.h.
| #define lighten_colour | ( | c1 | ) |
Definition at line 150 of file plot_style.h.
| #define mix_colour | ( | c0, | |
| c1, | |||
| p | |||
| ) |
Definition at line 198 of file plot_style.h.
| #define NS_TRANSPARENT 0x01000000 |
Transparent colour value.
Definition at line 39 of file plot_style.h.
| #define plot_style_fixed_to_double | ( | v | ) | (((double)v) / PLOT_STYLE_SCALE) |
Definition at line 60 of file plot_style.h.
| #define plot_style_fixed_to_float | ( | v | ) | (((float)v) / PLOT_STYLE_SCALE) |
Definition at line 57 of file plot_style.h.
| #define plot_style_fixed_to_int | ( | v | ) | ((v) >> PLOT_STYLE_RADIX) |
Definition at line 54 of file plot_style.h.
| #define plot_style_int_to_fixed | ( | v | ) | ((v) << PLOT_STYLE_RADIX) |
Definition at line 51 of file plot_style.h.
| #define PLOT_STYLE_RADIX (10) |
22:10 fixed point
Definition at line 42 of file plot_style.h.
| #define PLOT_STYLE_SCALE (1 << PLOT_STYLE_RADIX) |
Scaling factor for plot styles.
Definition at line 45 of file plot_style.h.
| #define red_from_colour | ( | c | ) | ((c ) & 0xff) |
Definition at line 205 of file plot_style.h.
| #define WIDGET_BASEC 0xd9d9d9 |
light grey widget base colour
Definition at line 33 of file plot_style.h.
| #define WIDGET_BLOBC 0x000000 |
black blob colour
Definition at line 36 of file plot_style.h.
| typedef struct plot_font_style plot_font_style_t |
Font style for plotting.
| typedef int32_t plot_style_fixed |
Definition at line 48 of file plot_style.h.
| typedef struct plot_style_s plot_style_t |
Plot style for stroke/fill plotters.
Colour components.
| Enumerator | |
|---|---|
| PLOT_COLOUR_COMPONENT_RED | |
| PLOT_COLOUR_COMPONENT_GREEN | |
| PLOT_COLOUR_COMPONENT_BLUE | |
| PLOT_COLOUR_COMPONENT_ALPHA | |
Definition at line 223 of file plot_style.h.
| enum plot_font_flags_t |
Font plot flags.
| Enumerator | |
|---|---|
| FONTF_NONE | |
| FONTF_ITALIC | |
| FONTF_OBLIQUE | |
| FONTF_SMALLCAPS | |
Definition at line 101 of file plot_style.h.
Generic font family type.
| Enumerator | |
|---|---|
| PLOT_FONT_FAMILY_SANS_SERIF | |
| PLOT_FONT_FAMILY_SERIF | |
| PLOT_FONT_FAMILY_MONOSPACE | |
| PLOT_FONT_FAMILY_CURSIVE | |
| PLOT_FONT_FAMILY_FANTASY | |
| PLOT_FONT_FAMILY_COUNT | Number of generic families. |
Definition at line 88 of file plot_style.h.
Type of plot operation.
| Enumerator | |
|---|---|
| PLOT_OP_TYPE_NONE | No operation. |
| PLOT_OP_TYPE_SOLID | Solid colour. |
| PLOT_OP_TYPE_DOT | Dotted plot. |
| PLOT_OP_TYPE_DASH | Dashed plot. |
Definition at line 65 of file plot_style.h.
|
inlinestatic |
Engorge a particular colour channel.
| [in] | col | The colour to engorge a component of. |
| [in] | dark | Whether col is a dark colour. |
| [in] | comp | Colour component to engorge. |
Definition at line 237 of file plot_style.h.
References darken_colour, double_darken_colour, double_lighten_colour, lighten_colour, PLOT_COLOUR_COMPONENT_ALPHA, PLOT_COLOUR_COMPONENT_BLUE, PLOT_COLOUR_COMPONENT_GREEN, and PLOT_COLOUR_COMPONENT_RED.
Referenced by nscolour__get().
|
extern |
Definition at line 90 of file plot_style.c.
Referenced by html_redraw_box().
|
extern |
Definition at line 79 of file plot_style.c.
Referenced by html_redraw_box().
|
extern |
Definition at line 98 of file plot_style.c.
|
extern |
Definition at line 52 of file plot_style.c.
Referenced by html_redraw_box().
|
extern |
Definition at line 38 of file plot_style.c.
Referenced by ro_gui_status_bar_redraw(), and textplain_redraw().
|
extern |
Definition at line 116 of file plot_style.c.
Referenced by html_redraw_radio().
|
extern |
Definition at line 123 of file plot_style.c.
Referenced by form_redraw_select_menu(), and html_redraw_radio().
|
extern |
Definition at line 44 of file plot_style.c.
Referenced by ro_gui_progress_bar_redraw_window().
|
extern |
Definition at line 109 of file plot_style.c.
Referenced by html_redraw_checkbox(), and html_redraw_radio().
|
extern |
Definition at line 131 of file plot_style.c.
Referenced by html_redraw_checkbox(), and html_redraw_radio().
|
extern |
Definition at line 32 of file plot_style.c.
Referenced by browser_window_redraw(), content_scaled_redraw(), text_draw(), text_redraw(), and textplain_redraw().
|
extern |
Definition at line 165 of file plot_style.c.
Referenced by amiga_plugin_hack_redraw(), redraw_entry(), and svg_redraw_internal().
|
extern |
Definition at line 68 of file plot_style.c.
Referenced by html_redraw_box().
|
extern |
Definition at line 60 of file plot_style.c.
Referenced by html_redraw_box().
|
extern |
Definition at line 146 of file plot_style.c.
Referenced by form_redraw_select_menu(), and html_redraw_checkbox().
|
extern |
Definition at line 153 of file plot_style.c.
Referenced by html_redraw_checkbox().
|
extern |
Definition at line 139 of file plot_style.c.
Referenced by html_redraw_checkbox().