diff options
author | Carl Eugen Hoyos | 2012-01-01 04:44:46 +0100 |
---|---|---|
committer | Carl Eugen Hoyos | 2012-01-01 04:44:46 +0100 |
commit | 03d7d8faef23193b2e4f4ee6081d4a7db81e602a (patch) | |
tree | 4203434ec231279edc44f76f3cfea5d6f677b158 /libavcodec/pamenc.c | |
parent | 490c97bdf5ed1c6f05abe4446e67e598881fc53f (diff) |
Support gray8a pam encoding.
Diffstat (limited to 'libavcodec/pamenc.c')
-rw-r--r-- | libavcodec/pamenc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c index c19ea0e117..e69c53f72a 100644 --- a/libavcodec/pamenc.c +++ b/libavcodec/pamenc.c @@ -62,6 +62,12 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, maxval = 255; tuple_type = "GRAYSCALE"; break; + case PIX_FMT_GRAY8A: + n = w * 2; + depth = 2; + maxval = 255; + tuple_type = "GRAYSCALE_ALPHA"; + break; case PIX_FMT_RGB24: n = w * 3; depth = 3; @@ -122,6 +128,6 @@ AVCodec ff_pam_encoder = { .priv_data_size = sizeof(PNMContext), .init = ff_pnm_init, .encode = pam_encode_frame, - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOBLACK, PIX_FMT_NONE}, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_MONOBLACK, PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), }; |