~ml-launchpad/ubuntu/natty/gcompris/fix-for-777349

« back to all changes in this revision

Viewing changes to src/libart_lgpl/art_pixbuf.h

  • Committer: Bazaar Package Importer
  • Author(s): Marc Gariepy, Marc Gariepy, Stephane Graber
  • Date: 2010-01-04 17:42:49 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20100104174249-7bupatd9dtxyhvs4
Tags: 9.0-0ubuntu1
[Marc Gariepy]
* New upstream release (9.0).
* Remove cache.c from POTFILES to avoid FTBFS
* Remove unneeded rm in debian/rules (file no longer exists upstream)

[Stephane Graber]
* Bump Debian standards to 3.8.3
* Add patch system (dpatch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Libart_LGPL - library of basic graphic primitives
2
 
 * Copyright (C) 1998 Raph Levien
3
 
 *
4
 
 * This library is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU Library General Public
6
 
 * License as published by the Free Software Foundation; either
7
 
 * version 3 of the License, or (at your option) any later version.
8
 
 *
9
 
 * This library is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
 * Library General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU Library General Public
15
 
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16
 
 * Boston, MA 02111-1307, USA.
17
 
 */
18
 
 
19
 
#ifndef __ART_PIXBUF_H__
20
 
#define __ART_PIXBUF_H__
21
 
 
22
 
/* A generic data structure for holding a buffer of pixels. One way
23
 
   to think about this module is as a virtualization over specific
24
 
   pixel buffer formats. */
25
 
 
26
 
#ifdef LIBART_COMPILATION
27
 
#include "art_misc.h"
28
 
#else
29
 
#include <libart_lgpl/art_misc.h>
30
 
#endif
31
 
 
32
 
#ifdef __cplusplus
33
 
extern "C" {
34
 
#endif
35
 
 
36
 
 
37
 
typedef void (*ArtDestroyNotify) (void *func_data, void *data);
38
 
 
39
 
typedef struct _ArtPixBuf ArtPixBuf;
40
 
 
41
 
typedef enum {
42
 
  ART_PIX_RGB
43
 
  /* gray, cmyk, lab, ... ? */
44
 
} ArtPixFormat;
45
 
 
46
 
 
47
 
/* The pixel buffer consists of width * height pixels, each of which
48
 
   has n_channels samples. It is stored in simple packed format. */
49
 
 
50
 
struct _ArtPixBuf {
51
 
  /*< public >*/
52
 
  ArtPixFormat format;
53
 
  int n_channels;
54
 
  int has_alpha;
55
 
  int bits_per_sample;
56
 
 
57
 
  art_u8 *pixels;
58
 
  int width;
59
 
  int height;
60
 
  int rowstride;
61
 
  void *destroy_data;
62
 
  ArtDestroyNotify destroy;
63
 
};
64
 
 
65
 
/* allocate an ArtPixBuf from art_alloc()ed pixels (automated destruction) */
66
 
ArtPixBuf *
67
 
art_pixbuf_new_rgb (art_u8 *pixels, int width, int height, int rowstride);
68
 
 
69
 
ArtPixBuf *
70
 
art_pixbuf_new_rgba (art_u8 *pixels, int width, int height, int rowstride);
71
 
 
72
 
/* allocate an ArtPixBuf from constant pixels (no destruction) */
73
 
ArtPixBuf *
74
 
art_pixbuf_new_const_rgb (const art_u8 *pixels, int width, int height, int rowstride);
75
 
 
76
 
ArtPixBuf *
77
 
art_pixbuf_new_const_rgba (const art_u8 *pixels, int width, int height, int rowstride);
78
 
 
79
 
/* allocate an ArtPixBuf and notify creator upon destruction */
80
 
ArtPixBuf *
81
 
art_pixbuf_new_rgb_dnotify (art_u8 *pixels, int width, int height, int rowstride,
82
 
                            void *dfunc_data, ArtDestroyNotify dfunc);
83
 
 
84
 
ArtPixBuf *
85
 
art_pixbuf_new_rgba_dnotify (art_u8 *pixels, int width, int height, int rowstride,
86
 
                             void *dfunc_data, ArtDestroyNotify dfunc);
87
 
 
88
 
/* free an ArtPixBuf with destroy notification */
89
 
void
90
 
art_pixbuf_free (ArtPixBuf *pixbuf);
91
 
 
92
 
/* deprecated function, use the _dnotify variants for allocation instead */
93
 
void
94
 
art_pixbuf_free_shallow (ArtPixBuf *pixbuf);
95
 
 
96
 
ArtPixBuf *
97
 
art_pixbuf_duplicate (const ArtPixBuf *pixbuf);
98
 
 
99
 
#ifdef __cplusplus
100
 
}
101
 
#endif
102
 
 
103
 
#endif