#include <libspectre/spectre-macros.h>
Go to the source code of this file.
|
SPECTRE_PUBLIC SpectreRenderContext * | spectre_render_context_new (void) |
|
SPECTRE_PUBLIC void | spectre_render_context_free (SpectreRenderContext *rc) |
|
SPECTRE_PUBLIC void | spectre_render_context_set_scale (SpectreRenderContext *rc, double x_scale, double y_scale) |
|
SPECTRE_PUBLIC void | spectre_render_context_get_scale (SpectreRenderContext *rc, double *x_scale, double *y_scale) |
|
SPECTRE_PUBLIC void | spectre_render_context_set_rotation (SpectreRenderContext *rc, unsigned int rotation) |
|
SPECTRE_PUBLIC unsigned int | spectre_render_context_get_rotation (SpectreRenderContext *rc) |
|
SPECTRE_PUBLIC void | spectre_render_context_set_resolution (SpectreRenderContext *rc, double x_dpi, double y_dpi) |
|
SPECTRE_PUBLIC void | spectre_render_context_get_resolution (SpectreRenderContext *rc, double *x_dpi, double *y_dpi) |
|
SPECTRE_PUBLIC void | spectre_render_context_set_page_size (SpectreRenderContext *rc, int width, int height) |
|
SPECTRE_PUBLIC void | spectre_render_context_get_page_size (SpectreRenderContext *rc, int *width, int *height) |
|
SPECTRE_PUBLIC void | spectre_render_context_set_use_platform_fonts (SpectreRenderContext *rc, int use_platform_fonts) |
|
SPECTRE_PUBLIC int | spectre_render_context_get_use_platform_fonts (SpectreRenderContext *rc) |
|
SPECTRE_PUBLIC void | spectre_render_context_set_antialias_bits (SpectreRenderContext *rc, int graphics_bits, int text_bits) |
|
SPECTRE_PUBLIC void | spectre_render_context_get_antialias_bits (SpectreRenderContext *rc, int *graphics_bits, int *text_bits) |
|
◆ SpectreRenderContext
This object defines how a page will be rendered
◆ spectre_render_context_free()
Frees a rendering context
- Parameters
-
rc | The rendering context to free |
◆ spectre_render_context_get_antialias_bits()
SPECTRE_PUBLIC void spectre_render_context_get_antialias_bits |
( |
SpectreRenderContext * |
rc, |
|
|
int * |
graphics_bits, |
|
|
int * |
text_bits |
|
) |
| |
Gets the antialias options for graphics and texts
- Parameters
-
rc | The rendering context to query |
graphics_bits | The number of antialias bits to use for graphics will be stored here |
text_bits | The number of antialias bits to use for text will be stored here |
◆ spectre_render_context_get_page_size()
SPECTRE_PUBLIC void spectre_render_context_get_page_size |
( |
SpectreRenderContext * |
rc, |
|
|
int * |
width, |
|
|
int * |
height |
|
) |
| |
Gets the page size in pixels
- Parameters
-
rc | The rendering context to query |
width | the width of the page will be stored here, or NULL |
height | the height of the page will be stored here, or NULL |
◆ spectre_render_context_get_resolution()
SPECTRE_PUBLIC void spectre_render_context_get_resolution |
( |
SpectreRenderContext * |
rc, |
|
|
double * |
x_dpi, |
|
|
double * |
y_dpi |
|
) |
| |
Gets the resolution
- Parameters
-
rc | The rendering context to query |
x_dpi | the horizontal resolution will be stored here, or NULL |
y_dpi | the vertical resolution will be stored here, or NULL |
◆ spectre_render_context_get_rotation()
Gets the rotation
- Parameters
-
rc | The rendering context to query |
◆ spectre_render_context_get_scale()
SPECTRE_PUBLIC void spectre_render_context_get_scale |
( |
SpectreRenderContext * |
rc, |
|
|
double * |
x_scale, |
|
|
double * |
y_scale |
|
) |
| |
Gets the scale
- Parameters
-
rc | The rendering context to query |
x_scale | The scale factor for the X dimension will be stored here, or NULL |
y_scale | The scale factor for the Y dimension will be stored here, or NULL |
◆ spectre_render_context_get_use_platform_fonts()
Gets whether to use the platform fonts when rendering or not
- Parameters
-
rc | The rendering context to query |
◆ spectre_render_context_new()
Creates a rendering context
◆ spectre_render_context_set_antialias_bits()
SPECTRE_PUBLIC void spectre_render_context_set_antialias_bits |
( |
SpectreRenderContext * |
rc, |
|
|
int |
graphics_bits, |
|
|
int |
text_bits |
|
) |
| |
Sets the antialias options for graphics and texts. The default is 4 for graphics and 2 for text
- Parameters
-
rc | The rendering context to modify |
graphics_bits | The number of antialias bits to use for graphics. Typically 4 for antialias and 1 for no antialias |
text_bits | The number of antialias bits to use for text. Typically 2 for antialias and 1 for no antialias |
◆ spectre_render_context_set_page_size()
SPECTRE_PUBLIC void spectre_render_context_set_page_size |
( |
SpectreRenderContext * |
rc, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Sets the page size in pixels. Rotation shouldn't be considered, the page size will be automatically adjusted when rendering according to the rotation selected. Note that the page size doesn't affect the scale. If no page size is given the page bounding box will be used, or the rectangle given when using spectre_page_render_slice
- Parameters
-
rc | The rendering context to modify |
width | the width of the page |
height | the height of the page |
◆ spectre_render_context_set_resolution()
SPECTRE_PUBLIC void spectre_render_context_set_resolution |
( |
SpectreRenderContext * |
rc, |
|
|
double |
x_dpi, |
|
|
double |
y_dpi |
|
) |
| |
Sets the resolution. The default is 72 for both directions
- Parameters
-
rc | The rendering context to modify |
x_dpi | the horizontal resolution to set |
y_dpi | the vertical resolution to set |
◆ spectre_render_context_set_rotation()
SPECTRE_PUBLIC void spectre_render_context_set_rotation |
( |
SpectreRenderContext * |
rc, |
|
|
unsigned int |
rotation |
|
) |
| |
Sets the rotation. The default is 0
- Parameters
-
rc | The rendering context to modify |
rotation | The rotation to use when rendering. Usually 0, 90, 180 or 270 |
◆ spectre_render_context_set_scale()
SPECTRE_PUBLIC void spectre_render_context_set_scale |
( |
SpectreRenderContext * |
rc, |
|
|
double |
x_scale, |
|
|
double |
y_scale |
|
) |
| |
Sets the scale. The default is 1
- Parameters
-
rc | The rendering context to modify |
x_scale | The scale factor for the X dimension to use when rendering. 2 is twice as big |
y_scale | The scale factor for the Y dimension to use when rendering. 2 is twice as big |
◆ spectre_render_context_set_use_platform_fonts()
SPECTRE_PUBLIC void spectre_render_context_set_use_platform_fonts |
( |
SpectreRenderContext * |
rc, |
|
|
int |
use_platform_fonts |
|
) |
| |
Sets whether to use the platform fonts when rendering or not. The default is TRUE
- Parameters
-
rc | The rendering context to modify |
use_platform_fonts | should platform fonts be used when rendering? |