targaenc.c File Reference
#include "libavutil/intreadwrite.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "rle.h"
#include "targa.h"

Go to the source code of this file.

Data Structures

struct  TargaContext

Typedefs

typedef struct TargaContext TargaContext

Functions

static int targa_encode_rle (uint8_t *outbuf, int out_size, AVFrame *pic, int bpp, int w, int h)
 RLE compress the image, with maximum size of out_size.
static int targa_encode_normal (uint8_t *outbuf, AVFrame *pic, int bpp, int w, int h)
static int targa_encode_frame (AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data)
static av_cold int targa_encode_init (AVCodecContext *avctx)

Variables

AVCodec ff_targa_encoder

Typedef Documentation

typedef struct TargaContext TargaContext

Function Documentation

static int targa_encode_frame ( AVCodecContext avctx,
unsigned char *  outbuf,
int  buf_size,
void data 
)
static

Definition at line 77 of file targaenc.c.

static av_cold int targa_encode_init ( AVCodecContext avctx)
static

Definition at line 151 of file targaenc.c.

static int targa_encode_normal ( uint8_t *  outbuf,
AVFrame pic,
int  bpp,
int  w,
int  h 
)
static

Definition at line 62 of file targaenc.c.

Referenced by targa_encode_frame().

static int targa_encode_rle ( uint8_t *  outbuf,
int  out_size,
AVFrame pic,
int  bpp,
int  w,
int  h 
)
static

RLE compress the image, with maximum size of out_size.

Parameters
outbufOutput buffer
out_sizeMaximum output size
picImage to compress
bppBytes per pixel
wImage width
hImage height
Returns
Size of output in bytes, or -1 if larger than out_size

Definition at line 42 of file targaenc.c.

Referenced by targa_encode_frame().

Variable Documentation

AVCodec ff_targa_encoder
Initial value:
{
.name = "targa",
.priv_data_size = sizeof(TargaContext),
.encode = targa_encode_frame,
.long_name= NULL_IF_CONFIG_SMALL("Truevision Targa image"),
}

Definition at line 162 of file targaenc.c.