FFmpeg
Classes | Macros | Typedefs | Functions | Variables
vf_remap.c File Reference

Pixel remap filter This filter copies pixel by pixel a source frame to a target frame. More...

#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"

Classes

struct  RemapContext
 

Macros

#define OFFSET(x)   offsetof(RemapContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Typedefs

typedef struct RemapContext RemapContext
 

Functions

 AVFILTER_DEFINE_CLASS (remap)
 

Variables

AVFilter ff_vf_remap
 

Detailed Description

Pixel remap filter This filter copies pixel by pixel a source frame to a target frame.

It remaps the pixels to a new x,y destination based on two files ymap/xmap. Map files are passed as a parameter and are in PGM format (P2 or P5), where the values are y(rows)/x(cols) coordinates of the source_frame. The target frame dimension is based on mapfile dimensions: specified in the header of the mapfile and reflected in the number of datavalues. Dimensions of ymap and xmap must be equal. Datavalues must be positive or zero. Any datavalue in the ymap or xmap which value is higher then the source frame height or width is silently ignored, leaving a blank/chromakey pixel. This can safely be used as a feature to create overlays.

Algorithm digest: Target_frame[y][x] = Source_frame[ ymap[y][x] ][ [xmap[y][x] ];

Variable Documentation

§ ff_vf_remap

AVFilter ff_vf_remap
Initial value:
= {
.name = "remap",
.description = NULL_IF_CONFIG_SMALL("Remap pixels."),
.priv_size = sizeof(RemapContext),
.uninit = uninit,
.query_formats = query_formats,
.activate = activate,
.inputs = remap_inputs,
.outputs = remap_outputs,
.priv_class = &remap_class,
}
Definition: vf_remap.c:48
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186