only check as many Flash versions as we have functions for
[swfdec.git] / libswfdec / swfdec_image.h
blob245c5eddeeade502e1daec73faaf905b82a982b9
1 /* Swfdec
2 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
3 * 2005-2006 Eric Anholt <eric@anholt.net>
4 * 2006-2007 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 <libswfdec/swfdec_cached.h>
27 #include <libswfdec/swfdec_decoder.h>
29 G_BEGIN_DECLS
30 //typedef struct _SwfdecImage SwfdecImage;
31 typedef struct _SwfdecImageClass SwfdecImageClass;
33 #define SWFDEC_TYPE_IMAGE (swfdec_image_get_type())
34 #define SWFDEC_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_IMAGE))
35 #define SWFDEC_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_IMAGE))
36 #define SWFDEC_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_IMAGE, SwfdecImage))
37 #define SWFDEC_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_IMAGE, SwfdecImageClass))
39 typedef enum {
40 SWFDEC_IMAGE_TYPE_UNKNOWN = 0,
41 SWFDEC_IMAGE_TYPE_JPEG,
42 SWFDEC_IMAGE_TYPE_JPEG2,
43 SWFDEC_IMAGE_TYPE_JPEG3,
44 SWFDEC_IMAGE_TYPE_LOSSLESS,
45 SWFDEC_IMAGE_TYPE_LOSSLESS2,
46 } SwfdecImageType;
48 struct _SwfdecImage {
49 SwfdecCached cached;
51 guint8 * data; /* image data in CAIRO_FORMAT_ARGB32 but NOT premultiplied */
52 int width;
53 int height;
54 int rowstride;
55 cairo_surface_t * surface; /* surface that owns the data pointer or NULL (doesn't always work) */
57 SwfdecImageType type;
58 SwfdecBuffer * jpegtables;
59 SwfdecBuffer * raw_data;
62 struct _SwfdecImageClass {
63 SwfdecCachedClass cached_class;
67 GType swfdec_image_get_type (void);
69 cairo_surface_t * swfdec_image_create_surface (SwfdecImage * image);
70 cairo_surface_t * swfdec_image_create_surface_transformed
71 (SwfdecImage * image,
72 const SwfdecColorTransform *trans);
74 int swfdec_image_jpegtables (SwfdecSwfDecoder * s, guint tag);
75 int tag_func_define_bits_jpeg (SwfdecSwfDecoder * s, guint tag);
76 int tag_func_define_bits_jpeg_2 (SwfdecSwfDecoder * s, guint tag);
77 int tag_func_define_bits_jpeg_3 (SwfdecSwfDecoder * s, guint tag);
78 int tag_func_define_bits_lossless (SwfdecSwfDecoder * s, guint tag);
79 int tag_func_define_bits_lossless_2 (SwfdecSwfDecoder * s, guint tag);
81 G_END_DECLS
82 #endif