create 3 new types: SwfdecFixed, SwfdecTwips and SwfdecTransform
[swfdec.git] / libswfdec / swfdec_bits.h
blob9a4f498c77e768b2c38c746fcd47b92d024239a9
1 /* Swfdec
2 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
3 * 2005-2006 Eric Anholt <eric@anholt.net>
4 * 2006 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_BITS_H__
23 #define __SWFDEC_BITS_H__
25 #include <cairo.h>
26 #include <libswfdec/swfdec_color.h>
27 #include <libswfdec/swfdec_buffer.h>
29 #define SWFDEC_TEXT_SCALE_FACTOR (1024.0)
31 typedef struct _SwfdecBits SwfdecBits;
33 struct _SwfdecBits
35 SwfdecBuffer *buffer;
36 unsigned char *ptr;
37 unsigned int idx;
38 unsigned char *end;
41 void swfdec_bits_init (SwfdecBits *bits, SwfdecBuffer *buffer);
42 unsigned int swfdec_bits_left (SwfdecBits *b);
43 int swfdec_bits_getbit (SwfdecBits * b);
44 unsigned int swfdec_bits_getbits (SwfdecBits * b, unsigned int n);
45 unsigned int swfdec_bits_peekbits (SwfdecBits * b, unsigned int n);
46 int swfdec_bits_getsbits (SwfdecBits * b, unsigned int n);
47 unsigned int swfdec_bits_peek_u8 (SwfdecBits * b);
48 unsigned int swfdec_bits_get_u8 (SwfdecBits * b);
49 unsigned int swfdec_bits_get_u16 (SwfdecBits * b);
50 int swfdec_bits_get_s16 (SwfdecBits * b);
51 unsigned int swfdec_bits_get_be_u16 (SwfdecBits * b);
52 unsigned int swfdec_bits_get_u32 (SwfdecBits * b);
53 float swfdec_bits_get_float (SwfdecBits * b);
54 double swfdec_bits_get_double (SwfdecBits * b);
55 void swfdec_bits_syncbits (SwfdecBits * b);
57 void swfdec_bits_get_color_transform (SwfdecBits * bits,
58 SwfdecColorTransform * ct);
59 void swfdec_bits_get_transform (SwfdecBits * bits, SwfdecTransform *trans);
60 void swfdec_bits_get_matrix (SwfdecBits * bits, cairo_matrix_t *matrix);
61 const char *swfdec_bits_skip_string (SwfdecBits * bits);
62 char *swfdec_bits_get_string (SwfdecBits * bits);
63 char *swfdec_bits_get_string_length (SwfdecBits * bits, unsigned int len);
64 unsigned int swfdec_bits_get_color (SwfdecBits * bits);
65 unsigned int swfdec_bits_get_rgba (SwfdecBits * bits);
66 SwfdecGradient *swfdec_bits_get_gradient (SwfdecBits * bits);
67 SwfdecGradient *swfdec_bits_get_gradient_rgba (SwfdecBits * bits);
68 SwfdecGradient *swfdec_bits_get_morph_gradient (SwfdecBits * bits);
69 void swfdec_bits_get_rect (SwfdecBits * bits, SwfdecRect *rect);
70 SwfdecBuffer *swfdec_bits_get_buffer (SwfdecBits *bits, int len);
73 #endif