LiVES  2.8.9
Macros | Functions
colourspace.c File Reference
#include <math.h>
#include "../libweed/weed.h"
#include "../libweed/weed-palettes.h"
#include "../libweed/weed-effects.h"
#include "../libweed/weed-host.h"
#include "main.h"
#include "cvirtual.h"
#include "effects-weed.h"

Macros

#define USE_THREADS   1
 

Functions

LIVES_GLOBAL_INLINE int get_rowstride_value (int rowstride)
 
LIVES_GLOBAL_INLINE int get_last_rowstride_value (int width, int nchans)
 
LIVES_INLINE uint8_t CLAMP0255 (int32_t a)
 
LIVES_INLINE uint8_t avg_chroma (size_t x, size_t y)
 
LIVES_INLINE void rgb2yuv (uint8_t r0, uint8_t g0, uint8_t b0, uint8_t *y, uint8_t *u, uint8_t *v)
 
LIVES_INLINE void rgb2uyvy (uint8_t r0, uint8_t g0, uint8_t b0, uint8_t r1, uint8_t g1, uint8_t b1, uyvy_macropixel *uyvy)
 
LIVES_INLINE void rgb2yuyv (uint8_t r0, uint8_t g0, uint8_t b0, uint8_t r1, uint8_t g1, uint8_t b1, yuyv_macropixel *yuyv)
 
LIVES_INLINE void rgb2_411 (uint8_t r0, uint8_t g0, uint8_t b0, uint8_t r1, uint8_t g1, uint8_t b1, uint8_t r2, uint8_t g2, uint8_t b2, uint8_t r3, uint8_t g3, uint8_t b3, yuv411_macropixel *yuv)
 
LIVES_INLINE void yuv2rgb (uint8_t y, uint8_t u, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b)
 
LIVES_INLINE void uyvy2rgb (uyvy_macropixel *uyvy, uint8_t *r0, uint8_t *g0, uint8_t *b0, uint8_t *r1, uint8_t *g1, uint8_t *b1)
 
LIVES_INLINE void yuyv2rgb (yuyv_macropixel *yuyv, uint8_t *r0, uint8_t *g0, uint8_t *b0, uint8_t *r1, uint8_t *g1, uint8_t *b1)
 
LIVES_INLINE void yuv888_2_rgb (uint8_t *yuv, uint8_t *rgb, boolean add_alpha)
 
LIVES_INLINE void yuva8888_2_rgba (uint8_t *yuva, uint8_t *rgba, boolean del_alpha)
 
LIVES_INLINE void yuv888_2_bgr (uint8_t *yuv, uint8_t *bgr, boolean add_alpha)
 
LIVES_INLINE void yuva8888_2_bgra (uint8_t *yuva, uint8_t *bgra, boolean del_alpha)
 
LIVES_INLINE void yuv888_2_argb (uint8_t *yuv, uint8_t *argb)
 
LIVES_INLINE void yuva8888_2_argb (uint8_t *yuva, uint8_t *argb)
 
LIVES_INLINE void uyvy_2_yuv422 (uyvy_macropixel *uyvy, uint8_t *y0, uint8_t *u0, uint8_t *v0, uint8_t *y1)
 
LIVES_INLINE void yuyv_2_yuv422 (yuyv_macropixel *yuyv, uint8_t *y0, uint8_t *u0, uint8_t *v0, uint8_t *y1)
 
LIVES_GLOBAL_INLINE boolean weed_palette_is_alpha_palette (int pal)
 
LIVES_GLOBAL_INLINE boolean weed_palette_is_rgb_palette (int pal)
 
LIVES_GLOBAL_INLINE boolean weed_palette_is_yuv_palette (int pal)
 
LIVES_GLOBAL_INLINE int weed_palette_get_numplanes (int pal)
 
LIVES_GLOBAL_INLINE boolean weed_palette_is_valid_palette (int pal)
 
LIVES_GLOBAL_INLINE int weed_palette_get_bits_per_macropixel (int pal)
 
LIVES_GLOBAL_INLINE int weed_palette_get_pixels_per_macropixel (int pal)
 
LIVES_GLOBAL_INLINE boolean weed_palette_is_float_palette (int pal)
 
LIVES_GLOBAL_INLINE boolean weed_palette_has_alpha_channel (int pal)
 
LIVES_GLOBAL_INLINE double weed_palette_get_plane_ratio_horizontal (int pal, int plane)
 
LIVES_GLOBAL_INLINE double weed_palette_get_plane_ratio_vertical (int pal, int plane)
 
boolean weed_palette_is_lower_quality (int p1, int p2)
 return TRUE if p1 is lower quality than p2 More...
 
const char * weed_palette_get_name (int pal)
 
const char * weed_yuv_clamping_get_name (int clamping)
 
const char * weed_yuv_subspace_get_name (int subspace)
 
char * weed_palette_get_name_full (int pal, int clamped, int subspace)
 
double weed_palette_get_compression_ratio (int pal)
 
boolean lives_pixbuf_is_all_black (LiVESPixbuf *pixbuf)
 
void pixel_data_planar_from_membuf (void **pixel_data, void *data, size_t size, int palette)
 
void * convert_yuv888_to_rgb_frame_thread (void *data)
 
void * convert_yuva8888_to_rgba_frame_thread (void *data)
 
void * convert_yuv888_to_bgr_frame_thread (void *data)
 
void * convert_yuva8888_to_bgra_frame_thread (void *data)
 
void * convert_yuv888_to_argb_frame_thread (void *data)
 
void * convert_yuva8888_to_argb_frame_thread (void *data)
 
void * convert_rgb_to_uyvy_frame_thread (void *data)
 
void * convert_rgb_to_yuyv_frame_thread (void *data)
 
void * convert_bgr_to_uyvy_frame_thread (void *data)
 
void * convert_bgr_to_yuyv_frame_thread (void *data)
 
void * convert_argb_to_uyvy_frame_thread (void *data)
 
void * convert_argb_to_yuyv_frame_thread (void *data)
 
void * convert_rgb_to_yuv_frame_thread (void *data)
 
void * convert_rgb_to_yuvp_frame_thread (void *data)
 
void * convert_bgr_to_yuv_frame_thread (void *data)
 
void * convert_bgr_to_yuvp_frame_thread (void *data)
 
void * convert_argb_to_yuv_frame_thread (void *data)
 
void * convert_argb_to_yuvp_frame_thread (void *data)
 
void * convert_uyvy_to_rgb_frame_thread (void *data)
 
void * convert_uyvy_to_bgr_frame_thread (void *data)
 
void * convert_uyvy_to_argb_frame_thread (void *data)
 
void * convert_yuyv_to_rgb_frame_thread (void *data)
 
void * convert_yuyv_to_bgr_frame_thread (void *data)
 
void * convert_yuyv_to_argb_frame_thread (void *data)
 
void * convert_yuv_planar_to_rgb_frame_thread (void *data)
 
void * convert_yuv_planar_to_bgr_frame_thread (void *data)
 
void * convert_yuv_planar_to_argb_frame_thread (void *data)
 
void * convert_swap3_frame_thread (void *data)
 
void * convert_swap4_frame_thread (void *data)
 
void * convert_swap3addpost_frame_thread (void *data)
 
void * convert_swap3addpre_frame_thread (void *data)
 
void * convert_swap3postalpha_frame_thread (void *data)
 
void * convert_addpost_frame_thread (void *data)
 
void * convert_addpre_frame_thread (void *data)
 
void * convert_swap3delpost_frame_thread (void *data)
 
void * convert_delpost_frame_thread (void *data)
 
void * convert_delpre_frame_thread (void *data)
 
void * convert_swap3delpre_frame_thread (void *data)
 
void * convert_swapprepost_frame_thread (void *data)
 
void * convert_swab_frame_thread (void *data)
 
void create_empty_pixel_data (weed_plant_t *layer, boolean black_fill, boolean may_contig)
 
void alpha_unpremult (weed_plant_t *layer, boolean un)
 
boolean convert_layer_palette_full (weed_plant_t *layer, int outpl, int osamtype, boolean oclamping, int osubspace)
 
boolean convert_layer_palette (weed_plant_t *layer, int outpl, int op_clamping)
 
LiVESPixbuf * lives_pixbuf_new_blank (int width, int height, int palette)
 
LIVES_INLINE LiVESPixbuf * lives_pixbuf_cheat (boolean has_alpha, int width, int height, uint8_t *buf)
 
LiVESPixbuf * layer_to_pixbuf (weed_plant_t *layer)
 
LIVES_INLINE boolean weed_palette_is_resizable (int pal, int clamped, boolean in_out)
 
void lives_pixbuf_set_opaque (LiVESPixbuf *pixbuf)
 
void compact_rowstrides (weed_plant_t *layer)
 
boolean resize_layer (weed_plant_t *layer, int width, int height, LiVESInterpType interp, int opal_hint, int oclamp_hint)
 
void letterbox_layer (weed_plant_t *layer, int width, int height, int nwidth, int nheight)
 
boolean pixbuf_to_layer (weed_plant_t *layer, LiVESPixbuf *pixbuf)
 
lives_painter_t * layer_to_lives_painter (weed_plant_t *layer)
 
boolean lives_painter_to_layer (lives_painter_t *cr, weed_plant_t *layer)
 
weed_plant_t * weed_layer_create (int width, int height, int *rowstrides, int current_palette)
 
weed_plant_t * weed_layer_copy (weed_plant_t *dlayer, weed_plant_t *slayer)
 
void weed_layer_pixel_data_free (weed_plant_t *layer)
 
void weed_layer_free (weed_plant_t *layer)
 
int weed_layer_get_palette (weed_plant_t *layer)
 
void insert_blank_frames (int sfileno, int nframes, int after)
 

Macro Definition Documentation

◆ USE_THREADS

#define USE_THREADS   1

Function Documentation

◆ alpha_unpremult()

void alpha_unpremult ( weed_plant_t *  layer,
boolean  un 
)

◆ avg_chroma()

LIVES_INLINE uint8_t avg_chroma ( size_t  x,
size_t  y 
)

◆ CLAMP0255()

LIVES_INLINE uint8_t CLAMP0255 ( int32_t  a)

◆ compact_rowstrides()

void compact_rowstrides ( weed_plant_t *  layer)

◆ convert_addpost_frame_thread()

void* convert_addpost_frame_thread ( void *  data)

◆ convert_addpre_frame_thread()

void* convert_addpre_frame_thread ( void *  data)

◆ convert_argb_to_uyvy_frame_thread()

void* convert_argb_to_uyvy_frame_thread ( void *  data)

◆ convert_argb_to_yuv_frame_thread()

void* convert_argb_to_yuv_frame_thread ( void *  data)

◆ convert_argb_to_yuvp_frame_thread()

void* convert_argb_to_yuvp_frame_thread ( void *  data)

◆ convert_argb_to_yuyv_frame_thread()

void* convert_argb_to_yuyv_frame_thread ( void *  data)

◆ convert_bgr_to_uyvy_frame_thread()

void* convert_bgr_to_uyvy_frame_thread ( void *  data)

◆ convert_bgr_to_yuv_frame_thread()

void* convert_bgr_to_yuv_frame_thread ( void *  data)

◆ convert_bgr_to_yuvp_frame_thread()

void* convert_bgr_to_yuvp_frame_thread ( void *  data)

◆ convert_bgr_to_yuyv_frame_thread()

void* convert_bgr_to_yuyv_frame_thread ( void *  data)

◆ convert_delpost_frame_thread()

void* convert_delpost_frame_thread ( void *  data)

◆ convert_delpre_frame_thread()

void* convert_delpre_frame_thread ( void *  data)

◆ convert_layer_palette()

boolean convert_layer_palette ( weed_plant_t *  layer,
int  outpl,
int  op_clamping 
)

◆ convert_layer_palette_full()

boolean convert_layer_palette_full ( weed_plant_t *  layer,
int  outpl,
int  osamtype,
boolean  oclamping,
int  osubspace 
)

◆ convert_rgb_to_uyvy_frame_thread()

void* convert_rgb_to_uyvy_frame_thread ( void *  data)

◆ convert_rgb_to_yuv_frame_thread()

void* convert_rgb_to_yuv_frame_thread ( void *  data)

◆ convert_rgb_to_yuvp_frame_thread()

void* convert_rgb_to_yuvp_frame_thread ( void *  data)

◆ convert_rgb_to_yuyv_frame_thread()

void* convert_rgb_to_yuyv_frame_thread ( void *  data)

◆ convert_swab_frame_thread()

void* convert_swab_frame_thread ( void *  data)

◆ convert_swap3_frame_thread()

void* convert_swap3_frame_thread ( void *  data)

◆ convert_swap3addpost_frame_thread()

void* convert_swap3addpost_frame_thread ( void *  data)

◆ convert_swap3addpre_frame_thread()

void* convert_swap3addpre_frame_thread ( void *  data)

◆ convert_swap3delpost_frame_thread()

void* convert_swap3delpost_frame_thread ( void *  data)

◆ convert_swap3delpre_frame_thread()

void* convert_swap3delpre_frame_thread ( void *  data)

◆ convert_swap3postalpha_frame_thread()

void* convert_swap3postalpha_frame_thread ( void *  data)

◆ convert_swap4_frame_thread()

void* convert_swap4_frame_thread ( void *  data)

◆ convert_swapprepost_frame_thread()

void* convert_swapprepost_frame_thread ( void *  data)

◆ convert_uyvy_to_argb_frame_thread()

void* convert_uyvy_to_argb_frame_thread ( void *  data)

◆ convert_uyvy_to_bgr_frame_thread()

void* convert_uyvy_to_bgr_frame_thread ( void *  data)

◆ convert_uyvy_to_rgb_frame_thread()

void* convert_uyvy_to_rgb_frame_thread ( void *  data)

◆ convert_yuv888_to_argb_frame_thread()

void* convert_yuv888_to_argb_frame_thread ( void *  data)

◆ convert_yuv888_to_bgr_frame_thread()

void* convert_yuv888_to_bgr_frame_thread ( void *  data)

◆ convert_yuv888_to_rgb_frame_thread()

void* convert_yuv888_to_rgb_frame_thread ( void *  data)

◆ convert_yuv_planar_to_argb_frame_thread()

void* convert_yuv_planar_to_argb_frame_thread ( void *  data)

◆ convert_yuv_planar_to_bgr_frame_thread()

void* convert_yuv_planar_to_bgr_frame_thread ( void *  data)

◆ convert_yuv_planar_to_rgb_frame_thread()

void* convert_yuv_planar_to_rgb_frame_thread ( void *  data)

◆ convert_yuva8888_to_argb_frame_thread()

void* convert_yuva8888_to_argb_frame_thread ( void *  data)

◆ convert_yuva8888_to_bgra_frame_thread()

void* convert_yuva8888_to_bgra_frame_thread ( void *  data)

◆ convert_yuva8888_to_rgba_frame_thread()

void* convert_yuva8888_to_rgba_frame_thread ( void *  data)

◆ convert_yuyv_to_argb_frame_thread()

void* convert_yuyv_to_argb_frame_thread ( void *  data)

◆ convert_yuyv_to_bgr_frame_thread()

void* convert_yuyv_to_bgr_frame_thread ( void *  data)

◆ convert_yuyv_to_rgb_frame_thread()

void* convert_yuyv_to_rgb_frame_thread ( void *  data)

◆ create_empty_pixel_data()

void create_empty_pixel_data ( weed_plant_t *  layer,
boolean  black_fill,
boolean  may_contig 
)

◆ get_last_rowstride_value()

LIVES_GLOBAL_INLINE int get_last_rowstride_value ( int  width,
int  nchans 
)

◆ get_rowstride_value()

LIVES_GLOBAL_INLINE int get_rowstride_value ( int  rowstride)

◆ insert_blank_frames()

void insert_blank_frames ( int  sfileno,
int  nframes,
int  after 
)

◆ layer_to_lives_painter()

lives_painter_t* layer_to_lives_painter ( weed_plant_t *  layer)

◆ layer_to_pixbuf()

LiVESPixbuf* layer_to_pixbuf ( weed_plant_t *  layer)

◆ letterbox_layer()

void letterbox_layer ( weed_plant_t *  layer,
int  width,
int  height,
int  nwidth,
int  nheight 
)

◆ lives_painter_to_layer()

boolean lives_painter_to_layer ( lives_painter_t *  cr,
weed_plant_t *  layer 
)

◆ lives_pixbuf_cheat()

LIVES_INLINE LiVESPixbuf* lives_pixbuf_cheat ( boolean  has_alpha,
int  width,
int  height,
uint8_t *  buf 
)

◆ lives_pixbuf_is_all_black()

boolean lives_pixbuf_is_all_black ( LiVESPixbuf *  pixbuf)

◆ lives_pixbuf_new_blank()

LiVESPixbuf* lives_pixbuf_new_blank ( int  width,
int  height,
int  palette 
)

◆ lives_pixbuf_set_opaque()

void lives_pixbuf_set_opaque ( LiVESPixbuf *  pixbuf)

◆ pixbuf_to_layer()

boolean pixbuf_to_layer ( weed_plant_t *  layer,
LiVESPixbuf *  pixbuf 
)

◆ pixel_data_planar_from_membuf()

void pixel_data_planar_from_membuf ( void **  pixel_data,
void *  data,
size_t  size,
int  palette 
)

◆ resize_layer()

boolean resize_layer ( weed_plant_t *  layer,
int  width,
int  height,
LiVESInterpType  interp,
int  opal_hint,
int  oclamp_hint 
)

◆ rgb2_411()

LIVES_INLINE void rgb2_411 ( uint8_t  r0,
uint8_t  g0,
uint8_t  b0,
uint8_t  r1,
uint8_t  g1,
uint8_t  b1,
uint8_t  r2,
uint8_t  g2,
uint8_t  b2,
uint8_t  r3,
uint8_t  g3,
uint8_t  b3,
yuv411_macropixel yuv 
)

◆ rgb2uyvy()

LIVES_INLINE void rgb2uyvy ( uint8_t  r0,
uint8_t  g0,
uint8_t  b0,
uint8_t  r1,
uint8_t  g1,
uint8_t  b1,
uyvy_macropixel uyvy 
)

◆ rgb2yuv()

LIVES_INLINE void rgb2yuv ( uint8_t  r0,
uint8_t  g0,
uint8_t  b0,
uint8_t *  y,
uint8_t *  u,
uint8_t *  v 
)

◆ rgb2yuyv()

LIVES_INLINE void rgb2yuyv ( uint8_t  r0,
uint8_t  g0,
uint8_t  b0,
uint8_t  r1,
uint8_t  g1,
uint8_t  b1,
yuyv_macropixel yuyv 
)

◆ uyvy2rgb()

LIVES_INLINE void uyvy2rgb ( uyvy_macropixel uyvy,
uint8_t *  r0,
uint8_t *  g0,
uint8_t *  b0,
uint8_t *  r1,
uint8_t *  g1,
uint8_t *  b1 
)

◆ uyvy_2_yuv422()

LIVES_INLINE void uyvy_2_yuv422 ( uyvy_macropixel uyvy,
uint8_t *  y0,
uint8_t *  u0,
uint8_t *  v0,
uint8_t *  y1 
)

◆ weed_layer_copy()

weed_plant_t* weed_layer_copy ( weed_plant_t *  dlayer,
weed_plant_t *  slayer 
)

◆ weed_layer_create()

weed_plant_t* weed_layer_create ( int  width,
int  height,
int *  rowstrides,
int  current_palette 
)

◆ weed_layer_free()

void weed_layer_free ( weed_plant_t *  layer)

◆ weed_layer_get_palette()

int weed_layer_get_palette ( weed_plant_t *  layer)

◆ weed_layer_pixel_data_free()

void weed_layer_pixel_data_free ( weed_plant_t *  layer)

◆ weed_palette_get_bits_per_macropixel()

LIVES_GLOBAL_INLINE int weed_palette_get_bits_per_macropixel ( int  pal)

◆ weed_palette_get_compression_ratio()

double weed_palette_get_compression_ratio ( int  pal)

◆ weed_palette_get_name()

const char* weed_palette_get_name ( int  pal)

◆ weed_palette_get_name_full()

char* weed_palette_get_name_full ( int  pal,
int  clamped,
int  subspace 
)

◆ weed_palette_get_numplanes()

LIVES_GLOBAL_INLINE int weed_palette_get_numplanes ( int  pal)

◆ weed_palette_get_pixels_per_macropixel()

LIVES_GLOBAL_INLINE int weed_palette_get_pixels_per_macropixel ( int  pal)

◆ weed_palette_get_plane_ratio_horizontal()

LIVES_GLOBAL_INLINE double weed_palette_get_plane_ratio_horizontal ( int  pal,
int  plane 
)

◆ weed_palette_get_plane_ratio_vertical()

LIVES_GLOBAL_INLINE double weed_palette_get_plane_ratio_vertical ( int  pal,
int  plane 
)

◆ weed_palette_has_alpha_channel()

LIVES_GLOBAL_INLINE boolean weed_palette_has_alpha_channel ( int  pal)

◆ weed_palette_is_alpha_palette()

LIVES_GLOBAL_INLINE boolean weed_palette_is_alpha_palette ( int  pal)

◆ weed_palette_is_float_palette()

LIVES_GLOBAL_INLINE boolean weed_palette_is_float_palette ( int  pal)

◆ weed_palette_is_lower_quality()

boolean weed_palette_is_lower_quality ( int  p1,
int  p2 
)

return TRUE if p1 is lower quality than p2

◆ weed_palette_is_resizable()

LIVES_INLINE boolean weed_palette_is_resizable ( int  pal,
int  clamped,
boolean  in_out 
)

◆ weed_palette_is_rgb_palette()

LIVES_GLOBAL_INLINE boolean weed_palette_is_rgb_palette ( int  pal)

◆ weed_palette_is_valid_palette()

LIVES_GLOBAL_INLINE boolean weed_palette_is_valid_palette ( int  pal)

◆ weed_palette_is_yuv_palette()

LIVES_GLOBAL_INLINE boolean weed_palette_is_yuv_palette ( int  pal)

◆ weed_yuv_clamping_get_name()

const char* weed_yuv_clamping_get_name ( int  clamping)

◆ weed_yuv_subspace_get_name()

const char* weed_yuv_subspace_get_name ( int  subspace)

◆ yuv2rgb()

LIVES_INLINE void yuv2rgb ( uint8_t  y,
uint8_t  u,
uint8_t  v,
uint8_t *  r,
uint8_t *  g,
uint8_t *  b 
)

◆ yuv888_2_argb()

LIVES_INLINE void yuv888_2_argb ( uint8_t *  yuv,
uint8_t *  argb 
)

◆ yuv888_2_bgr()

LIVES_INLINE void yuv888_2_bgr ( uint8_t *  yuv,
uint8_t *  bgr,
boolean  add_alpha 
)

◆ yuv888_2_rgb()

LIVES_INLINE void yuv888_2_rgb ( uint8_t *  yuv,
uint8_t *  rgb,
boolean  add_alpha 
)

◆ yuva8888_2_argb()

LIVES_INLINE void yuva8888_2_argb ( uint8_t *  yuva,
uint8_t *  argb 
)

◆ yuva8888_2_bgra()

LIVES_INLINE void yuva8888_2_bgra ( uint8_t *  yuva,
uint8_t *  bgra,
boolean  del_alpha 
)

◆ yuva8888_2_rgba()

LIVES_INLINE void yuva8888_2_rgba ( uint8_t *  yuva,
uint8_t *  rgba,
boolean  del_alpha 
)

◆ yuyv2rgb()

LIVES_INLINE void yuyv2rgb ( yuyv_macropixel yuyv,
uint8_t *  r0,
uint8_t *  g0,
uint8_t *  b0,
uint8_t *  r1,
uint8_t *  g1,
uint8_t *  b1 
)

◆ yuyv_2_yuv422()

LIVES_INLINE void yuyv_2_yuv422 ( yuyv_macropixel yuyv,
uint8_t *  y0,
uint8_t *  u0,
uint8_t *  v0,
uint8_t *  y1 
)