Browse Source

Support gray8a png encoding.

tags/n0.10
Carl Eugen Hoyos 13 years ago
parent
commit
ed10ca4c76
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavcodec/pngenc.c

+ 5
- 1
libavcodec/pngenc.c View File

@@ -264,6 +264,10 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
bit_depth = 8; bit_depth = 8;
color_type = PNG_COLOR_TYPE_GRAY; color_type = PNG_COLOR_TYPE_GRAY;
break; break;
case PIX_FMT_GRAY8A:
bit_depth = 8;
color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
break;
case PIX_FMT_MONOBLACK: case PIX_FMT_MONOBLACK:
bit_depth = 1; bit_depth = 1;
color_type = PNG_COLOR_TYPE_GRAY; color_type = PNG_COLOR_TYPE_GRAY;
@@ -443,6 +447,6 @@ AVCodec ff_png_encoder = {
.priv_data_size = sizeof(PNGEncContext), .priv_data_size = sizeof(PNGEncContext),
.init = png_enc_init, .init = png_enc_init,
.encode = encode_frame, .encode = encode_frame,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_PAL8, PIX_FMT_GRAY8, PIX_FMT_MONOBLACK, PIX_FMT_NONE},
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_PAL8, PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_MONOBLACK, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("PNG image"), .long_name= NULL_IF_CONFIG_SMALL("PNG image"),
}; };

Loading…
Cancel
Save