2 +----------------------------------------------------------------------+
3 | Author: yoya@awm.jp |
4 +----------------------------------------------------------------------+
10 #include "bitstream.h"
11 #include "y_keyvalue.h"
13 struct swf_object_; // swf_object.h
15 typedef struct swf_tag_ {
18 int length_longformat;
23 struct swf_tag_ *prev, *next;
26 typedef struct swf_tag_detail_handler_ {
27 void * (*create) (void);
28 int (*input) (swf_tag_t *tag, struct swf_object_ *swf);
29 int (*get_cid) (swf_tag_t *tag);
30 int (*replace_cid) (swf_tag_t *tag, int cid);
31 unsigned char * (*output) (swf_tag_t *tag, unsigned long *length,
32 struct swf_object_ *swf);
33 void (*print) (swf_tag_t *tag, struct swf_object_ *swf,
35 void (*destroy) (swf_tag_t *tag);
36 } swf_tag_detail_handler_t;
38 typedef struct swf_tag_info_ {
41 swf_tag_detail_handler_t *(*detail_handler)(void);
44 extern swf_tag_info_t *get_swf_tag_info(int tag_id);
46 extern swf_tag_t *swf_tag_create(bitstream_t *bs);
47 extern void swf_tag_destroy(swf_tag_t *tag);
48 extern int swf_tag_build(bitstream_t *bs, swf_tag_t *tag, struct swf_object_ *swf);
49 extern int swf_tag_rebuild(swf_tag_t *tag, struct swf_object_ *swf);
50 extern void swf_tag_print(swf_tag_t *tag, struct swf_object_ *swf, int indent_depth);
51 extern void *swf_tag_create_input_detail(swf_tag_t *tag, struct swf_object_ *swf);
52 extern void swf_tag_destroy_detail(swf_tag_t *tag);
54 extern int swf_tag_get_cid(swf_tag_t *tag);
55 extern int swf_tag_replace_cid(swf_tag_t *tag, int cid);
57 extern int swf_tag_get_refcid(swf_tag_t *tag);
58 extern int swf_tag_replace_refcid(swf_tag_t *tag, int cid);
62 extern int swf_tag_get_bitmap_size(swf_tag_t *tag,
63 int *width, int *height);
64 extern int swf_tag_get_bitmap_color1stpixel(swf_tag_t *tag,
65 int *red, int *green, int *blue);
67 extern unsigned char *swf_tag_get_jpeg_data(swf_tag_t *tag, unsigned long *length, int image_id, swf_tag_t *tag_jpegtables);
68 extern unsigned char *swf_tag_get_alpha_data(swf_tag_t *tag, unsigned long *length, int image_id);
69 extern int swf_tag_replace_jpeg_data(swf_tag_t *tag, int image_id,
70 unsigned char *jpeg_data,
71 unsigned long jpeg_data_len,
72 unsigned char *alpha_data,
73 unsigned long alpha_data_len,
74 int without_converting);
76 extern unsigned char *swf_tag_get_png_data(swf_tag_t *tag, unsigned long *length, int image_id);
77 extern int swf_tag_replace_png_data(swf_tag_t *tag, int image_id,
78 unsigned char *png_data,
79 unsigned long png_data_len, int rgb15);
80 extern int swf_tag_replace_gif_data(swf_tag_t *tag, int image_id,
81 unsigned char *gif_data,
82 unsigned long gif_data_len);
83 extern int swf_tag_convert_bitmap_data_tojpegtag(swf_tag_t *tag);
86 extern unsigned char *swf_tag_get_sound_data(swf_tag_t *tag,
87 unsigned long *length,
89 extern int swf_tag_replace_melo_data(swf_tag_t *tag, int sound_id,
90 unsigned char *melo_data,
91 unsigned long melo_data_len);
94 extern char *swf_tag_get_edit_string(swf_tag_t *tag,
96 int variable_name_len,
98 struct swf_object_ *swf);
99 extern int swf_tag_replace_edit_string(swf_tag_t *tag,
101 int variable_name_len,
103 int initial_text_len,
104 struct swf_object_ *swf);
106 extern int swf_tag_apply_shape_matrix_factor(swf_tag_t *tag, int shape_id,
108 double scale_x, double scale_y,
112 struct swf_object_ *swf);
113 extern int swf_tag_apply_shape_rect_factor(swf_tag_t *tag, int shape_id,
115 double scale_x, double scale_y,
118 struct swf_object_ *swf);
119 extern int swf_tag_apply_shape_type_tilled(swf_tag_t *tag, int shape_id,
121 struct swf_object_ *swf);
123 extern swf_tag_t *swf_tag_create_action_setvariables(y_keyvalue_t *kv);
124 extern int swf_tag_put_action_setvariables(swf_tag_t *tag,
126 struct swf_object_ *swf);
128 extern int swf_tag_replace_action_strings(swf_tag_t *tag,
131 struct swf_object_ *swf);
133 extern swf_tag_t * swf_tag_move(swf_tag_t *tag);
135 extern int swf_tag_search_cid_by_bitmap_condition(swf_tag_t *tag,
136 int width, int height,
137 int red, int green, int blue);
140 #endif /* __SWF_TAG_H__ */