Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-image.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive image' library.
5  *
6  * Copyright (C) 2012  Intel Corporation.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * Author:
22  *   Emmanuele Bassi <ebassi@linux.intel.com>
23  */
24
25 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
26 #error "Only <clutter/clutter.h> can be included directly."
27 #endif
28
29 #ifndef __CLUTTER_IMAGE_H__
30 #define __CLUTTER_IMAGE_H__
31
32 #include <cogl/cogl.h>
33 #include <clutter/clutter-types.h>
34
35 G_BEGIN_DECLS
36
37 #define CLUTTER_TYPE_IMAGE              (clutter_image_get_type ())
38 #define CLUTTER_IMAGE(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_IMAGE, ClutterImage))
39 #define CLUTTER_IS_IMAGE(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_IMAGE))
40 #define CLUTTER_IMAGE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_IMAGE, ClutterImageClass))
41 #define CLUTTER_IS_IMAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_IMAGE))
42 #define CLUTTER_IMAGE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_IMAGE, ClutterImageClass))
43
44 /**
45  * CLUTTER_IMAGE_ERROR:
46  *
47  * Error domain for the #ClutterImageError enumeration.
48  *
49  * Since: 1.10
50  */
51 #define CLUTTER_IMAGE_ERROR             (clutter_image_error_quark ())
52
53 typedef struct _ClutterImage           ClutterImage;
54 typedef struct _ClutterImagePrivate    ClutterImagePrivate;
55 typedef struct _ClutterImageClass      ClutterImageClass;
56
57 /**
58  * ClutterImageError:
59  * @CLUTTER_IMAGE_ERROR_INVALID_DATA: Invalid data passed to the
60  *   clutter_image_set_data() function.
61  *
62  * Error enumeration for #ClutterImage.
63  *
64  * Since: 1.10
65  */
66 typedef enum {
67   CLUTTER_IMAGE_ERROR_INVALID_DATA
68 } ClutterImageError;
69
70 /**
71  * ClutterImage:
72  *
73  * The <structname>ClutterImage</structname> structure contains
74  * private data and should only be accessed using the provided
75  * API.
76  *
77  * Since: 1.10
78  */
79 struct _ClutterImage
80 {
81   /*< private >*/
82   GObject parent_instance;
83
84   ClutterImagePrivate *priv;
85 };
86
87 /**
88  * ClutterImageClass:
89  *
90  * The <structname>ClutterImageClass</structname> structure contains
91  * private data.
92  *
93  * Since: 1.10
94  */
95 struct _ClutterImageClass
96 {
97   /*< private >*/
98   GObjectClass parent_class;
99
100   gpointer _padding[16];
101 };
102
103 CLUTTER_AVAILABLE_IN_1_10
104 GQuark clutter_image_error_quark (void);
105 CLUTTER_AVAILABLE_IN_1_10
106 GType clutter_image_get_type (void) G_GNUC_CONST;
107
108 CLUTTER_AVAILABLE_IN_1_10
109 ClutterContent *        clutter_image_new               (void);
110 CLUTTER_AVAILABLE_IN_1_10
111 gboolean                clutter_image_set_data          (ClutterImage                 *image,
112                                                          const guint8                 *data,
113                                                          CoglPixelFormat               pixel_format,
114                                                          guint                         width,
115                                                          guint                         height,
116                                                          guint                         row_stride,
117                                                          GError                      **error);
118 CLUTTER_AVAILABLE_IN_1_10
119 gboolean                clutter_image_set_area          (ClutterImage                 *image,
120                                                          const guint8                 *data,
121                                                          CoglPixelFormat               pixel_format,
122                                                          const cairo_rectangle_int_t  *rect,
123                                                          guint                         row_stride,
124                                                          GError                      **error);
125 CLUTTER_AVAILABLE_IN_1_12
126 gboolean                clutter_image_set_bytes         (ClutterImage                 *image,
127                                                          GBytes                       *data,
128                                                          CoglPixelFormat               pixel_format,
129                                                          guint                         width,
130                                                          guint                         height,
131                                                          guint                         row_stride,
132                                                          GError                      **error);
133
134 #if defined(COGL_ENABLE_EXPERIMENTAL_API) && defined(CLUTTER_ENABLE_EXPERIMENTAL_API)
135 CLUTTER_AVAILABLE_IN_1_10
136 CoglTexture *           clutter_image_get_texture       (ClutterImage                 *image);
137 #endif
138
139 G_END_DECLS
140
141 #endif /* __CLUTTER_IMAGE_H__ */