OSDN Git Service

delete png_set_gAMA
[swfed/swfed.git] / src / swf_tag_shape.h
1 /*
2   +----------------------------------------------------------------------+
3   | Author: yoya@awm.jp                                                  |
4   +----------------------------------------------------------------------+
5 */
6
7 #ifndef __SWF_TAG_SHAPE__H__
8 #define __SWF_TAG_SHAPE__H__
9
10 #include "swf_rect.h"
11 #include "swf_morph_shape_with_style.h"
12 #include "swf_shape_with_style.h"
13 #include "swf_tag.h"
14
15 typedef struct swf_tag_shape_detail_ {
16     int shape_id;
17     swf_rect_t rect;
18     //
19     unsigned char is_morph:1;    // DefineMorphShape, DefineMorphShape2
20     unsigned char has_strokes:1; // Defineshape4, DefineMorphShape2
21     // is_morph
22     swf_rect_t rect_morph;   // MorphShape(1) or 2
23     //has_strokes
24     swf_rect_t stroke_rect;  // Shape4 or MorphShape4
25     //// is_morph
26     swf_rect_t stroke_rect_morph;   // & MorphShape(1) or 2
27     //
28     unsigned char define_shape_reserved : 6;    // 6bit reserved area
29     unsigned char define_shape_non_scaling_strokes : 1;
30     unsigned char define_shape_scaling_strokes : 1;
31     // is_morph
32     unsigned long offset_morph;
33     swf_morph_shape_with_style_t  morph_shape_with_style;
34     // else
35     swf_shape_with_style_t  shape_with_style;
36   /*
37    * parse context
38    */ 
39     swf_styles_count_t _current_styles_count;
40     int _current_fill_style_num;
41     int _current_line_style_num;
42     signed /* twips */ _current_x, _current_y;
43     int _parse_condition;
44 #define SWF_TAG_SHAPE_PARSE_CONDITION_BITMAP 1
45 } swf_tag_shape_detail_t;
46
47 extern swf_tag_detail_handler_t *swf_tag_shape_detail_handler(void);
48 extern swf_tag_detail_handler_t *swf_tag_shape_cid_handler(void);
49
50 extern void *swf_tag_shape_create_detail(void);
51 extern int swf_tag_shape_input_detail(swf_tag_t *tag, struct swf_object_ *swf);
52 extern int swf_tag_shape_get_cid_detail(swf_tag_t *tag);
53 extern int swf_tag_shape_replace_cid_detail(swf_tag_t *tag, int id);
54 extern int *swf_tag_shape_bitmap_get_refcid_list(swf_tag_t *tag, int *cid_list_num);
55 extern int swf_tag_shape_bitmap_replace_refcid_list(swf_tag_t *tag, int from_cid, int to_cid);
56 // ダミー
57 extern int swf_tag_shape_bitmap_get_refcid(int x);
58 extern int swf_tag_shape_bitmap_replace_refcid(int y);
59 // ダミーここまで
60 extern unsigned char *swf_tag_shape_output_detail(swf_tag_t *tag,
61                                                    unsigned long *length,
62                                                    struct swf_object_ *swf);
63 extern void swf_tag_shape_print_detail(swf_tag_t *tag,
64                                        struct swf_object_ *swf,
65                                        int indent_depth);
66 extern void swf_tag_shape_destroy_detail(swf_tag_t *tag);
67
68 extern int swf_tag_shape_apply_matrix_factor(void *detail, int shape_id, 
69                                              double scale_x, double scale_y,
70                                              double rotate_rad,
71                                              signed int trans_x, signed int trans_y);
72 extern int swf_tag_shape_apply_rect_factor(void *detail, int shape_id, 
73                                            double scale_x, double scale_y,
74                                            signed int trans_x, signed int trans_y);
75 extern int swf_tag_shape_apply_type_tilled(void *detail, int shape_id);
76
77 #endif /* __SWF_TAG_SHAPE__H__ */
78