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_
26 #include <swfdec/swfdec_character.h>
27 #include <swfdec/swfdec_decoder.h>
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))
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 */
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 */
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
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
);