#include <libspectre/spectre-macros.h>
#include <libspectre/spectre-status.h>
#include <libspectre/spectre-render-context.h>
Go to the source code of this file.
|
SPECTRE_PUBLIC SpectreStatus | spectre_page_status (SpectrePage *page) |
|
SPECTRE_PUBLIC void | spectre_page_free (SpectrePage *page) |
|
SPECTRE_PUBLIC unsigned int | spectre_page_get_index (SpectrePage *page) |
|
SPECTRE_PUBLIC const char * | spectre_page_get_label (SpectrePage *page) |
|
SPECTRE_PUBLIC SpectreOrientation | spectre_page_get_orientation (SpectrePage *page) |
|
SPECTRE_PUBLIC void | spectre_page_get_size (SpectrePage *page, int *width, int *height) |
|
SPECTRE_PUBLIC void | spectre_page_render (SpectrePage *page, SpectreRenderContext *rc, unsigned char **page_data, int *row_length) |
|
SPECTRE_PUBLIC void | spectre_page_render_slice (SpectrePage *page, SpectreRenderContext *rc, int x, int y, int width, int height, unsigned char **page_data, int *row_length) |
|
◆ SpectrePage
typedef struct SpectrePage SpectrePage |
This is the object that represents a page of a PostScript document. They can not be created directly and can only be obtained from spectre_document_get_page
◆ SpectreOrientation
Enumerator |
---|
SPECTRE_ORIENTATION_PORTRAIT | Vertical orientation
|
SPECTRE_ORIENTATION_REVERSE_LANDSCAPE | Inverse horizontal orientation, also known as Seascape
|
SPECTRE_ORIENTATION_REVERSE_PORTRAIT | Inverse vertical orientation
|
SPECTRE_ORIENTATION_LANDSCAPE | Horizontal orientation
|
◆ spectre_page_free()
SPECTRE_PUBLIC void spectre_page_free |
( |
SpectrePage * | page | ) |
|
Frees the memory of the given page
- Parameters
-
page | The page whose memory will be freed |
◆ spectre_page_get_index()
SPECTRE_PUBLIC unsigned int spectre_page_get_index |
( |
SpectrePage * | page | ) |
|
Returns the index of the page inside the document. First page has index 0
- Parameters
-
page | The page whose index will be returned |
◆ spectre_page_get_label()
SPECTRE_PUBLIC const char * spectre_page_get_label |
( |
SpectrePage * | page | ) |
|
Returns the label of the page inside the document.
- Parameters
-
page | The page whose label will be returned |
◆ spectre_page_get_orientation()
Returns the orientation of the page
- Parameters
-
page | The page whose orientation will be returned |
◆ spectre_page_get_size()
SPECTRE_PUBLIC void spectre_page_get_size |
( |
SpectrePage * | page, |
|
|
int * | width, |
|
|
int * | height ) |
Returns the size of the page. It always returns the page size according to the page bounding box without taking into account the page orientation.
- Parameters
-
page | The page whose size will be returned |
width | The page width will be returned here, or NULL |
height | The page height will be returned here, or NULL |
- See also
- spectre_page_get_orientation
◆ spectre_page_render()
Renders the page to RGB32 format. This function can fail
- Parameters
-
page | The page to renderer |
rc | The rendering context specifying how the page has to be rendered |
page_data | A pointer that will point to the image data if the call succeeds |
row_length | The length of an image row will be returned here. It can happen that row_length is different than width * 4 |
- See also
- spectre_page_status
◆ spectre_page_render_slice()
SPECTRE_PUBLIC void spectre_page_render_slice |
( |
SpectrePage * | page, |
|
|
SpectreRenderContext * | rc, |
|
|
int | x, |
|
|
int | y, |
|
|
int | width, |
|
|
int | height, |
|
|
unsigned char ** | page_data, |
|
|
int * | row_length ) |
◆ spectre_page_status()
Returns the status of the given page
- Parameters
-
page | The page whose status will be returned |