28 int buf_size,
void *
data)
33 int i, h, w, n, linesize,
depth, maxval;
34 const char *tuple_type;
57 tuple_type =
"BLACKANDWHITE";
63 tuple_type =
"GRAYSCALE";
75 tuple_type =
"RGB_ALPHA";
81 "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLETYPE %s\nENDHDR\n",
82 w, h,
depth, maxval, tuple_type);
92 for (i = 0; i < h; i++) {
93 for (j = 0; j < w; j++) {
94 v = ((uint32_t *)ptr)[j];
101 for (i = 0; i < h; i++) {
struct PNMContext PNMContext
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
static int init(AVCodecParserContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
uint8_t * bytestream_start
av_cold int ff_pnm_init(AVCodecContext *avctx)
packed RGB 8:8:8, 24bpp, RGBRGB...
int key_frame
1 -> keyframe, 0-> not