comparison sunrast.c @ 10358:028a4deb56d3 libavcodec

Sun Raster RGB support
author pross
date Sun, 04 Oct 2009 08:42:23 +0000
parents 6a3f4053d935
children 8a4984c5cacc
comparison
equal deleted inserted replaced
10357:ada571517e88 10358:028a4deb56d3
62 depth = AV_RB32(buf+12); 62 depth = AV_RB32(buf+12);
63 type = AV_RB32(buf+20); 63 type = AV_RB32(buf+20);
64 maptype = AV_RB32(buf+24); 64 maptype = AV_RB32(buf+24);
65 maplength = AV_RB32(buf+28); 65 maplength = AV_RB32(buf+28);
66 66
67 if (type > RT_BYTE_ENCODED && type <= RT_FORMAT_IFF) { 67 if (type == RT_FORMAT_TIFF || type == RT_FORMAT_IFF) {
68 av_log(avctx, AV_LOG_ERROR, "unsupported (compression) type\n"); 68 av_log(avctx, AV_LOG_ERROR, "unsupported (compression) type\n");
69 return -1; 69 return -1;
70 } 70 }
71 if (type > RT_FORMAT_IFF) { 71 if (type > RT_FORMAT_IFF) {
72 av_log(avctx, AV_LOG_ERROR, "invalid (compression) type\n"); 72 av_log(avctx, AV_LOG_ERROR, "invalid (compression) type\n");
85 break; 85 break;
86 case 8: 86 case 8:
87 avctx->pix_fmt = PIX_FMT_PAL8; 87 avctx->pix_fmt = PIX_FMT_PAL8;
88 break; 88 break;
89 case 24: 89 case 24:
90 avctx->pix_fmt = PIX_FMT_BGR24; 90 avctx->pix_fmt = (type == RT_FORMAT_RGB) ? PIX_FMT_RGB24 : PIX_FMT_BGR24;
91 break; 91 break;
92 default: 92 default:
93 av_log(avctx, AV_LOG_ERROR, "invalid depth\n"); 93 av_log(avctx, AV_LOG_ERROR, "invalid depth\n");
94 return -1; 94 return -1;
95 } 95 }