LiVES
3.2.0
|
Go to the source code of this file.
Macros | |
#define | USE_THREADS 1 |
set to 0 to disable threading for pixbuf operations, 1 to enable. Other values are invalid. More... | |
#define | get_pixbuf_rowstride_value(rowstride) ((rowstride + 3) & ~3) |
#define | get_last_pixbuf_rowstride_value(width, nchans) (width * (((nchans << 3) + 7) >> 3)) |
#define | CLAMP0255(a) ((unsigned char)((((-a) >> 31) & a) | (255 - a) >> 31) ) |
#define | CLAMP0255f(a) (a > 255. ? 255.: a < 0. ? 0. : a) |
#define | CLAMP0255fi(a) ((int)(a > 255. ? 255.: a < 0. ? 0. : a)) |
#define | spc_rnd(val) (_spc_rnd((val), prefs ? prefs->pb_quality : PB_QUALITY_HIGH)) |
#define | LAB0 0.008856 |
#define | LAB1 0.33333333333 |
#define | LAB2 7.787 |
#define | LAB3 0.13793103448 |
#define | KL 1.0 |
#define | KC 1.0 |
#define | KH 1.0 |
#define | K1 0.045 |
#define | K2 0.015 |
#define | RNDFAC 0.0000000001 |
#define | DIST_THRESH 10. |
#define | RAT_START .9 |
#define | RAT_TIO .9999999 |
#define | RAT_MIN .2 |
#define | avg_chroma(x, y) ((uint8_t)(*(cavg + ((int)(x) << 8) + (int)(y)))) |
#define | avg_chroma_3_1(x, y) ((uint8_t)(avg_chroma(x, avg_chroma(x, y)))) |
#define | avg_chroma_1_3(x, y) ((uint8_t)(avg_chroma(avg_chroma(x, y), y))) |
#define | avg_chroma_3_1f(x, y) ((uint8_t)(avg_chromaf(x, avg_chromaf(x, y)))) |
#define | avg_chroma_1_3f(x, y) ((uint8_t)(avg_chromaf(avg_chromaf(x, y), y))) |
#define | bgr2yuv(b0, g0, r0, y, u, v) rgb2yuv(r0, g0, b0, y, u, v) |
#define | bgr2yuv_with_gamma(b0, g0, r0, y, u, v) rgb2yuv(r0, g0, b0, y, u, v, lut) |
#define | yuv2bgr(y, u, v, b, g, r) yuv2rgb(y, u, v, r, g, b) |
#define | yuv2bgr_with_gamma(y, u, v, b, g, r, lut) yuv2rgb_with_gamma(y, u, v, r, g, b, lut) |
#define | SHIFTVAL sbits |
#define | ALIGN_SIZE (1 << SHIFTVAL) |
#define ALIGN_SIZE (1 << SHIFTVAL) |
Definition at line 9035 of file colourspace.c.
#define avg_chroma | ( | x, | |
y | |||
) | ((uint8_t)(*(cavg + ((int)(x) << 8) + (int)(y)))) |
Definition at line 1790 of file colourspace.c.
#define avg_chroma_1_3 | ( | x, | |
y | |||
) | ((uint8_t)(avg_chroma(avg_chroma(x, y), y))) |
Definition at line 1792 of file colourspace.c.
#define avg_chroma_1_3f | ( | x, | |
y | |||
) | ((uint8_t)(avg_chromaf(avg_chromaf(x, y), y))) |
Definition at line 1818 of file colourspace.c.
#define avg_chroma_3_1 | ( | x, | |
y | |||
) | ((uint8_t)(avg_chroma(x, avg_chroma(x, y)))) |
Definition at line 1791 of file colourspace.c.
#define avg_chroma_3_1f | ( | x, | |
y | |||
) | ((uint8_t)(avg_chromaf(x, avg_chromaf(x, y)))) |
Definition at line 1817 of file colourspace.c.
#define bgr2yuv | ( | b0, | |
g0, | |||
r0, | |||
y, | |||
u, | |||
v | |||
) | rgb2yuv(r0, g0, b0, y, u, v) |
Definition at line 1830 of file colourspace.c.
#define bgr2yuv_with_gamma | ( | b0, | |
g0, | |||
r0, | |||
y, | |||
u, | |||
v | |||
) | rgb2yuv(r0, g0, b0, y, u, v, lut) |
Definition at line 1844 of file colourspace.c.
#define CLAMP0255 | ( | a | ) | ((unsigned char)((((-a) >> 31) & a) | (255 - a) >> 31) ) |
Definition at line 211 of file colourspace.c.
#define CLAMP0255f | ( | a | ) | (a > 255. ? 255.: a < 0. ? 0. : a) |
Definition at line 212 of file colourspace.c.
#define CLAMP0255fi | ( | a | ) | ((int)(a > 255. ? 255.: a < 0. ? 0. : a)) |
Definition at line 213 of file colourspace.c.
#define DIST_THRESH 10. |
#define get_last_pixbuf_rowstride_value | ( | width, | |
nchans | |||
) | (width * (((nchans << 3) + 7) >> 3)) |
Definition at line 201 of file colourspace.c.
#define get_pixbuf_rowstride_value | ( | rowstride | ) | ((rowstride + 3) & ~3) |
Definition at line 194 of file colourspace.c.
#define K1 0.045 |
Definition at line 1036 of file colourspace.c.
#define K2 0.015 |
Definition at line 1037 of file colourspace.c.
#define KC 1.0 |
Definition at line 1034 of file colourspace.c.
#define KH 1.0 |
Definition at line 1035 of file colourspace.c.
#define KL 1.0 |
Definition at line 1033 of file colourspace.c.
#define LAB0 0.008856 |
Definition at line 1022 of file colourspace.c.
#define LAB1 0.33333333333 |
Definition at line 1023 of file colourspace.c.
#define LAB2 7.787 |
Definition at line 1024 of file colourspace.c.
#define LAB3 0.13793103448 |
Definition at line 1025 of file colourspace.c.
#define RAT_MIN .2 |
#define RAT_START .9 |
#define RAT_TIO .9999999 |
#define RNDFAC 0.0000000001 |
Definition at line 1038 of file colourspace.c.
#define SHIFTVAL sbits |
Definition at line 9034 of file colourspace.c.
#define spc_rnd | ( | val | ) | (_spc_rnd((val), prefs ? prefs->pb_quality : PB_QUALITY_HIGH)) |
Definition at line 541 of file colourspace.c.
#define USE_THREADS 1 |
set to 0 to disable threading for pixbuf operations, 1 to enable. Other values are invalid.
Definition at line 37 of file colourspace.c.
#define yuv2bgr | ( | y, | |
u, | |||
v, | |||
b, | |||
g, | |||
r | |||
) | yuv2rgb(y, u, v, r, g, b) |
Definition at line 2050 of file colourspace.c.
#define yuv2bgr_with_gamma | ( | y, | |
u, | |||
v, | |||
b, | |||
g, | |||
r, | |||
lut | |||
) | yuv2rgb_with_gamma(y, u, v, r, g, b, lut) |
Definition at line 2058 of file colourspace.c.
LIVES_LOCAL_INLINE int _get_alpha | ( | int | pal | ) |
Definition at line 1496 of file colourspace.c.
Referenced by weed_palette_get_alpha_offset(), weed_palette_get_alpha_plane(), weed_palette_has_alpha_first(), and weed_palette_has_alpha_last().
void alpha_unpremult | ( | weed_layer_t * | layer, |
boolean | un | ||
) |
(un)premultply alpha using a lookup table
if un is FALSE we go the other way, and do a pre-multiplication
this is only used when going from palette with alpha to one without
special case - planar with alpha
unclamped YUVA8888 (packed)
Definition at line 9923 of file colourspace.c.
LIVES_LOCAL_INLINE boolean can_inline_gamma | ( | int | inpl, |
int | opal | ||
) |
Definition at line 10108 of file colourspace.c.
double cdist94 | ( | uint8_t | r0, |
uint8_t | g0, | ||
uint8_t | b0, | ||
uint8_t | r1, | ||
uint8_t | g1, | ||
uint8_t | b1 | ||
) |
Definition at line 1075 of file colourspace.c.
Referenced by pick_nice_colour().
boolean compact_rowstrides | ( | weed_layer_t * | layer | ) |
Definition at line 12422 of file colourspace.c.
boolean consider_swapping | ( | int * | inpal, |
int * | outpal | ||
) |
look for shortcuts in palette conversions instead of converting e.g RGB -> BGRA, we may be able to pretend that the input palette is BGR and thus the conversion to BGRA is slightly cheaper we can do this provided the caller can take into account that the red / blue components are now swapped.
If this is possible, then either inpal or outpal mau ne altered, and TRUE is returned
since we dont have ABGR, we can switch the out palette instead
Definition at line 13427 of file colourspace.c.
boolean convert_layer_palette | ( | weed_layer_t * | layer, |
int | outpl, | ||
int | op_clamping | ||
) |
Definition at line 11945 of file colourspace.c.
Referenced by cconx_convert_pixel_data().
boolean convert_layer_palette_full | ( | weed_layer_t * | layer, |
int | outpl, | ||
int | oclamping, | ||
int | osampling, | ||
int | osubspace, | ||
int | tgamma | ||
) |
convert the palette of a layer
convert to/from the 5 non-float RGB palettes and 10 YUV palettes giving a total of 15*14=210 conversions
in addition YUV can be converted from clamped to unclamped and vice-versa
chroma sub and supersampling is implemented, and threading is used wherever possible
all conversions are performed via lookup tables
NOTE - if converting to YUV411, we cut pixels so (RGB) width is divisible by 4 if converting to YUV420 or YVU420, we cut pixels so (RGB) width is divisible by 2 if converting to YUV420 or YVU420, we cut pixels so height is divisible by 2
returns FALSE if the palette conversion fails or if layer is NULL
current limitations:
if V plane is before U, swap the pointers
add pre
inpl has post
outpl has post
outpl has pre
outpl has post
outpl has pre
if we came in as YVU, we got swapped to YUV
swap (again) and both become YVU
swap again and both become YUV (YVU out will get swapped on more time)
if V plane is before U, swap the pointers
Definition at line 10160 of file colourspace.c.
Referenced by convert_layer_palette().
boolean copy_pixel_data | ( | weed_layer_t * | layer, |
weed_layer_t * | old_layer, | ||
size_t | alignment | ||
) |
Definition at line 9843 of file colourspace.c.
weed_layer_t* create_blank_layer | ( | weed_layer_t * | layer, |
const char * | image_ext, | ||
int | width, | ||
int | height, | ||
int | target_palette | ||
) |
fills layer with default values.
If either width or height are zero, then dimensions will be taken from the layer or defaults used if layer has a palette set, that will be maintained, else it will be set to target_palette if targette palette is WEED_PALETTE_END then default will be set depending on image_ext if this is "jpg" then it will be RGB24, otherwise RGBA32 finally we create the pixel data for layer
Definition at line 9611 of file colourspace.c.
boolean create_empty_pixel_data | ( | weed_layer_t * | layer, |
boolean | black_fill, | ||
boolean | may_contig | ||
) |
creates pixel data for layer
layer should be pre-set with palette, width in MACROPIXELS, and height gamma_type will be set WEED_GAMMA_SRGB, old pixel_data will not be freed.
width, height, and current_palette must be pre-set in layer; width is in (macro) pixels of the palette width and height may be adjusted (rounded) in the function rowstrides will be set, and each plane will be aligned depending on THREADVAR(rowstride_alignment) if THREADVAR(rowstride_alignment_hint) is non 0 it will set THREADVAR(rowstride_alignment), which must be a power of 2 the special value -1 for the hint will create compact frames (rowstride = width * pixel_size)
if black_fill is set, fill with opaque black in the specified palette: for yuv palettes, YUV_clamping may be pre-set otherwise it will be set to WEED_YUV_CLAMPING_CLAMPED.
may_contig should normally be set to TRUE, except for special uses during palette conversion if set, then for planar palettes, only plane 0 will be allocated, so only this value should be freed in this case, the leaf WEED_LEAF_HOST_PIXEL_DATA_CONTIGUOUS will be set to WEED_TRUE
the allocated frames will be aligned to the pixel size for whatever palette and may be padded with extra bytes to guard against accidental overwrites
force use of fixed rowstrides, eg. decoder plugin
Definition at line 9058 of file colourspace.c.
Referenced by cconx_convert_pixel_data().
LIVES_INLINE void fill_plane | ( | uint8_t * | ptr, |
int | psize, | ||
int | width, | ||
int | height, | ||
int | rowstride, | ||
unsigned char * | bpix | ||
) |
a "layer" is CHANNEL type plant which is not created from a plugin CHANNEL_TEMPLATE.
When we pass this to a plugin, we need to adjust it depending on the plugin's CHANNEL_TEMPLATE to which we will assign it.
e.g.: memory may need aligning afterwards for particular plugins which set channel template flags: layer palette may need changing, layer may need resizing
fills the plane pointed to by ptr with bpix
psize is sizeof(bpix), width, height and rowstride are the dimensions of the target plane
Definition at line 9019 of file colourspace.c.
void gamma_conv_params | ( | int | gamma_type, |
weed_layer_t * | inst, | ||
boolean | is_in | ||
) |
Definition at line 12019 of file colourspace.c.
LIVES_GLOBAL_INLINE boolean gamma_convert_layer | ( | int | gamma_type, |
weed_layer_t * | layer | ||
) |
Definition at line 12195 of file colourspace.c.
LIVES_GLOBAL_INLINE boolean gamma_convert_layer_variant | ( | double | file_gamma, |
int | tgamma, | ||
weed_layer_t * | layer | ||
) |
Definition at line 12202 of file colourspace.c.
boolean gamma_convert_sub_layer | ( | int | gamma_type, |
double | fileg, | ||
weed_layer_t * | layer, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
boolean | may_thread | ||
) |
alter the transfer function of a Weed layer, from current value to gamma_type
Definition at line 12124 of file colourspace.c.
LIVES_GLOBAL_INLINE const weed_macropixel_t* get_advanced_palette | ( | int | weed_palette | ) |
Definition at line 1368 of file colourspace.c.
Referenced by _get_alpha(), pixel_size(), weed_palette_get_nplanes(), weed_palette_get_pixels_per_macropixel(), weed_palette_get_plane_ratio_horizontal(), weed_palette_get_plane_ratio_vertical(), weed_palette_has_alpha(), weed_palette_is_alpha(), weed_palette_is_float(), weed_palette_is_rgb(), weed_palette_is_sane(), weed_palette_is_valid(), weed_palette_is_yuv(), and weed_palette_red_first().
double get_luma16 | ( | uint16_t | r, |
uint16_t | g, | ||
uint16_t | b | ||
) |
return luma value between 0. (black) and 1. (white)
Definition at line 557 of file colourspace.c.
double get_luma8 | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b | ||
) |
return luma value between 0. (black) and 1. (white)
Definition at line 549 of file colourspace.c.
Referenced by get_luma16(), and pick_nice_colour().
LIVES_GLOBAL_INLINE int get_simple_palette | ( | weed_macropixel_t * | mpx | ) |
Definition at line 1378 of file colourspace.c.
void hsv2rgb | ( | double | h, |
double | s, | ||
double | v, | ||
uint8_t * | r, | ||
uint8_t * | g, | ||
uint8_t * | b | ||
) |
Definition at line 1113 of file colourspace.c.
void init_advanced_palettes | ( | void | ) |
void init_colour_engine | ( | void | ) |
Definition at line 1661 of file colourspace.c.
LIVES_GLOBAL_INLINE void init_conversions | ( | int | intent | ) |
set the 'effort' to as low as possible; if using adaptive quality
Definition at line 1804 of file colourspace.c.
Referenced by play_file(), and render_events().
LIVES_LOCAL_INLINE boolean is_rgbchan | ( | uint16_t | ctype | ) |
Definition at line 1383 of file colourspace.c.
Referenced by weed_palette_is_rgb().
LIVES_LOCAL_INLINE boolean is_yuvchan | ( | uint16_t | ctype | ) |
Definition at line 1387 of file colourspace.c.
Referenced by weed_palette_is_yuv().
LIVES_LOCAL_INLINE double lab_conv | ( | double | a | ) |
Definition at line 1026 of file colourspace.c.
Referenced by xyz2lab().
lives_painter_t* layer_to_lives_painter | ( | weed_layer_t * | layer | ) |
convert a weed layer to lives_painter (a.k.a cairo)
width, height and rowstrides of source layer may all change
Definition at line 13473 of file colourspace.c.
LiVESPixbuf* layer_to_pixbuf | ( | weed_layer_t * | layer, |
boolean | realpalette, | ||
boolean | fordisplay | ||
) |
Definition at line 12210 of file colourspace.c.
boolean letterbox_layer | ( | weed_layer_t * | layer, |
int | nwidth, | ||
int | nheight, | ||
int | width, | ||
int | height, | ||
LiVESInterpType | interp, | ||
int | tpal, | ||
int | tclamp | ||
) |
no letterboxing needed - resize and return
resize the inner rectangle
create the outer rectangle in layer
get the actual size after any adjustments
this shouldnt happen, but if the outer rectangle is smaller than the inner we have to abort
retain pixel_data if it belongs to mainw->frame_layer
otherwise do not nullify, as we want to free old pixel_data
Definition at line 13015 of file colourspace.c.
LIVES_GLOBAL_INLINE int lives_layer_get_clip | ( | weed_layer_t * | layer | ) |
Definition at line 9705 of file colourspace.c.
LIVES_GLOBAL_INLINE frames_t lives_layer_get_frame | ( | weed_layer_t * | layer | ) |
Definition at line 9711 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* lives_layer_new_for_frame | ( | int | clip, |
frames_t | frame | ||
) |
Definition at line 9833 of file colourspace.c.
Referenced by load_frame_image(), load_rfx_preview(), and render_events().
LIVES_GLOBAL_INLINE void lives_layer_set_clip | ( | weed_layer_t * | layer, |
int | clip | ||
) |
Definition at line 9828 of file colourspace.c.
Referenced by lives_layer_new_for_frame().
LIVES_GLOBAL_INLINE void lives_layer_set_frame | ( | weed_layer_t * | layer, |
frames_t | frame | ||
) |
Definition at line 9822 of file colourspace.c.
Referenced by lives_layer_new_for_frame().
void lives_layer_set_opaque | ( | weed_layer_t * | layer | ) |
Definition at line 12385 of file colourspace.c.
boolean lives_painter_to_layer | ( | lives_painter_t * | cr, |
weed_layer_t * | layer | ||
) |
convert a lives_painter_t (a.k.a) cairo_t to a weed layer
flush to ensure all writing to the image surface was done
un-premultiply the alpha
Definition at line 13549 of file colourspace.c.
LIVES_INLINE LiVESPixbuf* lives_pixbuf_cheat | ( | boolean | has_alpha, |
int | width, | ||
int | height, | ||
uint8_t * | buf | ||
) |
Definition at line 11990 of file colourspace.c.
LIVES_GLOBAL_INLINE boolean lives_pixbuf_is_all_black | ( | LiVESPixbuf * | pixbuf | ) |
return FALSE if r >= 32, b >= 32 and g >= 24 here we use a, b, and c for the first 3 bytes of the pixel. Since a and c are symmetric and we ignore byte 4, this will work for RGB, BGR, RGBA and BGRA (we could also check ARGB by setting offs to 1).
Algorithm: (a & 0x1F) ^ a - nonzero iff a >= 32 (c & 0x1F) ^ c - nonzero iff c >= 32
((a & c) & 0x1F) ^ (a & c) - nonzero only if both are true
(b & 0x1F) ^ b - nonzero iff b >= 32 ((b << 1) & 0x1F) ^ (b << 1) - nonzero iff b >= 16 ((b << 2) & 0x1F) ^ (b << 2) - nonzero iff b >= 8 b & 0x0F - masks any values >= 32
Definition at line 2193 of file colourspace.c.
LiVESPixbuf* lives_pixbuf_new_blank | ( | int | width, |
int | height, | ||
int | palette | ||
) |
Definition at line 11953 of file colourspace.c.
Referenced by insert_blank_frames().
void lives_pixbuf_set_opaque | ( | LiVESPixbuf * | pixbuf | ) |
Definition at line 12362 of file colourspace.c.
boolean pick_nice_colour | ( | uint8_t | r0, |
uint8_t | g0, | ||
uint8_t | b0, | ||
uint8_t * | r1, | ||
uint8_t * | g1, | ||
uint8_t * | b1, | ||
double | max, | ||
double | lmin, | ||
double | lmax | ||
) |
pick a random col
Definition at line 1142 of file colourspace.c.
boolean pixbuf_to_layer | ( | weed_layer_t * | layer, |
LiVESPixbuf * | pixbuf | ||
) |
turn a (Gdk)Pixbuf into a Weed layer
return TRUE if we can use the original pixbuf pixels; in this case the pixbuf pixels should only be freed via lives_layer_pixel_data_free() or lives_layer_free() see code example.
code example:
if (pixbuf) { if (!pixbuf_to_layer(layer, pixbuf)) lives_widget_object_unref(pixbuf); else do NOT unref the pixbuf !!!! }
do something with layer...
weed_layer_pixel_data_free(layer); unrefs the pixbuf or weed_layer_free(layer); also unrefs the pixbuf
Definition at line 13347 of file colourspace.c.
void pixel_data_planar_from_membuf | ( | void ** | pixel_data, |
void * | data, | ||
size_t | size, | ||
int | palette, | ||
boolean | contig | ||
) |
Definition at line 2236 of file colourspace.c.
LIVES_GLOBAL_INLINE size_t pixel_size | ( | int | pal | ) |
This is actually the MACRO pixel size om bytes, to get the real pixel size, divide by weed_palette_pixels_per_macropixel()
Definition at line 1391 of file colourspace.c.
Referenced by weed_palette_get_bits_per_macropixel().
int resize_all | ( | int | fileno, |
int | width, | ||
int | height, | ||
lives_img_type_t | imgtype, | ||
boolean | do_back, | ||
int * | nbad, | ||
int * | nmiss | ||
) |
utility funcs for GUI
Definition at line 13622 of file colourspace.c.
Referenced by after_foreign_play().
boolean resize_layer | ( | weed_layer_t * | layer, |
int | width, | ||
int | height, | ||
LiVESInterpType | interp, | ||
int | opal_hint, | ||
int | oclamp_hint | ||
) |
resize a layer
widths in PIXELS
width is in PIXELS (not macropixels)
opal_hint and oclamp_hint may be set to hint the desired output palette and YUV clamping this is simply to ensure more efficient resizing, and may be ignored
"current_palette" should be checked on return as it may change
Definition at line 12537 of file colourspace.c.
void rgb2hsv | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b, | ||
double * | h, | ||
double * | s, | ||
double * | v | ||
) |
Definition at line 1090 of file colourspace.c.
void rgb2xyz | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b, | ||
double * | x, | ||
double * | y, | ||
double * | z | ||
) |
Definition at line 1013 of file colourspace.c.
Referenced by cdist94().
LIVES_INLINE void rgb2yuv_with_gamma | ( | uint8_t | r0, |
uint8_t | g0, | ||
uint8_t | b0, | ||
uint8_t * | y, | ||
uint8_t * | u, | ||
uint8_t * | v, | ||
uint8_t * | lut | ||
) |
Definition at line 1833 of file colourspace.c.
LIVES_INLINE void rgb2yuyv_with_gamma | ( | uint8_t | r0, |
uint8_t | g0, | ||
uint8_t | b0, | ||
uint8_t | r1, | ||
uint8_t | g1, | ||
uint8_t | b1, | ||
yuyv_macropixel * | yuyv, | ||
uint8_t * | lut | ||
) |
Definition at line 1893 of file colourspace.c.
LIVES_GLOBAL_INLINE int32_t round_special | ( | int32_t | val | ) |
Definition at line 544 of file colourspace.c.
Referenced by test_palette_conversions().
LIVES_GLOBAL_INLINE boolean rowstrides_differ | ( | int | n1, |
int * | n1_array, | ||
int | n2, | ||
int * | n2_array | ||
) |
Definition at line 9647 of file colourspace.c.
LIVES_LOCAL_INLINE int swap_red_blue | ( | int | pal | ) |
Definition at line 13411 of file colourspace.c.
Referenced by consider_swapping().
weed_layer_t* weed_layer_copy | ( | weed_layer_t * | dlayer, |
weed_layer_t * | slayer | ||
) |
copy source layer slayer to dest layer dlayer
if dlayer is NULL, we return a new layer, otherwise we return dlayer for a newly created layer, this is a deep copy, since the pixel_data array is also copied for an existing dlayer, we copy pixel_data by reference. all the other relevant attributes are also copied
deep copy
shallow copy
Definition at line 13739 of file colourspace.c.
Referenced by load_rfx_preview(), and save_to_scrap_file().
LIVES_GLOBAL_INLINE int weed_layer_count_refs | ( | weed_layer_t * | layer | ) |
Definition at line 13799 of file colourspace.c.
Referenced by weed_layer_pixel_data_free().
weed_layer_t* weed_layer_create | ( | int | width, |
int | height, | ||
int * | rowstrides, | ||
int | palette | ||
) |
create a layer, setting the most important properties
Definition at line 13708 of file colourspace.c.
weed_layer_t* weed_layer_create_full | ( | int | width, |
int | height, | ||
int * | rowstrides, | ||
int | palette, | ||
int | YUV_clamping, | ||
int | YUV_sampling, | ||
int | YUV_subspace, | ||
int | gamma_type | ||
) |
Definition at line 13722 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_free | ( | weed_layer_t * | layer | ) |
frees pixel_data for a layer, then the layer itself
if plant is freed returns (void *)NULL for convenience
Definition at line 13883 of file colourspace.c.
Referenced by close_current_file(), get_frames_sizes(), load_frame_image(), load_rfx_preview(), on_multitrack_activate(), and render_events().
LIVES_GLOBAL_INLINE float** weed_layer_get_audio_data | ( | weed_layer_t * | layer, |
int * | naudchans | ||
) |
Definition at line 13921 of file colourspace.c.
LIVES_GLOBAL_INLINE int weed_layer_get_audio_length | ( | weed_layer_t * | layer | ) |
Definition at line 14004 of file colourspace.c.
Referenced by weed_apply_audio_effects_rt().
LIVES_GLOBAL_INLINE int weed_layer_get_audio_rate | ( | weed_layer_t * | layer | ) |
Definition at line 13992 of file colourspace.c.
Referenced by weed_apply_audio_effects_rt().
LIVES_GLOBAL_INLINE int weed_layer_get_flags | ( | weed_layer_t * | layer | ) |
Definition at line 9699 of file colourspace.c.
int weed_layer_get_gamma | ( | weed_layer_t * | layer | ) |
Definition at line 12002 of file colourspace.c.
Referenced by render_text_overlay().
LIVES_GLOBAL_INLINE int weed_layer_get_height | ( | weed_layer_t * | layer | ) |
Definition at line 13953 of file colourspace.c.
Referenced by get_frames_sizes().
LIVES_GLOBAL_INLINE int weed_layer_get_naudchans | ( | weed_layer_t * | layer | ) |
Definition at line 13998 of file colourspace.c.
Referenced by weed_apply_audio_effects_rt().
int weed_layer_get_palette | ( | weed_layer_t * | layer | ) |
Definition at line 13977 of file colourspace.c.
Referenced by append_filter_init_event(), compact_rowstrides(), copy_pixel_data(), create_empty_pixel_data(), lives_layer_set_opaque(), render_text_to_layer(), vpp_try_match_palette(), and weed_layer_get_width_pixels().
LIVES_GLOBAL_INLINE int weed_layer_get_palette_yuv | ( | weed_layer_t * | layer, |
int * | clamping, | ||
int * | sampling, | ||
int * | subspace | ||
) |
Definition at line 13983 of file colourspace.c.
LIVES_GLOBAL_INLINE void** weed_layer_get_pixel_data | ( | weed_layer_t * | layer, |
int * | nplanes | ||
) |
Definition at line 13908 of file colourspace.c.
Referenced by weed_layer_copy(), and weed_layer_pixel_data_free().
LIVES_GLOBAL_INLINE uint8_t* weed_layer_get_pixel_data_packed | ( | weed_layer_t * | layer | ) |
Definition at line 13915 of file colourspace.c.
LIVES_GLOBAL_INLINE int weed_layer_get_rowstride | ( | weed_layer_t * | layer | ) |
for packed palettes
Definition at line 13935 of file colourspace.c.
Referenced by render_text_to_layer().
LIVES_GLOBAL_INLINE int* weed_layer_get_rowstrides | ( | weed_layer_t * | layer, |
int * | nplanes | ||
) |
Definition at line 13928 of file colourspace.c.
Referenced by compact_rowstrides(), and copy_pixel_data().
LIVES_GLOBAL_INLINE int weed_layer_get_type | ( | weed_layer_t * | layer | ) |
Definition at line 9663 of file colourspace.c.
Referenced by weed_layer_is_audio(), and weed_layer_is_video().
LIVES_GLOBAL_INLINE int weed_layer_get_width | ( | weed_layer_t * | layer | ) |
Definition at line 13941 of file colourspace.c.
Referenced by compact_rowstrides(), copy_pixel_data(), create_empty_pixel_data(), gamma_convert_layer(), gamma_convert_layer_variant(), get_frames_sizes(), lives_layer_set_opaque(), render_text_overlay(), render_text_to_layer(), and weed_layer_get_width_pixels().
LIVES_GLOBAL_INLINE int weed_layer_get_width_pixels | ( | weed_layer_t * | layer | ) |
Definition at line 13947 of file colourspace.c.
LIVES_GLOBAL_INLINE int weed_layer_get_yuv_clamping | ( | weed_layer_t * | layer | ) |
Definition at line 13959 of file colourspace.c.
Referenced by vpp_try_match_palette(), and weed_layer_get_palette_yuv().
LIVES_GLOBAL_INLINE int weed_layer_get_yuv_sampling | ( | weed_layer_t * | layer | ) |
Definition at line 13965 of file colourspace.c.
Referenced by weed_layer_get_palette_yuv().
LIVES_GLOBAL_INLINE int weed_layer_get_yuv_subspace | ( | weed_layer_t * | layer | ) |
Definition at line 13971 of file colourspace.c.
Referenced by weed_layer_get_palette_yuv().
LIVES_GLOBAL_INLINE int weed_layer_is_audio | ( | weed_layer_t * | layer | ) |
Definition at line 9675 of file colourspace.c.
LIVES_GLOBAL_INLINE int weed_layer_is_video | ( | weed_layer_t * | layer | ) |
Definition at line 9669 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_new | ( | int | layer_type | ) |
Definition at line 9655 of file colourspace.c.
Referenced by get_frames_sizes(), and lives_layer_new_for_frame().
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_nullify_pixel_data | ( | weed_layer_t * | layer | ) |
Definition at line 9753 of file colourspace.c.
Referenced by render_events(), and weed_layer_pixel_data_free().
void weed_layer_pixel_data_free | ( | weed_layer_t * | layer | ) |
free pixel_data from layer
we do not free if WEED_LEAF_HOST_ORIG_PDATA is set (data is an alpha in which "belongs" to another out param)
take care of WEED_LEAF_HOST_PIXEL_DATA_CONTIGUOUS take care of WEED_LEAF_HOST_PIXBUF_SRC take care of WEED_LEAF_HOST_SURFACE_SRC
sets WEED_LEAF_PIXEL_DATA to NULL for the layer
this function should always be used to free WEED_LEAF_PIXEL_DATA
Definition at line 13819 of file colourspace.c.
Referenced by cconx_convert_pixel_data(), load_frame_image(), render_events(), and weed_layer_unref().
LIVES_GLOBAL_INLINE int weed_layer_ref | ( | weed_layer_t * | layer | ) |
Definition at line 13899 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_audio_data | ( | weed_layer_t * | layer, |
float ** | data, | ||
int | arate, | ||
int | naudchans, | ||
weed_size_t | nsamps | ||
) |
Definition at line 9681 of file colourspace.c.
Referenced by push_audio_to_channel().
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_flags | ( | weed_layer_t * | layer, |
int | flags | ||
) |
Definition at line 9692 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_gamma | ( | weed_layer_t * | layer, |
int | gamma_type | ||
) |
Definition at line 9784 of file colourspace.c.
Referenced by render_text_overlay().
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_height | ( | weed_layer_t * | layer, |
int | height | ||
) |
Definition at line 9724 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_palette | ( | weed_layer_t * | layer, |
int | palette | ||
) |
functions all return the input layer for convenience; no checking for valid values is done if layer is NULL or not weed_layer then NULL is returned
Definition at line 9777 of file colourspace.c.
Referenced by weed_layer_set_palette_yuv().
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_palette_yuv | ( | weed_layer_t * | layer, |
int | palette, | ||
int | clamping, | ||
int | sampling, | ||
int | subspace | ||
) |
Definition at line 9812 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_pixel_data | ( | weed_layer_t * | layer, |
void ** | pixel_data, | ||
int | nplanes | ||
) |
Definition at line 9739 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_pixel_data_packed | ( | weed_layer_t * | layer, |
void * | pixel_data | ||
) |
Definition at line 9746 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_rowstride | ( | weed_layer_t * | layer, |
int | rowstride | ||
) |
Definition at line 9770 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_rowstrides | ( | weed_layer_t * | layer, |
int * | rowstrides, | ||
int | nplanes | ||
) |
Definition at line 9763 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_size | ( | weed_layer_t * | layer, |
int | width, | ||
int | height | ||
) |
Definition at line 9731 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_width | ( | weed_layer_t * | layer, |
int | width | ||
) |
width in macropixels of the layer palette
Definition at line 9717 of file colourspace.c.
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_yuv_clamping | ( | weed_layer_t * | layer, |
int | clamping | ||
) |
Definition at line 9791 of file colourspace.c.
Referenced by weed_layer_set_palette_yuv().
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_yuv_sampling | ( | weed_layer_t * | layer, |
int | sampling | ||
) |
Definition at line 9798 of file colourspace.c.
Referenced by weed_layer_set_palette_yuv().
LIVES_GLOBAL_INLINE weed_layer_t* weed_layer_set_yuv_subspace | ( | weed_layer_t * | layer, |
int | subspace | ||
) |
Definition at line 9805 of file colourspace.c.
Referenced by weed_layer_set_palette_yuv().
int weed_layer_unref | ( | weed_layer_t * | layer | ) |
Definition at line 13888 of file colourspace.c.
Referenced by weed_layer_free().
LIVES_GLOBAL_INLINE int weed_palette_get_alpha_offset | ( | int | pal | ) |
Definition at line 1510 of file colourspace.c.
Referenced by lives_layer_set_opaque().
LIVES_GLOBAL_INLINE int weed_palette_get_alpha_plane | ( | int | pal | ) |
Definition at line 1505 of file colourspace.c.
Referenced by lives_layer_set_opaque().
LIVES_GLOBAL_INLINE int weed_palette_get_bits_per_macropixel | ( | int | pal | ) |
Definition at line 1411 of file colourspace.c.
Referenced by cconx_convert_pixel_data(), and weed_palette_get_compression_ratio().
LIVES_GLOBAL_INLINE int weed_palette_get_nplanes | ( | int | pal | ) |
Definition at line 1417 of file colourspace.c.
Referenced by weed_palette_get_compression_ratio().
LIVES_GLOBAL_INLINE int weed_palette_get_pixels_per_macropixel | ( | int | pal | ) |
Definition at line 1403 of file colourspace.c.
Referenced by weed_channel_get_width_pixels(), weed_layer_get_width_pixels(), weed_palette_get_bits_per_macropixel(), and weed_palette_get_compression_ratio().
LIVES_GLOBAL_INLINE double weed_palette_get_plane_ratio_horizontal | ( | int | pal, |
int | plane | ||
) |
Definition at line 1480 of file colourspace.c.
Referenced by weed_palette_get_compression_ratio().
LIVES_GLOBAL_INLINE double weed_palette_get_plane_ratio_vertical | ( | int | pal, |
int | plane | ||
) |
Definition at line 1488 of file colourspace.c.
Referenced by weed_palette_get_compression_ratio().
LIVES_GLOBAL_INLINE boolean weed_palette_has_alpha | ( | int | pal | ) |
Definition at line 1466 of file colourspace.c.
Referenced by best_palette_match(), and weed_palette_get_compression_ratio().
LIVES_GLOBAL_INLINE boolean weed_palette_has_alpha_first | ( | int | pal | ) |
Definition at line 1515 of file colourspace.c.
LIVES_GLOBAL_INLINE boolean weed_palette_has_alpha_last | ( | int | pal | ) |
Definition at line 1519 of file colourspace.c.
LIVES_GLOBAL_INLINE boolean weed_palette_is_alpha | ( | int | pal | ) |
Definition at line 1427 of file colourspace.c.
Referenced by append_filter_init_event(), best_palette_match(), cconx_convert_pixel_data(), has_alpha_palette(), has_non_alpha_palette(), weed_palette_get_compression_ratio(), and weed_palette_is_lower_quality().
LIVES_GLOBAL_INLINE boolean weed_palette_is_float | ( | int | pal | ) |
Definition at line 1475 of file colourspace.c.
boolean weed_palette_is_lower_quality | ( | int | p1, |
int | p2 | ||
) |
Definition at line 2143 of file colourspace.c.
LIVES_GLOBAL_INLINE boolean weed_palette_is_painter_palette | ( | int | pal | ) |
Definition at line 2130 of file colourspace.c.
LIVES_INLINE boolean weed_palette_is_resizable | ( | int | pal, |
int | clamped, | ||
boolean | in_out | ||
) |
Definition at line 12343 of file colourspace.c.
LIVES_GLOBAL_INLINE boolean weed_palette_is_rgb | ( | int | pal | ) |
Definition at line 1448 of file colourspace.c.
Referenced by best_palette_match(), consider_swapping(), and weed_palette_is_lower_quality().
LIVES_GLOBAL_INLINE boolean weed_palette_is_sane | ( | int | pal | ) |
Definition at line 1523 of file colourspace.c.
LIVES_GLOBAL_INLINE boolean weed_palette_is_valid | ( | int | pal | ) |
Definition at line 1374 of file colourspace.c.
Referenced by weed_palette_get_compression_ratio().
LIVES_GLOBAL_INLINE boolean weed_palette_is_yuv | ( | int | pal | ) |
Definition at line 1457 of file colourspace.c.
Referenced by best_palette_match(), open_vid_playback_plugin(), vpp_try_match_palette(), weed_channel_get_palette_yuv(), and weed_palette_get_name_full().
LIVES_GLOBAL_INLINE boolean weed_palette_red_first | ( | int | pal | ) |
Definition at line 1433 of file colourspace.c.
Referenced by weed_palettes_rbswapped().
LIVES_GLOBAL_INLINE boolean weed_palettes_rbswapped | ( | int | pal0, |
int | pal1 | ||
) |
Definition at line 1444 of file colourspace.c.
void xyz2lab | ( | double | x, |
double | y, | ||
double | z, | ||
double * | l, | ||
double * | a, | ||
double * | b | ||
) |
Definition at line 1028 of file colourspace.c.
Referenced by cdist94().