OSDN Git Service

DefineShape のデータ構造を幾つか定義
authoryoya <yoya@7c90b180-03d5-4157-b861-58a559ae9d1e>
Fri, 22 May 2009 16:40:50 +0000 (16:40 +0000)
committeryoya <yoya@7c90b180-03d5-4157-b861-58a559ae9d1e>
Fri, 22 May 2009 16:40:50 +0000 (16:40 +0000)
TODO: swf_matrix と swf_shape_record_{end|setup|edge}

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/swfed/trunk@129 7c90b180-03d5-4157-b861-58a559ae9d1e

src/swf_line_style.h
src/swf_shape_record.h
src/swf_shape_with_style.h [new file with mode: 0644]
src/swf_tag_shape.h

index 33b6b7a..aa579c4 100644 (file)
@@ -8,15 +8,28 @@
 #define __SWF_LINE_STYLE_H__
 
 #include "swf_rgba.h"
+#include "swf_fill_style.h"
+#include "swf_rgb.h"
 
 typedef union swf_line_style_ {
-    // DefineMorphShape
-    unsigned short width; // twips
-    unsigned short width_morph; // twips
     swf_rgba_t rgba;
-    swf_rgba_t rgba_morph;
+    swf_rgba_t rgba_morph; // + DefineMorphShape2
     // DefineShape4, DefinePhophShape2
-//    ...
+    unsigned short /* twips */ width;
+    unsigned short /* twips */ width_morph; // DefineMorphShape2
+    unsigned start_cap_style : 2;
+    unsigned join_style : 2;
+    unsigned has_fill : 1;
+    unsigned no_hscale : 1;
+    unsigned no_vscale : 1;
+    unsigned pixel_hinting : 1;
+    unsigned reserved : 5;
+    unsigned no_close : 1;
+    unsigned end_cap_style : 2;
+    unsigned short /* fixed */ miter_limit_factor; // join_style == 2
+    swf_fill_style_t fill_style; // has_fill == true
+    swf_rgb_t rgb;
+    
 } swf_line_style_t;
 
 extern int swf_line_style_parse(bitstream_t *bs, swf_line_style_t *color);
index dff9b87..e181f9b 100644 (file)
@@ -9,8 +9,11 @@
 
 #include "swf_shape_record.h"
 
-typedef struct swf_shape_record_ {
-    int dummy; // 
+typedef union swf_shape_record_ {
+    int dummy; int dummy2;
+//    swf_shape_record_end_t   shape_end;
+//    swf_shape_record_setup_t shape_setup;
+//    swf_shape_record_edge_t  shape_edge;
 } swf_shape_record_t;
 
 extern int swf_shape_record_parse(bitstream_t *bs, swf_shape_record_t *color);
diff --git a/src/swf_shape_with_style.h b/src/swf_shape_with_style.h
new file mode 100644 (file)
index 0000000..c44d05c
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+  +----------------------------------------------------------------------+
+  | Author: yoya@awm.jp                                                  |
+  +----------------------------------------------------------------------+
+*/
+
+#ifndef __SWF_SHAPE_WITH_STYLE_H__
+#define __SWF_SHAPE_WITH_STYLE_H__
+
+#include "swf_styles.h"
+#include "swf_shape_record.h"
+
+typedef struct swf_shape_with_style_ {
+    swf_styles_t       styles;
+    swf_shape_record_t *shape_records;
+} swf_shape_with_style_t;
+
+extern int swf_shape_with_style_parse(bitstream_t *bs, swf_shape_with_style_t *color);
+extern int swf_shape_with_style_build(bitstream_t *bs, swf_shape_with_style_t *color);
+extern int swf_shape_with_style_print(swf_shape_with_style_t *color);
+
+#endif /* __SWF_SHAPE_WITH_STYLE_H__ */
index 69fe9e9..20bd24a 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "swf_rect.h"
 #include "swf_morph_shape_with_style.h"
-// #include "swf_shape_with_style.h"
+#include "swf_shape_with_style.h"
 #include "swf_tag.h"
 
 typedef struct swf_tag_shape_detail_ {
@@ -30,9 +30,9 @@ typedef struct swf_tag_shape_detail_ {
     unsigned char define_shape_scaling_strokes;
     // is_morph
     unsigned long offset_morph;
-//     swf_morph_shape_with_style_t  morph_shape_with_style;
+     swf_morph_shape_with_style_t  morph_shape_with_style;
     // else
-//     swf_shape_with_style_t  morph_shape_with_style;
+    swf_shape_with_style_t  shape_with_style;
 } swf_tag_shape_detail_t;
 
 extern swf_tag_detail_handler_t *swf_tag_shape_detail_handler(void);