Mercurial > libavcodec.hg
comparison gifdec.c @ 4060:e46fa0f9192a libavcodec
indention
author | bcoudurier |
---|---|
date | Sun, 22 Oct 2006 17:25:16 +0000 |
parents | 219f4a12f52a |
children | f426c81afc9e |
comparison
equal
deleted
inserted
replaced
4059:219f4a12f52a | 4060:e46fa0f9192a |
---|---|
249 if (left + width > s->screen_width || | 249 if (left + width > s->screen_width || |
250 top + height > s->screen_height) | 250 top + height > s->screen_height) |
251 return -EINVAL; | 251 return -EINVAL; |
252 | 252 |
253 /* build the palette */ | 253 /* build the palette */ |
254 n = (1 << bits_per_pixel); | 254 n = (1 << bits_per_pixel); |
255 spal = palette; | 255 spal = palette; |
256 for(i = 0; i < n; i++) { | 256 for(i = 0; i < n; i++) { |
257 s->image_palette[i] = (0xff << 24) | | 257 s->image_palette[i] = (0xff << 24) | |
258 (spal[0] << 16) | (spal[1] << 8) | (spal[2]); | 258 (spal[0] << 16) | (spal[1] << 8) | (spal[2]); |
259 spal += 3; | 259 spal += 3; |
260 } | 260 } |
261 for(; i < 256; i++) | 261 for(; i < 256; i++) |
262 s->image_palette[i] = (0xff << 24); | 262 s->image_palette[i] = (0xff << 24); |
263 /* handle transparency */ | 263 /* handle transparency */ |
264 if (s->transparent_color_index >= 0) | 264 if (s->transparent_color_index >= 0) |
265 s->image_palette[s->transparent_color_index] = 0; | 265 s->image_palette[s->transparent_color_index] = 0; |
266 line = NULL; | 266 line = NULL; |
267 | 267 |
268 /* now get the image data */ | 268 /* now get the image data */ |
269 code_size = bytestream_get_byte(&s->bytestream); | 269 code_size = bytestream_get_byte(&s->bytestream); |
270 GLZWDecodeInit(s, code_size); | 270 GLZWDecodeInit(s, code_size); |
271 | 271 |
274 ptr1 = s->picture.data[0] + top * linesize + (left * 3); | 274 ptr1 = s->picture.data[0] + top * linesize + (left * 3); |
275 ptr = ptr1; | 275 ptr = ptr1; |
276 pass = 0; | 276 pass = 0; |
277 y1 = 0; | 277 y1 = 0; |
278 for (y = 0; y < height; y++) { | 278 for (y = 0; y < height; y++) { |
279 GLZWDecode(s, ptr, width); | 279 GLZWDecode(s, ptr, width); |
280 if (is_interleaved) { | 280 if (is_interleaved) { |
281 switch(pass) { | 281 switch(pass) { |
282 default: | 282 default: |
283 case 0: | 283 case 0: |
284 case 1: | 284 case 1: |