OSDN Git Service

add bitmap_id parameter into apply factor method.
[swfed/swfed.git] / src / swf_rgb.c
1 #include <stdio.h>
2 #include "bitstream.h"
3 #include "swf_rgb.h"
4
5 int
6 swf_rgb_parse(bitstream_t *bs, swf_rgb_t *color) {
7     int ret;
8     color->red = bitstream_getbyte(bs);
9     color->green = bitstream_getbyte(bs);
10     ret = bitstream_getbyte(bs);
11     if (ret < 0) {
12       return 1;
13     }
14     color->blue = ret;
15     return 0;
16 }
17
18 int
19 swf_rgb_build(bitstream_t *bs, swf_rgb_t *color) {
20     bitstream_putbyte(bs, color->red);
21     bitstream_putbyte(bs, color->green);
22     bitstream_putbyte(bs, color->blue);
23     return 0;
24 }
25
26 int
27 swf_rgb_print(swf_rgb_t *color, int indent_depth) {
28     print_indent(indent_depth);
29     printf("RGB=#%02x%02x%02x\n",
30            color->red, color->green, color->blue);
31     return 0;
32 }