fix build for --disable-gtk-doc
[swfdec.git] / swfdec / swfdec_image.h
blobdfe44b4d2fc991ed7799b98604eb39a0b4d013a5
1 /* Swfdec
2 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
3 * 2005-2006 Eric Anholt <eric@anholt.net>
4 * 2006-2008 Benjamin Otte <otte@gnome.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #ifndef _SWFDEC_IMAGE_H_
23 #define _SWFDEC_IMAGE_H_
25 #include <cairo.h>
26 #include <swfdec/swfdec_character.h>
27 #include <swfdec/swfdec_decoder.h>
29 G_BEGIN_DECLS
31 //typedef struct _SwfdecImage SwfdecImage;
32 typedef struct _SwfdecImageClass SwfdecImageClass;
34 #define SWFDEC_TYPE_IMAGE (swfdec_image_get_type())
35 #define SWFDEC_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_IMAGE))
36 #define SWFDEC_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_IMAGE))
37 #define SWFDEC_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_IMAGE, SwfdecImage))
38 #define SWFDEC_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_IMAGE, SwfdecImageClass))
40 typedef enum {
41 SWFDEC_IMAGE_TYPE_UNKNOWN = 0,
42 SWFDEC_IMAGE_TYPE_JPEG,
43 SWFDEC_IMAGE_TYPE_JPEG2,
44 SWFDEC_IMAGE_TYPE_JPEG3,
45 SWFDEC_IMAGE_TYPE_LOSSLESS,
46 SWFDEC_IMAGE_TYPE_LOSSLESS2,
47 /* those can only be created by loading from files */
48 SWFDEC_IMAGE_TYPE_PNG
49 } SwfdecImageType;
51 struct _SwfdecImage {
52 SwfdecCharacter character;
54 /* width * height * 4 must fit into a guint */
55 guint width; /* width of image or 0 if not known yet */
56 guint height; /* height of image or 0 if not known yet */
58 SwfdecImageType type;
59 SwfdecBuffer * jpegtables;
60 SwfdecBuffer * raw_data;
63 struct _SwfdecImageClass {
64 SwfdecCharacterClass character_class;
67 GType swfdec_image_get_type (void);
69 SwfdecImageType swfdec_image_detect (const guint8 * data);
70 SwfdecImage * swfdec_image_new (SwfdecBuffer * buffer);
71 cairo_surface_t * swfdec_image_create_surface (SwfdecImage * image,
72 SwfdecRenderer * renderer);
73 cairo_surface_t * swfdec_image_create_surface_transformed
74 (SwfdecImage * image,
75 SwfdecRenderer * renderer,
76 const SwfdecColorTransform *trans);
78 int swfdec_image_jpegtables (SwfdecSwfDecoder * s, guint tag);
79 int tag_func_define_bits_jpeg (SwfdecSwfDecoder * s, guint tag);
80 int tag_func_define_bits_jpeg_2 (SwfdecSwfDecoder * s, guint tag);
81 int tag_func_define_bits_jpeg_3 (SwfdecSwfDecoder * s, guint tag);
82 int tag_func_define_bits_lossless (SwfdecSwfDecoder * s, guint tag);
83 int tag_func_define_bits_lossless_2 (SwfdecSwfDecoder * s, guint tag);
85 G_END_DECLS
86 #endif