cleanup specfile for packaging
[profile/ivi/cogl.git] / cogl / cogl-texture-3d-private.h
1 /*
2  * Cogl
3  *
4  * An object oriented GL/GLES Abstraction/Utility Layer
5  *
6  * Copyright (C) 2010 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  * Authors:
22  *   Neil Roberts <neil@linux.intel.com>
23  */
24
25 #ifndef __COGL_TEXTURE_3D_PRIVATE_H
26 #define __COGL_TEXTURE_3D_PRIVATE_H
27
28 #include "cogl-handle.h"
29 #include "cogl-pipeline-private.h"
30 #include "cogl-texture-private.h"
31 #include "cogl-texture-3d.h"
32
33 struct _CoglTexture3D
34 {
35   CoglTexture     _parent;
36
37   /* The internal format of the GL texture represented as a
38      CoglPixelFormat */
39   CoglPixelFormat format;
40   /* The internal format of the GL texture represented as a GL enum */
41   GLenum          gl_format;
42   /* The texture object number */
43   GLuint          gl_texture;
44   int             width;
45   int             height;
46   int             depth;
47   GLenum          min_filter;
48   GLenum          mag_filter;
49   GLint           wrap_mode_s;
50   GLint           wrap_mode_t;
51   GLint           wrap_mode_p;
52   gboolean        auto_mipmap;
53   gboolean        mipmaps_dirty;
54
55   CoglTexturePixel first_pixel;
56 };
57
58 /*
59  * cogl_texture_3d_new_from_bitmap:
60  * @bmp_handle: A #CoglBitmap object.
61  * @height: height of the texture in pixels.
62  * @depth: depth of the texture in pixels.
63  * @internal_format: the #CoglPixelFormat that will be used for storing
64  *    the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a
65  *    premultiplied format similar to the format of the source data will
66  *    be used. The default blending equations of Cogl expect premultiplied
67  *    color data; the main use of passing a non-premultiplied format here
68  *    is if you have non-premultiplied source data and are going to adjust
69  *    the blend mode (see cogl_pipeline_set_blend()) or use the data for
70  *    something other than straight blending.
71  * @error: A GError return location.
72  *
73  * Creates a new 3D texture and initializes it with the images in
74  * @bmp_handle. The images are assumed to be packed together after one
75  * another in the increasing y axis. The height of individual image is
76  * given as @height and the number of images is given in @depth. The
77  * actual height of the bitmap can be larger than @height × @depth. In
78  * this case it assumes there is padding between the images.
79  *
80  * Return value: the newly created texture or %NULL if
81  *   there was an error.
82  */
83 CoglTexture3D *
84 _cogl_texture_3d_new_from_bitmap (CoglContext *context,
85                                   CoglBitmap *bmp,
86                                   unsigned int height,
87                                   unsigned int depth,
88                                   CoglPixelFormat internal_format,
89                                   GError **error);
90
91 #endif /* __COGL_TEXTURE_3D_PRIVATE_H */