[Ffmpeg-cvslog] r6883 - trunk/libavcodec/targa.c
kostya
subversion
Fri Nov 3 14:13:09 CET 2006
Author: kostya
Date: Fri Nov 3 14:13:08 2006
New Revision: 6883
Modified:
trunk/libavcodec/targa.c
Log:
RGB32 support in Targa
Modified: trunk/libavcodec/targa.c
==============================================================================
--- trunk/libavcodec/targa.c (original)
+++ trunk/libavcodec/targa.c Fri Nov 3 14:13:08 2006
@@ -68,6 +68,9 @@
dst[1] = src[1];
dst[2] = src[2];
break;
+ case 4:
+ *((uint32_t*)dst) = LE_32(src);
+ break;
}
dst += depth;
if(!type)
@@ -128,6 +131,9 @@
case 24:
avctx->pix_fmt = PIX_FMT_BGR24;
break;
+ case 32:
+ avctx->pix_fmt = PIX_FMT_RGBA32;
+ break;
default:
av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", s->bpp);
return -1;
@@ -195,6 +201,10 @@
uint16_t *dst16 = (uint16_t*)dst;
for(x = 0; x < s->width; x++)
dst16[x] = LE_16(buf + x * 2);
+ }else if((s->bpp + 1) >> 3 == 4){
+ uint32_t *dst32 = (uint32_t*)dst;
+ for(x = 0; x < s->width; x++)
+ dst32[x] = LE_32(buf + x * 4);
}else
#endif
memcpy(dst, buf, s->width * ((s->bpp + 1) >> 3));
More information about the ffmpeg-cvslog
mailing list