4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2009 Intel Corporation.
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.
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.
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/>.
24 #ifndef __COGL_ATLAS_TEXTURE_H
25 #define __COGL_ATLAS_TEXTURE_H
27 #include "cogl-handle.h"
28 #include "cogl-texture-private.h"
29 #include "cogl-rectangle-map.h"
30 #include "cogl-atlas.h"
32 #define COGL_ATLAS_TEXTURE(tex) ((CoglAtlasTexture *) tex)
34 typedef struct _CoglAtlasTexture CoglAtlasTexture;
36 struct _CoglAtlasTexture
40 /* The format that the texture is in. This isn't necessarily the
41 same format as the atlas texture because we can store
42 pre-multiplied and non-pre-multiplied textures together */
43 CoglPixelFormat format;
45 /* The rectangle that was used to add this texture to the
46 atlas. This includes the 1-pixel border */
47 CoglRectangleMapEntry rectangle;
49 /* The atlas that this texture is in. If the texture is no longer in
50 an atlas then this will be NULL. A reference is taken on the
51 atlas by the texture (but not vice versa so there is no cycle) */
54 /* A CoglSubTexture representing the region for easy rendering */
55 CoglHandle sub_texture;
59 _cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp,
60 CoglTextureFlags flags,
61 CoglPixelFormat internal_format);
64 _cogl_atlas_texture_new_with_size (unsigned int width,
66 CoglTextureFlags flags,
67 CoglPixelFormat internal_format);
70 _cogl_atlas_texture_add_reorganize_callback (GHookFunc callback,
74 _cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback,
78 _cogl_is_atlas_texture (void *object);
80 #endif /* __COGL_ATLAS_TEXTURE_H */