2009-04-30 17:00:22 +00:00
|
|
|
/*
|
|
|
|
* Cogl
|
|
|
|
*
|
|
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
|
|
#error "Only <cogl/cogl.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __COGL_BITMAP_H__
|
|
|
|
#define __COGL_BITMAP_H__
|
|
|
|
|
|
|
|
#include <cogl/cogl-types.h>
|
|
|
|
|
2009-05-06 09:35:28 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2009-04-30 17:00:22 +00:00
|
|
|
/**
|
|
|
|
* SECTION:cogl-bitmap
|
2009-11-19 13:29:02 +00:00
|
|
|
* @short_description: Fuctions for loading images
|
2009-04-30 17:00:22 +00:00
|
|
|
*
|
|
|
|
* Cogl allows loading image data into memory as CoglBitmaps without
|
|
|
|
* loading them immediately into GPU textures.
|
2009-11-19 13:29:02 +00:00
|
|
|
*
|
|
|
|
* #CoglBitmap is available since Cogl 1.0
|
2009-04-30 17:00:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_bitmap_new_from_file:
|
|
|
|
* @filename: the file to load.
|
|
|
|
* @error: a #GError or %NULL.
|
|
|
|
*
|
2009-06-10 11:50:45 +00:00
|
|
|
* Loads an image file from disk. This function can be safely called from
|
2009-04-30 17:00:22 +00:00
|
|
|
* within a thread.
|
|
|
|
*
|
2009-11-19 13:29:02 +00:00
|
|
|
* Return value: a #CoglHandle to the new loaded image data, or
|
2009-06-10 11:50:45 +00:00
|
|
|
* %COGL_INVALID_HANDLE if loading the image failed.
|
2009-04-30 17:00:22 +00:00
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
2009-11-19 13:29:02 +00:00
|
|
|
CoglHandle cogl_bitmap_new_from_file (const gchar *filename,
|
|
|
|
GError **error);
|
2009-04-30 17:00:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_bitmap_get_size_from_file:
|
|
|
|
* @filename: the file to check
|
2009-11-19 13:29:02 +00:00
|
|
|
* @width: (out): return location for the bitmap width, or %NULL
|
|
|
|
* @height: (out): return location for the bitmap height, or %NULL
|
2009-04-30 17:00:22 +00:00
|
|
|
*
|
|
|
|
* Parses an image file enough to extract the width and height
|
|
|
|
* of the bitmap.
|
|
|
|
*
|
2009-11-19 13:29:02 +00:00
|
|
|
* Return value: %TRUE if the image was successfully parsed
|
2009-06-10 11:50:45 +00:00
|
|
|
*
|
2009-04-30 17:00:22 +00:00
|
|
|
* Since: 1.0
|
|
|
|
*/
|
2009-11-19 13:29:02 +00:00
|
|
|
gboolean cogl_bitmap_get_size_from_file (const gchar *filename,
|
|
|
|
gint *width,
|
|
|
|
gint *height);
|
2009-04-30 17:00:22 +00:00
|
|
|
|
2009-11-11 10:32:39 +00:00
|
|
|
/**
|
|
|
|
* cogl_is_bitmap:
|
|
|
|
* @handle: a #CoglHandle for a bitmap
|
|
|
|
*
|
|
|
|
* Checks whether @handle is a #CoglHandle for a bitmap
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the passed handle represents a bitmap,
|
|
|
|
* and %FALSE otherwise
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
2009-11-19 13:29:02 +00:00
|
|
|
gboolean cogl_is_bitmap (CoglHandle handle);
|
2009-11-11 10:32:39 +00:00
|
|
|
|
2009-04-30 17:00:22 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __COGL_BITMAP_H__ */
|