pcxenc.c File Reference

PCX image encoder. More...

#include "avcodec.h"
#include "bytestream.h"
#include "libavutil/imgutils.h"
#include "internal.h"
Include dependency graph for pcxenc.c:

Go to the source code of this file.

Data Structures

struct  PCXContext
 

Typedefs

typedef struct PCXContext PCXContext
 

Functions

static av_cold int pcx_encode_init (AVCodecContext *avctx)
 
static int pcx_rle_encode (uint8_t *dst, int dst_size, const uint8_t *src, int src_plane_size, int nplanes)
 PCX run-length encoder. More...
 
static int pcx_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 

Variables

static const uint32_t monoblack_pal [16] = { 0x000000, 0xFFFFFF }
 
AVCodec ff_pcx_encoder
 

Detailed Description

PCX image encoder.

Author
Daniel Verkamp
See also
http://www.qzx.com/pc-gpe/pcx.txt

Definition in file pcxenc.c.

Typedef Documentation

typedef struct PCXContext PCXContext

Function Documentation

static int pcx_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame frame,
int *  got_packet 
)
static

Definition at line 100 of file pcxenc.c.

static av_cold int pcx_encode_init ( AVCodecContext avctx)
static

Definition at line 40 of file pcxenc.c.

static int pcx_rle_encode ( uint8_t dst,
int  dst_size,
const uint8_t src,
int  src_plane_size,
int  nplanes 
)
static

PCX run-length encoder.

Parameters
dstoutput buffer
dst_sizesize of output buffer
srcinput buffer
src_plane_sizesize of one plane of input buffer in bytes
nplanesnumber of planes in input buffer
Returns
number of bytes written to dst or -1 on error
Bug:
will not work for nplanes != 1 && bpp != 8

Definition at line 60 of file pcxenc.c.

Referenced by pcx_encode_frame().

Variable Documentation

AVCodec ff_pcx_encoder
Initial value:
= {
.name = "pcx",
.priv_data_size = sizeof(PCXContext),
.encode2 = pcx_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
},
.long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
}
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:70
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:89
8 bit with PIX_FMT_RGB32 palette
Definition: pixfmt.h:79
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:92
static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition: pcxenc.c:100
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:87
struct PCXContext PCXContext
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:78
Y , 8bpp.
Definition: pixfmt.h:76
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:90
static av_cold int pcx_encode_init(AVCodecContext *avctx)
Definition: pcxenc.c:40
AVPixelFormat
Pixel format.
Definition: pixfmt.h:66

Definition at line 215 of file pcxenc.c.

const uint32_t monoblack_pal[16] = { 0x000000, 0xFFFFFF }
static

Definition at line 38 of file pcxenc.c.

Referenced by pcx_encode_frame().