# HG changeset patch # User diego # Date 1174136194 0 # Node ID 046456cf7d3189446232a9c2a4eee77e5dad0d93 # Parent c23a5c8263bc95489582ee2280df06f0ea79b9d0 Add 15 bit support, patch by Bobby Bingham, uhmmmm gmail com. diff -r c23a5c8263bc -r 046456cf7d31 targaenc.c --- a/targaenc.c Thu Mar 15 23:45:20 2007 +0000 +++ b/targaenc.c Sat Mar 17 12:56:34 2007 +0000 @@ -46,13 +46,18 @@ AV_WL16(outbuf+14, avctx->height); outbuf[17] = 0x20; /* origin is top-left. no alpha */ - /* TODO: support alpha channel and other bit-depths. and RLE? */ + /* TODO: support alpha channel and RLE */ switch(avctx->pix_fmt) { case PIX_FMT_GRAY8: outbuf[2] = 3; /* uncompressed grayscale image */ outbuf[16] = 8; /* bpp */ n = avctx->width; break; + case PIX_FMT_RGB555: + outbuf[2] = 2; /* uncompresses true-color image */ + outbuf[16] = 16; /* bpp */ + n = 2 * avctx->width; + break; case PIX_FMT_BGR24: outbuf[2] = 2; /* uncompressed true-color image */ outbuf[16] = 24; /* bpp */ @@ -92,5 +97,5 @@ .priv_data_size = 0, .init = targa_encode_init, .encode = targa_encode_frame, - .pix_fmts= (enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_GRAY8, -1}, + .pix_fmts= (enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_RGB555, PIX_FMT_GRAY8, -1}, };