OSDN Git Service

delete png_set_gAMA
[swfed/swfed.git] / src / swf_xrgb.c
1 #include <stdio.h>
2 #include "bitstream.h"
3 #include "swf_xrgb.h"
4
5 int
6 swf_xrgb_parse(bitstream_t *bs, swf_xrgb_t *color) {
7     int ret;
8     (void) bitstream_getbyte(bs); // pad
9     color->red   = bitstream_getbyte(bs);
10     color->green = bitstream_getbyte(bs);
11     ret = bitstream_getbyte(bs);
12     if (ret < 0) {
13         return 1;
14     }
15     color->blue = ret;
16     return 0;
17 }
18
19 int
20 swf_xrgb_build(bitstream_t *bs, swf_xrgb_t *color) {
21     bitstream_putbyte(bs, 0); // pad
22     bitstream_putbyte(bs, color->red);
23     bitstream_putbyte(bs, color->green);
24     bitstream_putbyte(bs, color->blue);
25     return 0;
26 }
27
28 int
29 swf_xrgb_print(swf_xrgb_t *color) {
30     printf("pad=0xXX red=0x%02x  green=0x%02X  blue=0x%02x\n",
31            color->red, color->green, color->blue);
32     return 0;
33 }