frei0r API 1.2
frei0r.h
Go to the documentation of this file.
1
209#ifndef INCLUDED_FREI0R_H
210#define INCLUDED_FREI0R_H
211
212#include <inttypes.h>
213
214/*
215 * Bundle builds give every plugin a private, token-prefixed copy of the
216 * frei0r entry points. Ordinary module builds leave these names untouched.
217 * CMake validates that FREI0R_BUNDLE_PLUGIN_TOKEN is a C identifier before
218 * adding it to a bundle target.
219 */
220#ifdef FREI0R_BUNDLE_PLUGIN_TOKEN
221#define F0R_BUNDLE_CONCAT_INNER(left, right) left##right
222#define F0R_BUNDLE_CONCAT(left, right) F0R_BUNDLE_CONCAT_INNER(left, right)
223#define F0R_BUNDLE_ENTRY(name) \
224 F0R_BUNDLE_CONCAT(FREI0R_BUNDLE_PLUGIN_TOKEN, F0R_BUNDLE_CONCAT(_, name))
225
226#define f0r_init F0R_BUNDLE_ENTRY(f0r_init)
227#define f0r_deinit F0R_BUNDLE_ENTRY(f0r_deinit)
228#define f0r_get_plugin_info F0R_BUNDLE_ENTRY(f0r_get_plugin_info)
229#define f0r_get_param_info F0R_BUNDLE_ENTRY(f0r_get_param_info)
230#define f0r_construct F0R_BUNDLE_ENTRY(f0r_construct)
231#define f0r_destruct F0R_BUNDLE_ENTRY(f0r_destruct)
232#define f0r_set_param_value F0R_BUNDLE_ENTRY(f0r_set_param_value)
233#define f0r_get_param_value F0R_BUNDLE_ENTRY(f0r_get_param_value)
234#define f0r_update F0R_BUNDLE_ENTRY(f0r_update)
235#define f0r_update2 F0R_BUNDLE_ENTRY(f0r_update2)
236
237/* Bundle objects are linked into one library, never loaded as modules. */
238#undef FREI0R_PUBLIC
239#if defined(_WIN32) || defined(__CYGWIN__)
240#define FREI0R_PUBLIC
241#elif defined(__GNUC__) && __GNUC__ >= 4
242#define FREI0R_PUBLIC __attribute__((visibility("hidden")))
243#else
244#define FREI0R_PUBLIC
245#endif
246#endif
247
256#ifndef FREI0R_PUBLIC
257#if defined(_WIN32) || defined(__CYGWIN__)
258#if defined(FREI0R_PLUGIN)
259#define FREI0R_PUBLIC __declspec(dllexport)
260#else
261#define FREI0R_PUBLIC
262#endif
263#elif defined(__GNUC__) && __GNUC__ >= 4
264#define FREI0R_PUBLIC __attribute__((visibility("default")))
265#else
266#define FREI0R_PUBLIC
267#endif
268#endif
269
273#define FREI0R_MAJOR_VERSION 1
274
278#define FREI0R_MINOR_VERSION 2
279
280//---------------------------------------------------------------------------
281
287
293
294//---------------------------------------------------------------------------
295
303#define F0R_PLUGIN_TYPE_FILTER 0
305#define F0R_PLUGIN_TYPE_SOURCE 1
307#define F0R_PLUGIN_TYPE_MIXER2 2
309#define F0R_PLUGIN_TYPE_MIXER3 3
310
313//---------------------------------------------------------------------------
314
355#define F0R_COLOR_MODEL_BGRA8888 0
356
364#define F0R_COLOR_MODEL_RGBA8888 1
365
378#define F0R_COLOR_MODEL_PACKED32 2
412
413
420
421//---------------------------------------------------------------------------
422
433#define F0R_PARAM_BOOL 0
434
439#define F0R_PARAM_DOUBLE 1
440
445#define F0R_PARAM_COLOR 2
450#define F0R_PARAM_POSITION 3
451
456#define F0R_PARAM_STRING 4
457
462typedef double f0r_param_bool;
463
467typedef double f0r_param_double;
468
472typedef struct f0r_param_color
473{
474 float r;
475 float g;
476 float b;
478
482typedef struct f0r_param_position
483{
484 double x;
485 double y;
487
488
493typedef char* f0r_param_string;
494
504typedef struct f0r_param_info
505{
506 const char* name;
507 int type;
508 const char* explanation;
510
520
521//---------------------------------------------------------------------------
522
526typedef void* f0r_instance_t;
527
542FREI0R_PUBLIC f0r_instance_t f0r_construct(unsigned int width, unsigned int height);
543
552
553//---------------------------------------------------------------------------
554
558typedef void* f0r_param_t;
559
585 f0r_param_t param, int param_index);
586
605 f0r_param_t param, int param_index);
606
607//---------------------------------------------------------------------------
608
635 double time, const uint32_t* inframe, uint32_t* outframe);
636
637//---------------------------------------------------------------------------
638
661 double time,
662 const uint32_t* inframe1,
663 const uint32_t* inframe2,
664 const uint32_t* inframe3,
665 uint32_t* outframe);
666//---------------------------------------------------------------------------
667
668#endif
FREI0R_PUBLIC f0r_instance_t f0r_construct(unsigned int width, unsigned int height)
FREI0R_PUBLIC void f0r_get_param_info(f0r_param_info_t *info, int param_index)
FREI0R_PUBLIC int f0r_init(void)
void * f0r_param_t
Definition frei0r.h:558
#define FREI0R_PUBLIC
Definition frei0r.h:266
struct f0r_param_info f0r_param_info_t
FREI0R_PUBLIC void f0r_get_param_value(f0r_instance_t instance, f0r_param_t param, int param_index)
FREI0R_PUBLIC void f0r_deinit(void)
FREI0R_PUBLIC void f0r_update(f0r_instance_t instance, double time, const uint32_t *inframe, uint32_t *outframe)
FREI0R_PUBLIC void f0r_set_param_value(f0r_instance_t instance, f0r_param_t param, int param_index)
FREI0R_PUBLIC void f0r_update2(f0r_instance_t instance, double time, const uint32_t *inframe1, const uint32_t *inframe2, const uint32_t *inframe3, uint32_t *outframe)
struct f0r_plugin_info f0r_plugin_info_t
FREI0R_PUBLIC void f0r_get_plugin_info(f0r_plugin_info_t *info)
void * f0r_instance_t
Definition frei0r.h:526
FREI0R_PUBLIC void f0r_destruct(f0r_instance_t instance)
double f0r_param_double
Definition frei0r.h:467
double f0r_param_bool
Definition frei0r.h:462
struct f0r_param_position f0r_param_position_t
char * f0r_param_string
Definition frei0r.h:493
struct f0r_param_color f0r_param_color_t
const char * explanation
Definition frei0r.h:508
const char * name
Definition frei0r.h:506
const char * name
Definition frei0r.h:399
int major_version
Definition frei0r.h:407
const char * explanation
Definition frei0r.h:410
int frei0r_version
Definition frei0r.h:406
int minor_version
Definition frei0r.h:408
const char * author
Definition frei0r.h:400