Blame gdk-pixbuf/gdk-pixbuf-private.h

Packit a4058c
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
Packit a4058c
/* GdkPixbuf library - Private declarations
Packit a4058c
 *
Packit a4058c
 * Copyright (C) 1999 The Free Software Foundation
Packit a4058c
 *
Packit a4058c
 * Authors: Mark Crichton <crichton@gimp.org>
Packit a4058c
 *          Miguel de Icaza <miguel@gnu.org>
Packit a4058c
 *          Federico Mena-Quintero <federico@gimp.org>
Packit a4058c
 *          Havoc Pennington <hp@redhat.com>
Packit a4058c
 *
Packit a4058c
 * This library is free software; you can redistribute it and/or
Packit a4058c
 * modify it under the terms of the GNU Lesser General Public
Packit a4058c
 * License as published by the Free Software Foundation; either
Packit a4058c
 * version 2 of the License, or (at your option) any later version.
Packit a4058c
 *
Packit a4058c
 * This library is distributed in the hope that it will be useful,
Packit a4058c
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a4058c
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a4058c
 * Lesser General Public License for more details.
Packit a4058c
 *
Packit a4058c
 * You should have received a copy of the GNU Lesser General Public
Packit a4058c
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit a4058c
 */
Packit a4058c
Packit a4058c
#ifndef GDK_PIXBUF_PRIVATE_H
Packit a4058c
#define GDK_PIXBUF_PRIVATE_H
Packit a4058c
Packit a4058c
#include <stdio.h>
Packit a4058c
#include <math.h>
Packit a4058c
Packit a4058c
#include <glib-object.h>
Packit a4058c
#include <glib/gi18n-lib.h>
Packit a4058c
Packit a4058c
#include "gdk-pixbuf-core.h"
Packit a4058c
#include "gdk-pixbuf-loader.h"
Packit a4058c
#include "gdk-pixbuf-io.h"
Packit a4058c
Packit a4058c
#define LOAD_BUFFER_SIZE 65536
Packit a4058c
#define SNIFF_BUFFER_SIZE 4096
Packit a4058c
Packit a4058c

Packit a4058c
Packit a4058c
typedef struct _GdkPixbufClass GdkPixbufClass;
Packit a4058c
Packit a4058c
#define GDK_PIXBUF_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF, GdkPixbufClass))
Packit a4058c
#define GDK_IS_PIXBUF_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF))
Packit a4058c
#define GDK_PIXBUF_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF, GdkPixbufClass))
Packit a4058c
Packit a4058c
/* Helper macros to convert between density units */
Packit a4058c
#define DPI_TO_DPM(value) ((int) round ((value) * 1000 / 25.4))
Packit a4058c
#define DPI_TO_DPCM(value) ((int) round ((value) / 2.54))
Packit a4058c
#define DPM_TO_DPI(value) ((int) round ((value) * 25.4 / 1000))
Packit a4058c
#define DPCM_TO_DPI(value) ((int) round ((value) * 2.54))
Packit a4058c
Packit a4058c
/* Default fill color */
Packit a4058c
#define DEFAULT_FILL_COLOR 0x979899ff
Packit a4058c
Packit a4058c
/* Private part of the GdkPixbuf structure */
Packit a4058c
struct _GdkPixbuf {
Packit a4058c
        GObject parent_instance;
Packit a4058c
Packit a4058c
	/* Color space */
Packit a4058c
	GdkColorspace colorspace;
Packit a4058c
Packit a4058c
	/* Number of channels, alpha included */
Packit a4058c
	int n_channels;
Packit a4058c
Packit a4058c
	/* Bits per channel */
Packit a4058c
	int bits_per_sample;
Packit a4058c
Packit a4058c
	/* Size */
Packit a4058c
	int width, height;
Packit a4058c
Packit a4058c
	/* Offset between rows */
Packit a4058c
	int rowstride;
Packit a4058c
Packit a4058c
	/* The pixel array */
Packit a4058c
	guchar *pixels;
Packit a4058c
Packit a4058c
	/* Destroy notification function; it is supposed to free the pixel array */
Packit a4058c
	GdkPixbufDestroyNotify destroy_fn;
Packit a4058c
Packit a4058c
	/* User data for the destroy notification function */
Packit a4058c
	gpointer destroy_fn_data;
Packit a4058c
Packit a4058c
        /* Replaces "pixels" member (and destroy notify) */
Packit a4058c
        GBytes *bytes;
Packit a4058c
Packit a4058c
	/* Do we have an alpha channel? */
Packit a4058c
	guint has_alpha : 1;
Packit a4058c
};
Packit a4058c
Packit a4058c
struct _GdkPixbufClass {
Packit a4058c
        GObjectClass parent_class;
Packit a4058c
Packit a4058c
};
Packit a4058c
Packit a4058c
#ifdef GDK_PIXBUF_ENABLE_BACKEND
Packit a4058c
Packit a4058c
GdkPixbufModule *_gdk_pixbuf_get_module (guchar *buffer, guint size,
Packit a4058c
                                         const gchar *filename,
Packit a4058c
                                         GError **error);
Packit a4058c
GdkPixbufModule *_gdk_pixbuf_get_named_module (const char *name,
Packit a4058c
                                               GError **error);
Packit a4058c
gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
Packit a4058c
                                  GError **error);
Packit a4058c
Packit a4058c
GdkPixbuf *_gdk_pixbuf_generic_image_load (GdkPixbufModule *image_module,
Packit a4058c
					   FILE *f,
Packit a4058c
					   GError **error);
Packit a4058c
Packit a4058c
GdkPixbufFormat *_gdk_pixbuf_get_format (GdkPixbufModule *image_module);
Packit a4058c
Packit a4058c
Packit a4058c
#endif /* GDK_PIXBUF_ENABLE_BACKEND */
Packit a4058c
Packit a4058c
GdkPixbuf * _gdk_pixbuf_new_from_resource_try_pixdata (const char *resource_path);
Packit a4058c
GdkPixbufLoader *_gdk_pixbuf_loader_new_with_filename (const char *filename);
Packit a4058c
Packit a4058c
void _gdk_pixbuf_init_gettext (void);
Packit a4058c
Packit a4058c
#endif /* GDK_PIXBUF_PRIVATE_H */
Packit a4058c
Packit a4058c
#ifdef GDK_PIXBUF_RELOCATABLE
Packit a4058c
Packit a4058c
gchar * gdk_pixbuf_get_toplevel (void);
Packit a4058c
Packit a4058c
#endif /* G_OS_WIN32 */