libspectre 0.2.11
spectre-page.h
Go to the documentation of this file.
1/* This file is part of Libspectre.
2 *
3 * Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
4 * Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
5 *
6 * Libspectre is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * Libspectre is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef SPECTRE_PAGE_H
22#define SPECTRE_PAGE_H
23
24#include <libspectre/spectre-macros.h>
27
28SPECTRE_BEGIN_DECLS
29
30typedef enum {
37
41typedef struct SpectrePage SpectrePage;
42
46SPECTRE_PUBLIC
48
52SPECTRE_PUBLIC
54
58SPECTRE_PUBLIC
59unsigned int spectre_page_get_index (SpectrePage *page);
60
64SPECTRE_PUBLIC
65const char *spectre_page_get_label (SpectrePage *page);
66
70SPECTRE_PUBLIC
72
80SPECTRE_PUBLIC
82 int *width,
83 int *height);
84
94SPECTRE_PUBLIC
97 unsigned char **page_data,
98 int *row_length);
99
100/* ! Renders a rectangle of the page to RGB32 format. This function can fail
101 @param page The page to renderer
102 @param rc The rendering context specifying how the page has to be rendered
103 @param x The X coordinate of the top left corner of the rectangle
104 @param y The Y coordinate to the top left corner of the rectangle
105 @param width The width of the rectangle
106 @param height The height of the rectangle
107 @param page_data A pointer that will point to the image data
108 if the call succeeds
109 @param row_length The length of an image row will be returned here. It can
110 happen that row_length is different than width * 4
111 @see spectre_page_status
112*/
113SPECTRE_PUBLIC
116 int x,
117 int y,
118 int width,
119 int height,
120 unsigned char **page_data,
121 int *row_length);
122
123SPECTRE_END_DECLS
124
125#endif /* SPECTRE_PAGE_H */
SPECTRE_PUBLIC void spectre_page_render(SpectrePage *page, SpectreRenderContext *rc, unsigned char **page_data, int *row_length)
Definition: spectre-page.c:150
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)
Definition: spectre-page.c:171
SPECTRE_PUBLIC SpectreOrientation spectre_page_get_orientation(SpectrePage *page)
Definition: spectre-page.c:98
SPECTRE_PUBLIC void spectre_page_get_size(SpectrePage *page, int *width, int *height)
Definition: spectre-page.c:127
SPECTRE_PUBLIC void spectre_page_free(SpectrePage *page)
Definition: spectre-page.c:60
SpectreOrientation
Definition: spectre-page.h:30
@ SPECTRE_ORIENTATION_REVERSE_LANDSCAPE
Definition: spectre-page.h:32
@ SPECTRE_ORIENTATION_REVERSE_PORTRAIT
Definition: spectre-page.h:34
@ SPECTRE_ORIENTATION_PORTRAIT
Definition: spectre-page.h:31
@ SPECTRE_ORIENTATION_LANDSCAPE
Definition: spectre-page.h:35
SPECTRE_PUBLIC SpectreStatus spectre_page_status(SpectrePage *page)
Definition: spectre-page.c:74
SPECTRE_PUBLIC unsigned int spectre_page_get_index(SpectrePage *page)
Definition: spectre-page.c:82
SPECTRE_PUBLIC const char * spectre_page_get_label(SpectrePage *page)
Definition: spectre-page.c:90
struct SpectreRenderContext SpectreRenderContext
Definition: spectre-render-context.h:29
enum _SpectreStatus SpectreStatus
Definition: spectre-page.c:31
int height
Definition: spectre-page.c:38
int width
Definition: spectre-page.c:37