Lines Matching +full:not +full:- +full:swapped

2 ** Easylogo TGA->header converter
5 ** AIRVENT SAM s.p.a - RIMINI(ITALY)
6 ** (C) 2007-2008 Mike Frysinger <vapier@gentoo.org>
72 while (count--) { in StringUpperCase()
75 *str = 'A' + (c - 'a'); in StringUpperCase()
85 while (count--) { in StringLowerCase()
88 *str = 'a' + (c - 'A'); in StringLowerCase()
96 /* Transform (0-255) components to (0-100) */ in pixel_rgb_to_yuyv()
97 pR = rgb_pixel->r * 100 / 255; in pixel_rgb_to_yuyv()
98 pG = rgb_pixel->g * 100 / 255; in pixel_rgb_to_yuyv()
99 pB = rgb_pixel->b * 100 / 255; in pixel_rgb_to_yuyv()
101 /* Calculate YUV values (0-255) from RGB beetween 0-100 */ in pixel_rgb_to_yuyv()
102 yuyv_pixel->y1 = yuyv_pixel->y2 = 209 * (pR + pG + pB) / 300 + 16; in pixel_rgb_to_yuyv()
103 yuyv_pixel->Cb = pB - (pR / 4) - (pG * 3 / 4) + 128; in pixel_rgb_to_yuyv()
104 yuyv_pixel->Cr = pR - (pG * 3 / 4) - (pB / 4) + 128; in pixel_rgb_to_yuyv()
115 if ((data->r < in printlogo_rgb()
116 30) /*&&(data->g == 0)&&(data->b == 0) */ ) in printlogo_rgb()
143 } swapped; in le16_to_cpu() local
145 swapped.val = val; in le16_to_cpu()
146 return (swapped.pval[1] << 8) + swapped.pval[0]; in le16_to_cpu()
158 return -1; in image_load_tga()
170 image->width = header.ImageWidth; in image_load_tga()
171 image->height = header.ImageHeight; in image_load_tga()
175 image->yuyv = 0; in image_load_tga()
176 image->palette_size = 0; in image_load_tga()
177 image->palette = NULL; in image_load_tga()
181 printf ("Format not supported!\n"); in image_load_tga()
182 return -1; in image_load_tga()
185 image->bpp = header.ImagePixelSize; in image_load_tga()
186 image->pixel_size = ((image->bpp - 1) / 8) + 1; in image_load_tga()
187 image->pixels = image->width * image->height; in image_load_tga()
188 image->size = image->pixels * image->pixel_size; in image_load_tga()
189 image->data = xmalloc (image->size); in image_load_tga()
191 if (image->bpp != 24) { in image_load_tga()
192 printf ("Bpp not supported: %d!\n", image->bpp); in image_load_tga()
193 return -1; in image_load_tga()
196 fread (image->data, image->size, 1, file); in image_load_tga()
200 p = image->data; in image_load_tga()
201 for (i = 0; i < image->pixels; i++, p++) { in image_load_tga()
202 app = p->r; in image_load_tga()
203 p->r = p->b; in image_load_tga()
204 p->b = app; in image_load_tga()
210 unsigned char *temp = xmalloc (image->size); in image_load_tga()
211 int linesize = image->pixel_size * image->width; in image_load_tga()
212 void *dest = image->data, in image_load_tga()
213 *source = temp + image->size - linesize; in image_load_tga()
218 return -1; in image_load_tga()
221 memcpy (temp, image->data, image->size); in image_load_tga()
222 for (i = 0; i < image->height; in image_load_tga()
223 i++, dest += linesize, source -= linesize) in image_load_tga()
229 printlogo_rgb (image->data, image->width, image->height); in image_load_tga()
238 free (image->data); in image_free()
239 free (image->palette); in image_free()
244 rgb_t *rgb_ptr = (rgb_t *) rgb_image->data; in image_rgb_to_yuyv()
249 yuyv_image->pixel_size = 2; in image_rgb_to_yuyv()
250 yuyv_image->bpp = 16; in image_rgb_to_yuyv()
251 yuyv_image->yuyv = 1; in image_rgb_to_yuyv()
252 yuyv_image->width = rgb_image->width; in image_rgb_to_yuyv()
253 yuyv_image->height = rgb_image->height; in image_rgb_to_yuyv()
254 yuyv_image->pixels = yuyv_image->width * yuyv_image->height; in image_rgb_to_yuyv()
255 yuyv_image->size = yuyv_image->pixels * yuyv_image->pixel_size; in image_rgb_to_yuyv()
256 dest = (unsigned short *) (yuyv_image->data = in image_rgb_to_yuyv()
257 xmalloc (yuyv_image->size)); in image_rgb_to_yuyv()
258 yuyv_image->palette = 0; in image_rgb_to_yuyv()
259 yuyv_image->palette_size = 0; in image_rgb_to_yuyv()
261 while ((count++) < rgb_image->pixels) { in image_rgb_to_yuyv()
273 printlogo_yuyv (yuyv_image->data, yuyv_image->width, in image_rgb_to_yuyv()
274 yuyv_image->height); in image_rgb_to_yuyv()
281 rgb_t *rgb_ptr = (rgb_t *) rgb888_image->data; in image_rgb888_to_rgb565()
285 rgb565_image->pixel_size = 2; in image_rgb888_to_rgb565()
286 rgb565_image->bpp = 16; in image_rgb888_to_rgb565()
287 rgb565_image->yuyv = 0; in image_rgb888_to_rgb565()
288 rgb565_image->width = rgb888_image->width; in image_rgb888_to_rgb565()
289 rgb565_image->height = rgb888_image->height; in image_rgb888_to_rgb565()
290 rgb565_image->pixels = rgb565_image->width * rgb565_image->height; in image_rgb888_to_rgb565()
291 rgb565_image->size = rgb565_image->pixels * rgb565_image->pixel_size; in image_rgb888_to_rgb565()
292 dest = (unsigned short *) (rgb565_image->data = in image_rgb888_to_rgb565()
293 xmalloc(rgb565_image->size)); in image_rgb888_to_rgb565()
294 rgb565_image->palette = 0; in image_rgb888_to_rgb565()
295 rgb565_image->palette_size = 0; in image_rgb888_to_rgb565()
297 while ((count++) < rgb888_image->pixels) { in image_rgb888_to_rgb565()
299 *dest++ = ((rgb_ptr->b & 0xF8) << 8) | in image_rgb888_to_rgb565()
300 ((rgb_ptr->g & 0xFC) << 3) | in image_rgb888_to_rgb565()
301 (rgb_ptr->r >> 3); in image_rgb888_to_rgb565()
320 int count = image->size, col = 0; in image_save_header()
321 unsigned char *dataptr = image->data; in image_save_header()
324 return -1; in image_save_header()
370 if (fwrite(image->data, image->size, 1, compfp) != 1) { in image_save_header()
401 fprintf (file, "static unsigned char EASYLOGO_DECOMP_BUFFER[%i];\n\n", image->size); in image_save_header()
409 return -1; in image_save_header()
419 image->width); in image_save_header()
421 image->height); in image_save_header()
423 image->pixels); in image_save_header()
424 fprintf (file, "#define DEF_%s_BPP\t\t%d\n", def_name, image->bpp); in image_save_header()
426 image->pixel_size); in image_save_header()
428 image->size); in image_save_header()
439 count--; in image_save_header()
455 count--; in image_save_header()
488 " -r Output RGB888 instead of YUYV\n" in usage()
489 " -s Output RGB565 instead of YUYV\n" in usage()
490 " -g Compress with gzip\n" in usage()
491 " -l Compress with lzma\n" in usage()
492 " -b Preallocate space in bss for decompressing image\n" in usage()
493 " -h Help output\n" in usage()
519 puts("Using 24-bit RGB888 Output Fromat"); in main()
523 puts("Using 16-bit RGB565 Output Fromat"); in main()
543 c = argc - optind; in main()
578 printf ("input file not found!\n"); in main()