OSDN Git Service

delete png_set_gAMA
[swfed/swfed.git] / src / swf_rgba.c
1 #include <stdio.h>
2 #include "bitstream.h"
3 #include "swf_rgba.h"
4
5 int
6 swf_rgba_parse(bitstream_t *bs, swf_rgba_t *color) {
7     int ret;
8     color->red   = bitstream_getbyte(bs);
9     color->green = bitstream_getbyte(bs);
10     color->blue  = bitstream_getbyte(bs);
11     ret = bitstream_getbyte(bs);
12     if (ret < 0) {
13       return 1;
14     }
15     color->alpha = ret;
16     return 0;
17 }
18
19 int
20 swf_rgba_build(bitstream_t *bs, swf_rgba_t *color) {
21     bitstream_putbyte(bs, color->red);
22     bitstream_putbyte(bs, color->green);
23     bitstream_putbyte(bs, color->blue);
24     bitstream_putbyte(bs, color->alpha);
25     return 0;
26 }
27
28 int
29 swf_rgba_print(swf_rgba_t *color, int indent_depth) {
30     print_indent(indent_depth);
31     printf("RGB(A)=#%02x%02x%02x(%02x)\n",
32            color->red, color->green, color->blue, color->alpha);
33     return 0;
34 }