libspectre  0.2.9
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 
28 SPECTRE_BEGIN_DECLS
29 
30 typedef enum {
37 
41 typedef struct SpectrePage SpectrePage;
42 
46 SPECTRE_PUBLIC
48 
52 SPECTRE_PUBLIC
53 void spectre_page_free (SpectrePage *page);
54 
58 SPECTRE_PUBLIC
59 unsigned int spectre_page_get_index (SpectrePage *page);
60 
64 SPECTRE_PUBLIC
65 const char *spectre_page_get_label (SpectrePage *page);
66 
70 SPECTRE_PUBLIC
72 
80 SPECTRE_PUBLIC
82  int *width,
83  int *height);
84 
94 SPECTRE_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 */
113 SPECTRE_PUBLIC
116  int x,
117  int y,
118  int width,
119  int height,
120  unsigned char **page_data,
121  int *row_length);
122 
123 SPECTRE_END_DECLS
124 
125 #endif /* SPECTRE_PAGE_H */
spectre_page_free
SPECTRE_PUBLIC void spectre_page_free(SpectrePage *page)
Definition: spectre-page.c:60
spectre_page_get_orientation
SPECTRE_PUBLIC SpectreOrientation spectre_page_get_orientation(SpectrePage *page)
Definition: spectre-page.c:98
spectre_page_status
SPECTRE_PUBLIC SpectreStatus spectre_page_status(SpectrePage *page)
Definition: spectre-page.c:74
SpectreRenderContext
struct SpectreRenderContext SpectreRenderContext
Definition: spectre-render-context.h:29
SpectrePage::width
int width
Definition: spectre-page.c:37
SPECTRE_ORIENTATION_REVERSE_PORTRAIT
@ SPECTRE_ORIENTATION_REVERSE_PORTRAIT
Definition: spectre-page.h:34
SpectrePage
Definition: spectre-page.c:31
spectre-render-context.h
SPECTRE_ORIENTATION_PORTRAIT
@ SPECTRE_ORIENTATION_PORTRAIT
Definition: spectre-page.h:31
spectre_page_get_size
SPECTRE_PUBLIC void spectre_page_get_size(SpectrePage *page, int *width, int *height)
Definition: spectre-page.c:127
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)
Definition: spectre-page.c:171
SpectreStatus
enum _SpectreStatus SpectreStatus
SPECTRE_ORIENTATION_REVERSE_LANDSCAPE
@ SPECTRE_ORIENTATION_REVERSE_LANDSCAPE
Definition: spectre-page.h:32
SpectreOrientation
SpectreOrientation
Definition: spectre-page.h:30
spectre-status.h
spectre_page_get_index
SPECTRE_PUBLIC unsigned int spectre_page_get_index(SpectrePage *page)
Definition: spectre-page.c:82
SPECTRE_ORIENTATION_LANDSCAPE
@ SPECTRE_ORIENTATION_LANDSCAPE
Definition: spectre-page.h:35
SpectrePage::height
int height
Definition: spectre-page.c:38
spectre_page_render
SPECTRE_PUBLIC void spectre_page_render(SpectrePage *page, SpectreRenderContext *rc, unsigned char **page_data, int *row_length)
Definition: spectre-page.c:150
spectre_page_get_label
SPECTRE_PUBLIC const char * spectre_page_get_label(SpectrePage *page)
Definition: spectre-page.c:90