svnno****@sourc*****
svnno****@sourc*****
2009年 5月 21日 (木) 00:45:42 JST
Revision: 128 http://svn.sourceforge.jp/view?root=swfed&view=rev&rev=128 Author: yoya Date: 2009-05-21 00:45:42 +0900 (Thu, 21 May 2009) Log Message: ----------- DefineShape のデータ構造定義を追加 (まだ途中) Modified Paths: -------------- trunk/src/config.m4 trunk/src/swf_fill_style.h Added Paths: ----------- trunk/src/swf_fill_style_bitmap.h trunk/src/swf_fill_style_gradient.h trunk/src/swf_fill_style_solid.h trunk/src/swf_gradient.h trunk/src/swf_gradient_record.h trunk/src/swf_matrix.h -------------- next part -------------- Modified: trunk/src/config.m4 =================================================================== --- trunk/src/config.m4 2009-05-18 17:36:32 UTC (rev 127) +++ trunk/src/config.m4 2009-05-20 15:45:42 UTC (rev 128) @@ -61,5 +61,5 @@ dnl dnl PHP_SUBST(SWFED_SHARED_LIBADD) - PHP_NEW_EXTENSION(swfed, swfed.c swf_object.c swf_header.c swf_rect.c swf_tag.c swf_tag_jpeg.c swf_tag_edit.c swf_tag_action.c swf_tag_lossless.c swf_tag_sound.c swf_tag_sprite.c swf_rgb.c swf_rgba.c swf_argb.c swf_xrgb.c swf_action.c swf_jpeg.c bitstream.c jpeg_segment.c swf_png.c swf_gif.c swf_debug.c, $ext_shared) + PHP_NEW_EXTENSION(swfed, swfed.c swf_object.c swf_header.c swf_rect.c swf_tag.c swf_tag_jpeg.c swf_tag_edit.c swf_tag_action.c swf_tag_lossless.c swf_tag_sound.c swf_tag_sprite.c swf_tag_shape.c swf_rgb.c swf_rgba.c swf_argb.c swf_xrgb.c swf_action.c swf_jpeg.c bitstream.c jpeg_segment.c swf_png.c swf_gif.c swf_debug.c, $ext_shared) fi Modified: trunk/src/swf_fill_style.h =================================================================== --- trunk/src/swf_fill_style.h 2009-05-18 17:36:32 UTC (rev 127) +++ trunk/src/swf_fill_style.h 2009-05-20 15:45:42 UTC (rev 128) @@ -7,16 +7,15 @@ #ifndef __SWF_FILL_STYLE_H__ #define __SWF_FILL_STYLE_H__ -// #include "swf_fill_style_solid.h" -// #include "swf_fill_style_gradient.h" -// #include "swf_fill_style_bitmap.h" +#include "swf_fill_style_solid.h" +#include "swf_fill_style_gradient.h" +#include "swf_fill_style_bitmap.h" typedef union swf_fill_style_ { unsigned char type; - double dummy; -// swf_fill_style_solid_t solid; -// swf_fill_style_gradient_t gradient; -// swf_fill_style_bitmap_t bitmap; + swf_fill_style_solid_t solid; + swf_fill_style_gradient_t gradient; + swf_fill_style_bitmap_t bitmap; } swf_fill_style_t; extern int swf_fill_style_parse(bitstream_t *bs, swf_fill_style_t *color); Added: trunk/src/swf_fill_style_bitmap.h =================================================================== --- trunk/src/swf_fill_style_bitmap.h (rev 0) +++ trunk/src/swf_fill_style_bitmap.h 2009-05-20 15:45:42 UTC (rev 128) @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Author: yoya****@awm***** | + +----------------------------------------------------------------------+ +*/ + +#ifndef __SWF_FILL_STYLE_BITMAP_H__ +#define __SWF_FILL_STYLE_BITMAP_H__ + +#include "swf_matrix.h" + +typedef struct swf_fill_style_bitmap_ { + unsigned char type; + unsigned short bitmap_ref; + swf_matrix_t bitmap_matrix; + swf_matrix_t bitmap_matrix_morph; // DefineMorphShape, DefineMorphShape2 +} swf_fill_style_bitmap_t; + +extern int swf_fill_style_bitmap_parse(bitstream_t *bs, swf_fill_style_bitmap_t *color); +extern int swf_fill_style_bitmap_build(bitstream_t *bs, swf_fill_style_bitmap_t *color); +extern int swf_fill_style_bitmap_print(swf_fill_style_bitmap_t *color); + +#endif /* __SWF_FILL_STYLE_BITMAP_H__ */ Added: trunk/src/swf_fill_style_gradient.h =================================================================== --- trunk/src/swf_fill_style_gradient.h (rev 0) +++ trunk/src/swf_fill_style_gradient.h 2009-05-20 15:45:42 UTC (rev 128) @@ -0,0 +1,24 @@ +/* + +----------------------------------------------------------------------+ + | Author: yoya****@awm***** | + +----------------------------------------------------------------------+ +*/ + +#ifndef __SWF_FILL_STYLE_GRADIENT_H__ +#define __SWF_FILL_STYLE_GRADIENT_H__ + +#include "swf_matrix.h" +#include "swf_gradient.h" + +typedef union swf_fill_style_gradient_ { + unsigned char type; + swf_matrix_t gradient_matrix; + swf_matrix_t gradient_matrix_morph; // DefineMorphShape, DefineMorphShape2 + swf_gradient_t gradient; +} swf_fill_style_gradient_t; + +extern int swf_fill_style_gradient_parse(bitstream_t *bs, swf_fill_style_gradient_t *color); +extern int swf_fill_style_gradient_build(bitstream_t *bs, swf_fill_style_gradient_t *color); +extern int swf_fill_style_gradient_print(swf_fill_style_gradient_t *color); + +#endif /* __SWF_FILL_STYLE_GRADIENT_H__ */ Added: trunk/src/swf_fill_style_solid.h =================================================================== --- trunk/src/swf_fill_style_solid.h (rev 0) +++ trunk/src/swf_fill_style_solid.h 2009-05-20 15:45:42 UTC (rev 128) @@ -0,0 +1,24 @@ +/* + +----------------------------------------------------------------------+ + | Author: yoya****@awm***** | + +----------------------------------------------------------------------+ +*/ + +#ifndef __SWF_FILL_STYLE_SOLID_H__ +#define __SWF_FILL_STYLE_SOLID_H__ + +#include "swf_rgba.h" +#include "swf_rgb.h" + +typedef union swf_fill_style_solid_ { + unsigned char type; + swf_rgba_t rgba; // DefineMorphShape, DefineMorphShape2, DefineShape3 + swf_rgba_t rgba_morph; // DefineMorphShape, DefineMorphShape2 + swf_rgb_t rgb; // other tag +} swf_fill_style_solid_t; + +extern int swf_fill_style_solid_parse(bitstream_t *bs, swf_fill_style_solid_t *color); +extern int swf_fill_style_solid_build(bitstream_t *bs, swf_fill_style_solid_t *color); +extern int swf_fill_style_solid_print(swf_fill_style_solid_t *color); + +#endif /* __SWF_FILL_STYLE_SOLID_H__ */ Added: trunk/src/swf_gradient.h =================================================================== --- trunk/src/swf_gradient.h (rev 0) +++ trunk/src/swf_gradient.h 2009-05-20 15:45:42 UTC (rev 128) @@ -0,0 +1,26 @@ +/* + +----------------------------------------------------------------------+ + | Author: yoya****@awm***** | + +----------------------------------------------------------------------+ +*/ + +#ifndef __SWF_GRADIENT_H__ +#define __SWF_GRADIENT_H__ + +#include "swf_gradient_record.h" + +typedef union swf_gradient_ { + unsigned char spread_mode : 2; // DefineShape4 + unsigned char interpolation_mode : 2; // DefineShape4 + unsigned char pad : 4; // other tag + unsigned char count : 4; + swf_gradient_record_t *gradient_record; // count + signed short focal_point; // type == 0x13 + +} swf_gradient_t; + +extern int swf_gradient_parse(bitstream_t *bs, swf_gradient_t *color); +extern int swf_gradient_build(bitstream_t *bs, swf_gradient_t *color); +extern int swf_gradient_print(swf_gradient_t *color); + +#endif /* __SWF_GRADIENT_H__ */ Added: trunk/src/swf_gradient_record.h =================================================================== --- trunk/src/swf_gradient_record.h (rev 0) +++ trunk/src/swf_gradient_record.h 2009-05-20 15:45:42 UTC (rev 128) @@ -0,0 +1,25 @@ +/* + +----------------------------------------------------------------------+ + | Author: yoya****@awm***** | + +----------------------------------------------------------------------+ +*/ + +#ifndef __SWF_GRADIENT_RECORD_H__ +#define __SWF_GRADIENT_RECORD_H__ + +#include "swf_rgba.h" +#include "swf_rgb.h" + +typedef union swf_gradient_record_ { + unsigned char position; + swf_rgba_t rgba; // DefineMorphShape, DefineMorphShape2, DefineShape3, DefineShape4 + unsigned char position_morph; // DefineMorphShape, DefineMorphShape2 + swf_rgba_t rgba_morph; // DefineMorphShape, DefineMorphShape2 + swf_rgb_t rgb; // other +} swf_gradient_record_t; + +extern int swf_gradient_record_parse(bitstream_t *bs, swf_gradient_record_t *color); +extern int swf_gradient_record_build(bitstream_t *bs, swf_gradient_record_t *color); +extern int swf_gradient_record_print(swf_gradient_record_t *color); + +#endif /* __SWF_GRADIENT_RECORD_H__ */ Added: trunk/src/swf_matrix.h =================================================================== --- trunk/src/swf_matrix.h (rev 0) +++ trunk/src/swf_matrix.h 2009-05-20 15:45:42 UTC (rev 128) @@ -0,0 +1,24 @@ +/* + +----------------------------------------------------------------------+ + | Author: yoya****@awm***** | + +----------------------------------------------------------------------+ +*/ + +#ifndef __SWF_MATRIX_H__ +#define __SWF_MATRIX_H__ + +#include "swf_matrix.h" + +typedef struct swf_matrix_ { + // char align; + unsigned char has_scale:1; + unsigned char scale_bits; // : 5; + signed long scale_x; // : scale_bits; + signed long scale_y; // : scale_bits; +} swf_matrix_t; + +extern int swf_matrix_parse(bitstream_t *bs, swf_matrix_t *color); +extern int swf_matrix_build(bitstream_t *bs, swf_matrix_t *color); +extern int swf_matrix_print(swf_matrix_t *color); + +#endif /* __SWF_MATRIX_H__ */