28 const AVFrame *p,
int *got_packet)
31 int i, h, w,
n, linesize,
depth, maxval,
ret;
32 const char *tuple_type;
42 tuple_type =
"BLACKANDWHITE";
48 tuple_type =
"GRAYSCALE";
54 tuple_type =
"GRAYSCALE";
60 tuple_type =
"GRAYSCALE_ALPHA";
72 tuple_type =
"RGB_ALPHA";
84 tuple_type =
"RGB_ALPHA";
98 "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLTYPE %s\nENDHDR\n",
99 w, h, depth, maxval, tuple_type);
107 for (i = 0; i < h; i++) {
108 for (j = 0; j < w; j++)
109 *s->
bytestream++ = ptr[j >> 3] >> (7 - j & 7) & 1;
113 for (i = 0; i < h; i++) {
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
This structure describes decoded (raw) audio or video data.
packed RGB 8:8:8, 24bpp, RGBRGB...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
const char * name
Name of the codec implementation.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
AVPixelFormat
Pixel format.
int flags
A combination of AV_PKT_FLAG values.
int width
picture width / height.
main external API structure.
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
common internal api header.
uint8_t * bytestream_start
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.