Libav
Functions | Variables
targaenc.c File Reference
#include <string.h>
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "internal.h"
#include "rle.h"
#include "targa.h"

Go to the source code of this file.

Functions

static int targa_encode_rle (uint8_t *outbuf, int out_size, const AVFrame *pic, int bpp, int w, int h)
 RLE compress the image, with maximum size of out_size. More...
 
static int targa_encode_normal (uint8_t *outbuf, const AVFrame *pic, int bpp, int w, int h)
 
static int targa_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
 
static av_cold int targa_encode_init (AVCodecContext *avctx)
 
static av_cold int targa_encode_close (AVCodecContext *avctx)
 

Variables

AVCodec ff_targa_encoder
 

Function Documentation

§ targa_encode_rle()

static int targa_encode_rle ( uint8_t outbuf,
int  out_size,
const 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().

§ targa_encode_normal()

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

Definition at line 62 of file targaenc.c.

Referenced by targa_encode_frame().

§ targa_encode_frame()

static int targa_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame p,
int *  got_packet 
)
static

Definition at line 77 of file targaenc.c.

§ targa_encode_init()

static av_cold int targa_encode_init ( AVCodecContext avctx)
static

Definition at line 151 of file targaenc.c.

§ targa_encode_close()

static av_cold int targa_encode_close ( AVCodecContext avctx)
static

Definition at line 163 of file targaenc.c.

Variable Documentation

§ ff_targa_encoder

AVCodec ff_targa_encoder
Initial value:
= {
.name = "targa",
.long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
.encode2 = targa_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
},
}
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
Definition: pixfmt.h:118
static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
Definition: targaenc.c:77
static av_cold int targa_encode_close(AVCodecContext *avctx)
Definition: targaenc.c:163
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:145
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:98
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:68
Y , 8bpp.
Definition: pixfmt.h:73
static av_cold int targa_encode_init(AVCodecContext *avctx)
Definition: targaenc.c:151
AVPixelFormat
Pixel format.
Definition: pixfmt.h:63

Definition at line 169 of file targaenc.c.