svnno****@sourc*****
svnno****@sourc*****
2011年 4月 1日 (金) 19:43:00 JST
Revision: 502 http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=502 Author: yoya Date: 2011-04-01 19:42:59 +0900 (Fri, 01 Apr 2011) Log Message: ----------- swf_object_is_shape_tagdata, swf_object_is_bitmap_tagdata の実装 Modified Paths: -------------- trunk/src/swf_object.c trunk/src/swf_object.h -------------- next part -------------- Modified: trunk/src/swf_object.c =================================================================== --- trunk/src/swf_object.c 2011-04-01 10:29:14 UTC (rev 501) +++ trunk/src/swf_object.c 2011-04-01 10:42:59 UTC (rev 502) @@ -1352,3 +1352,39 @@ } return result; } + +int +swf_object_is_shape_tagdata(unsigned char *data, int data_len) { + bitstream_t *bs; + swf_tag_t *tag; + int ret = 0; // default FALSE; + + bs = bitstream_open(); + bitstream_input(bs, data, data_len); + tag = swf_tag_create(bs); + if (tag) { + if (isShapeTag(tag->tag)) { + ret = 1; // TRUE + } + } + bitstream_close(bs); + return ret; +} + +int +swf_object_is_bitmap_tagdata(unsigned char *data, int data_len) { + bitstream_t *bs; + swf_tag_t *tag; + int ret = 0; // default FALSE; + + bs = bitstream_open(); + bitstream_input(bs, data, data_len); + tag = swf_tag_create(bs); + if (tag) { + if (isBitmapTag(tag->tag)) { + ret = 1; // TRUE + } + } + bitstream_close(bs); + return ret; +} Modified: trunk/src/swf_object.h =================================================================== --- trunk/src/swf_object.h 2011-04-01 10:29:14 UTC (rev 501) +++ trunk/src/swf_object.h 2011-04-01 10:42:59 UTC (rev 502) @@ -119,4 +119,11 @@ signed int trans_y); extern int swf_object_apply_shapetype_tilled(swf_object_t *swf,int shape_id); + +/* --- */ + +extern int swf_object_is_shape_tagdata(unsigned char *data, int data_len); + +extern int swf_object_is_bitmap_tagdata(unsigned char *data, int data_len); + #endif /* __SWF_OBJECT_H__ */