libspectre  0.2.8
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 
47 
51 void spectre_page_free (SpectrePage *page);
52 
56 unsigned int spectre_page_get_index (SpectrePage *page);
57 
61 const char *spectre_page_get_label (SpectrePage *page);
62 
67 
76  int *width,
77  int *height);
78 
90  unsigned char **page_data,
91  int *row_length);
92 
93 /* ! Renders a rectangle of the page to RGB32 format. This function can fail
94  @param page The page to renderer
95  @param rc The rendering context specifying how the page has to be rendered
96  @param x The X coordinate of the top left corner of the rectangle
97  @param y The Y coordinate to the top left corner of the rectangle
98  @param width The width of the rectangle
99  @param height The height of the rectangle
100  @param page_data A pointer that will point to the image data
101  if the call succeeds
102  @param row_length The length of an image row will be returned here. It can
103  happen that row_length is different than width * 4
104  @see spectre_page_status
105 */
108  int x,
109  int y,
110  int width,
111  int height,
112  unsigned char **page_data,
113  int *row_length);
114 
115 SPECTRE_END_DECLS
116 
117 #endif /* SPECTRE_PAGE_H */
spectre_page_render_slice
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
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:30
spectre-render-context.h
SPECTRE_ORIENTATION_PORTRAIT
@ SPECTRE_ORIENTATION_PORTRAIT
Definition: spectre-page.h:31
spectre_page_get_index
unsigned int spectre_page_get_index(SpectrePage *page)
Definition: spectre-page.c:82
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_page_render
void spectre_page_render(SpectrePage *page, SpectreRenderContext *rc, unsigned char **page_data, int *row_length)
Definition: spectre-page.c:150
spectre_page_get_label
const char * spectre_page_get_label(SpectrePage *page)
Definition: spectre-page.c:90
spectre_page_free
void spectre_page_free(SpectrePage *page)
Definition: spectre-page.c:60
spectre-status.h
spectre_page_get_orientation
SpectreOrientation spectre_page_get_orientation(SpectrePage *page)
Definition: spectre-page.c:98
SPECTRE_ORIENTATION_LANDSCAPE
@ SPECTRE_ORIENTATION_LANDSCAPE
Definition: spectre-page.h:35
spectre_page_status
SpectreStatus spectre_page_status(SpectrePage *page)
Definition: spectre-page.c:74
spectre_page_get_size
void spectre_page_get_size(SpectrePage *page, int *width, int *height)
Definition: spectre-page.c:127
SpectrePage::height
int height
Definition: spectre-page.c:38