59 const float *mask_rect_float,
92 ImBuf *mask_input =
nullptr;
113 mask_input =
seq_render_mask(context, mask_id, timeline_frame - fra_offset, make_float);
141 int offset = 4 * start_line * ibuf->
x;
145 handle->width = ibuf->
x;
146 handle->height = tot_line;
147 handle->apply_callback =
init_data->apply_callback;
148 handle->user_data =
init_data->user_data;
159 if (mask->byte_buffer.data) {
160 handle->mask_rect = mask->byte_buffer.data + offset;
163 if (mask->float_buffer.data) {
164 handle->mask_rect_float = mask->float_buffer.data + offset;
168 handle->mask_rect =
nullptr;
169 handle->mask_rect_float =
nullptr;
199 init_data.apply_callback = apply_callback;
216 for (c = 0; c < 3; c++) {
221 for (c = 0; c < 3; c++) {
224 if (cb.
lift[c] > 1.0f) {
233 for (c = 0; c < 3; c++) {
234 if (cb.
gain[c] != 0.0f) {
238 cb.
gain[c] = 1000000;
244 for (c = 0; c < 3; c++) {
245 if (cb.
gamma[c] != 0.0f) {
249 cb.
gamma[c] = 1000000;
262 for (c = 0; c < 3; c++) {
264 if (cb.
slope[c] != 0.0f) {
268 cb.
slope[c] = 1000000;
280 if (cb.
power[c] != 0.0f) {
284 cb.
power[c] = 1000000;
303 float in,
const float lift,
const float gain,
const float gamma,
const float mul)
305 float x = (((in - 1.0f) * lift) + 1.0f) * gain;
319 float in,
const float slope,
const float offset,
const float power,
float mul)
321 float x = in * slope + offset;
341 float lift,
float gain,
float gamma,
float mul,
float r_table[
CB_TABLE_SIZE])
360 const uchar *mask_rect,
366 const uchar *mask_ptr = mask_rect;
368 if (mask_ptr !=
nullptr) {
370 while (
ptr < ptr_end) {
377 const float t[3] = {mask_ptr[0] / 255.0f, mask_ptr[1] / 255.0f, mask_ptr[2] / 255.0f};
379 pix[0] = pix[0] * (1.0f - t[0]) + t[0] * cb_tab[0][p0];
380 pix[1] = pix[1] * (1.0f - t[1]) + t[1] * cb_tab[1][p1];
381 pix[2] = pix[2] * (1.0f - t[2]) + t[2] * cb_tab[2][p2];
390 while (
ptr < ptr_end) {
397 pix[0] = cb_tab[0][p0];
398 pix[1] = cb_tab[1][p1];
399 pix[2] = cb_tab[2][p2];
408 const float *mask_rect_float,
413 float *
ptr = rect_float;
414 const float *ptr_end = rect_float +
int64_t(width) * height * 4;
415 const float *mask_ptr = mask_rect_float;
422 while (
ptr < ptr_end) {
427 ptr[0] =
ptr[0] * (1.0f - mask_ptr[0]) + t0 * mask_ptr[0];
428 ptr[1] =
ptr[1] * (1.0f - mask_ptr[1]) + t1 * mask_ptr[1];
429 ptr[2] =
ptr[2] * (1.0f - mask_ptr[2]) + t2 * mask_ptr[2];
447 while (
ptr < ptr_end) {
452 ptr[0] =
ptr[0] * (1.0f - mask_ptr[0]) + t0 * mask_ptr[0];
453 ptr[1] =
ptr[1] * (1.0f - mask_ptr[1]) + t1 * mask_ptr[1];
454 ptr[2] =
ptr[2] * (1.0f - mask_ptr[2]) + t2 * mask_ptr[2];
476 for (
int c = 0; c < 3; c++) {
499 for (
int c = 0; c < 3; c++) {
510 const int64_t offset = y_range.first() * ibuf->x * 4;
511 const int y_size = int(y_range.size());
512 if (ibuf->float_buffer.data != nullptr) {
514 color_balance_float(&cb,
515 ibuf->float_buffer.data + offset,
516 mask ? mask->float_buffer.data + offset : nullptr,
523 color_balance_byte(cb_tab,
524 ibuf->byte_buffer.data + offset,
525 mask ? mask->byte_buffer.data + offset : nullptr,
534 "ColorBalanceModifierData",
563 const float *mask_rect_float,
571 multiplier[0] = (data->white[0] != 0.0f) ? 1.0f / data->
white[0] :
FLT_MAX;
572 multiplier[1] = (data->white[1] != 0.0f) ? 1.0f / data->white[1] :
FLT_MAX;
573 multiplier[2] = (data->white[2] != 0.0f) ? 1.0f / data->white[2] :
FLT_MAX;
575 for (y = 0; y < height; y++) {
576 for (x = 0; x < width; x++) {
577 int pixel_index = (y * width +
x) * 4;
578 float rgba[4], result[4], mask[3] = {1.0f, 1.0f, 1.0f};
592 for (
int i = 0; i < 3; i++) {
593 result[i] = 1.0f -
powf(1.0f - rgba[i], multiplier[i]);
597 if (mask_rect_float) {
598 copy_v3_v3(mask, mask_rect_float + pixel_index);
600 else if (mask_rect) {
604 result[0] = rgba[0] * (1.0f - mask[0]) + result[0] * mask[0];
605 result[1] = rgba[1] * (1.0f - mask[1]) + result[1] * mask[1];
606 result[2] = rgba[2] * (1.0f - mask[2]) + result[2] * mask[2];
633 "WhiteBalanceModifierData",
674 const float *mask_rect_float,
680 for (y = 0; y < height; y++) {
681 for (x = 0; x < width; x++) {
682 int pixel_index = (y * width +
x) * 4;
685 float *pixel = rect_float + pixel_index;
690 if (mask_rect_float) {
691 const float *m = mask_rect_float + pixel_index;
693 pixel[0] = pixel[0] * (1.0f - m[0]) + result[0] * m[0];
694 pixel[1] = pixel[1] * (1.0f - m[1]) + result[1] * m[1];
695 pixel[2] = pixel[2] * (1.0f - m[2]) + result[2] * m[2];
698 pixel[0] = result[0];
699 pixel[1] = result[1];
700 pixel[2] = result[2];
704 uchar *pixel = rect + pixel_index;
705 float result[3], tempc[4];
716 tempc[0] = tempc[0] * (1.0f - t[0]) + result[0] * t[0];
717 tempc[1] = tempc[1] * (1.0f - t[1]) + result[1] * t[1];
718 tempc[2] = tempc[2] * (1.0f - t[2]) + result[2] * t[2];
721 tempc[0] = result[0];
722 tempc[1] = result[1];
723 tempc[2] = result[2];
739 const float black[3] = {0.0f, 0.0f, 0.0f};
740 const float white[3] = {1.0f, 1.0f, 1.0f};
754 "CurvesModifierData",
776 for (c = 0; c < 3; c++) {
807 const float *mask_rect_float,
813 for (y = 0; y < height; y++) {
814 for (x = 0; x < width; x++) {
815 int pixel_index = (y * width +
x) * 4;
816 float pixel[3], result[3], mask[3] = {1.0f, 1.0f, 1.0f};
826 rgb_to_hsv(pixel[0], pixel[1], pixel[2], hsv, hsv + 1, hsv + 2);
834 hsv[1] *= (f * 2.0f);
838 hsv[2] *= (f * 2.0f);
840 hsv[0] = hsv[0] -
floorf(hsv[0]);
841 CLAMP(hsv[1], 0.0f, 1.0f);
844 hsv_to_rgb(hsv[0], hsv[1], hsv[2], result, result + 1, result + 2);
846 if (mask_rect_float) {
847 copy_v3_v3(mask, mask_rect_float + pixel_index);
849 else if (mask_rect) {
853 result[0] = pixel[0] * (1.0f - mask[0]) + result[0] * mask[0];
854 result[1] = pixel[1] * (1.0f - mask[1]) + result[1] * mask[1];
855 result[2] = pixel[2] * (1.0f - mask[2]) + result[2] * mask[2];
881 "HueCorrectModifierData",
905 const float *mask_rect_float,
914 const float brightness = data->bright / 100.0f;
915 const float contrast = data->contrast;
916 float delta = contrast / 200.0f;
923 a = 1.0f - delta * 2.0f;
924 a = 1.0f /
max_ff(a, FLT_EPSILON);
925 b = a * (brightness - delta);
929 a =
max_ff(1.0f - delta * 2.0f, 0.0f);
930 b = a * brightness + delta;
933 for (y = 0; y < height; y++) {
934 for (x = 0; x < width; x++) {
935 int pixel_index = (y * width +
x) * 4;
938 uchar *pixel = rect + pixel_index;
940 for (c = 0; c < 3; c++) {
941 i =
float(pixel[c]) / 255.0f;
945 const uchar *m = mask_rect + pixel_index;
946 const float t =
float(m[c]) / 255.0f;
948 v =
float(pixel[c]) / 255.0f * (1.0f - t) +
v * t;
954 else if (rect_float) {
955 float *pixel = rect_float + pixel_index;
957 for (c = 0; c < 3; c++) {
961 if (mask_rect_float) {
962 const float *m = mask_rect_float + pixel_index;
964 pixel[c] = pixel[c] * (1.0f - m[c]) +
v * m[c];
991 "BrightContrastModifierData",
1010 const float *mask_rect_float,
1015 if (rect && !mask_rect) {
1019 if (rect_float && !mask_rect_float) {
1023 for (y = 0; y < height; y++) {
1024 for (x = 0; x < width; x++) {
1025 const int pixel_index = (y * width +
x) * 4;
1028 const uchar *mask_pixel = mask_rect + pixel_index;
1029 const uchar mask =
min_iii(mask_pixel[0], mask_pixel[1], mask_pixel[2]);
1030 uchar *pixel = rect + pixel_index;
1036 pixel[3] =
float(pixel[3] * mask) / 255.0f;
1038 else if (rect_float) {
1039 const float *mask_pixel = mask_rect_float + pixel_index;
1040 const float mask =
min_fff(mask_pixel[0], mask_pixel[1], mask_pixel[2]);
1041 float *pixel = rect_float + pixel_index;
1046 for (
int c = 0; c < 4; c++) {
1047 pixel[c] = pixel[c] *
mask;
1067 "SequencerMaskModifierData",
1108 (
float *)(pixels),
int(
count), 1, 4, colorspace,
false);
1113 const uchar *pixels,
1117 const uchar *bptr = pixels;
1125 (
float *)dst,
int(
count), 1, 4, colorspace,
false);
1133 (
float *)(fptr + range.first()),
int(range.size()), 1, 4, colorspace);
1140 (
float *)src,
int(range.size()), 1, 4, colorspace);
1141 const float4 *src_ptr = src;
1154 const float4 *mask_float = mask !=
nullptr ? (
const float4 *)mask->float_buffer.data :
nullptr;
1155 const uchar4 *mask_byte = mask !=
nullptr ? (
const uchar4 *)mask->byte_buffer.data :
nullptr;
1159 float4 input = scene_linear[index];
1162 float3 pixel = input.xyz() * avg.
al;
1164 pixel.x /= (d.
x == 0.0f) ? 1.0f : d.
x;
1165 pixel.y /= (d.
y == 0.0f) ? 1.0f : d.
y;
1166 pixel.z /= (d.
z == 0.0f) ? 1.0f : d.
z;
1167 const float igm = avg.
igm;
1175 if (mask !=
nullptr) {
1177 if (mask_float !=
nullptr) {
1178 msk = mask_float[pixel_index].
xyz();
1180 else if (mask_byte !=
nullptr) {
1186 scene_linear[index] =
float4(pixel.x, pixel.y, pixel.z, input.w);
1196 const float4 *mask_float = mask !=
nullptr ? (
const float4 *)mask->float_buffer.data :
nullptr;
1197 const uchar4 *mask_byte = mask !=
nullptr ? (
const uchar4 *)mask->byte_buffer.data :
nullptr;
1206 float4 input = scene_linear[index];
1209 float3 pixel = input.xyz();
1211 float I_l = pixel.x + ic * (
L - pixel.x);
1212 float I_g = avg.
cav.x + ic * (avg.
lav - avg.
cav.x);
1213 float I_a = I_l + ia * (I_g - I_l);
1214 pixel.x /= std::max(pixel.x +
powf(f * I_a, m), 1.0e-30f);
1215 I_l = pixel.y + ic * (
L - pixel.y);
1216 I_g = avg.
cav.y + ic * (avg.
lav - avg.
cav.y);
1217 I_a = I_l + ia * (I_g - I_l);
1218 pixel.y /= std::max(pixel.y +
powf(f * I_a, m), 1.0e-30f);
1219 I_l = pixel.z + ic * (
L - pixel.z);
1220 I_g = avg.
cav.z + ic * (avg.
lav - avg.
cav.z);
1221 I_a = I_l + ia * (I_g - I_l);
1222 pixel.z /= std::max(pixel.z +
powf(f * I_a, m), 1.0e-30f);
1225 if (mask !=
nullptr) {
1227 if (mask_float !=
nullptr) {
1228 msk = mask_float[pixel_index].
xyz();
1230 else if (mask_byte !=
nullptr) {
1236 scene_linear[index] =
float4(pixel.x, pixel.y, pixel.z, input.w);
1243 float2 pt(x + 0.5f, y + 0.5f);
1257 const bool all_pixels_inside_quad,
1260 const float4 *scene_linear,
1263 for (
const int y : y_range) {
1264 for (
int x = 0; x < width; x++) {
1266 float4 pixel = *scene_linear;
1298 AreaLuminance lum = init;
1299 const int64_t chunk_size = y_range.size() * ibuf->x;
1302 if (ibuf->float_buffer.data != nullptr) {
1303 float4 *fptr = reinterpret_cast<float4 *>(ibuf->float_buffer.data);
1304 fptr += y_range.first() * ibuf->x;
1305 pixels_to_scene_linear_float(ibuf->float_buffer.colorspace, fptr, chunk_size);
1306 tonemap_calc_chunk_luminance(quad, all_pixels_inside_quad, ibuf->x, y_range, fptr, lum);
1309 const uchar *bptr = ibuf->byte_buffer.data + y_range.first() * ibuf->x * 4;
1310 Array<float4> scene_linear(chunk_size);
1311 pixels_to_scene_linear_byte(
1312 ibuf->byte_buffer.colorspace, bptr, scene_linear.data(), chunk_size);
1313 tonemap_calc_chunk_luminance(
1314 quad, all_pixels_inside_quad, ibuf->x, y_range, scene_linear.data(), lum);
1322 res.
sum = a.sum +
b.sum;
1324 res.
log_sum = a.log_sum +
b.log_sum;
1350 float maxl =
log(
double(lum.
max) + 1e-5f);
1351 float minl =
log(
double(lum.
min) + 1e-5f);
1353 data.auto_key = (maxl > minl) ? ((maxl - avl) / (maxl - minl)) : 1.0f;
1354 float al =
exp(
double(avl));
1355 data.al = (al == 0.0f) ? 0.0f : (tmmd->
key / al);
1356 data.igm = (tmmd->
gamma == 0.0f) ? 1.0f : (1.0f / tmmd->
gamma);
1360 if (ibuf->float_buffer.data != nullptr) {
1363 float4 *pixels = (float4 *)(ibuf->float_buffer.data) + range.first();
1364 if (tmmd->type == SEQ_TONEMAP_RD_PHOTORECEPTOR) {
1365 tonemap_rd_photoreceptor(pixels, mask, range, data);
1368 BLI_assert(tmmd->type == SEQ_TONEMAP_RH_SIMPLE);
1369 tonemap_simple(pixels, mask, range, data);
1371 scene_linear_to_image_chunk_float(ibuf, range);
1375 Array<float4> scene_linear(range.size());
1376 pixels_to_scene_linear_byte(ibuf->byte_buffer.colorspace,
1377 ibuf->byte_buffer.data + range.first() * 4,
1378 scene_linear.data(),
1380 if (tmmd->type == SEQ_TONEMAP_RD_PHOTORECEPTOR) {
1381 tonemap_rd_photoreceptor(scene_linear.data(), mask, range, data);
1384 BLI_assert(tmmd->type == SEQ_TONEMAP_RH_SIMPLE);
1385 tonemap_simple(scene_linear.data(), mask, range, data);
1394 "SequencerTonemapModifierData",
1404 "SoundEqualizerModifierData",
1419#define INIT_TYPE(typeName) (modifiersTypes[seqModifierType_##typeName] = &seqModifier_##typeName)
1453 if (!name || !name[0]) {
1488 smd_next = smd->
next;
1538 return strip_has_ended_skip || missing_data_skip;
1568 frame_offset = seq->
start;
1571 frame_offset = smd->mask_id ? ((
Mask *)smd->mask_id)->sfra : 0;
1575 smd, context, timeline_frame, frame_offset, ibuf->
float_buffer.
data !=
nullptr);
1660 if (smd->mask_sequence) {
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE int min_iii(int a, int b, int c)
MINLINE float min_fff(float a, float b, float c)
MINLINE void straight_uchar_to_premul_float(float result[4], const unsigned char color[4])
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b)
void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3])
MINLINE void premul_float_to_straight_uchar(unsigned char *result, const float color[4])
int isect_point_quad_v2(const float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl(float r[3], float f)
#define STRNCPY(dst, src)
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
void BLO_write_struct_by_name(BlendWriter *writer, const char *struct_name, const void *data_ptr)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define CTX_N_(context, msgid)
#define BLT_I18NCONTEXT_ID_SEQUENCE
#define CTX_DATA_(context, msgid)
struct SoundEqualizerModifierData SoundEqualizerModifierData
@ NUM_SEQUENCE_MODIFIER_TYPES
@ seqModifierType_SoundEqualizer
@ seqModifierType_HueCorrect
struct WhiteBalanceModifierData WhiteBalanceModifierData
struct ColorBalanceModifierData ColorBalanceModifierData
@ SEQ_TONEMAP_RD_PHOTORECEPTOR
struct CurvesModifierData CurvesModifierData
struct SequencerTonemapModifierData SequencerTonemapModifierData
@ SEQ_COLOR_BALANCE_METHOD_LIFTGAMMAGAIN
@ SEQ_USE_LINEAR_MODIFIERS
struct HueCorrectModifierData HueCorrectModifierData
@ SEQUENCE_MODIFIER_EXPANDED
@ SEQUENCE_MASK_INPUT_STRIP
@ SEQUENCE_MASK_TIME_RELATIVE
struct BrightContrastModifierData BrightContrastModifierData
@ SEQ_COLOR_BALANCE_INVERSE_GAIN
@ SEQ_COLOR_BALANCE_INVERSE_LIFT
@ SEQ_COLOR_BALANCE_INVERSE_SLOPE
@ SEQ_COLOR_BALANCE_INVERSE_POWER
@ SEQ_COLOR_BALANCE_INVERSE_OFFSET
@ SEQ_COLOR_BALANCE_INVERSE_GAMMA
struct SequencerMaskModifierData SequencerMaskModifierData
BLI_INLINE float IMB_colormanagement_get_luminance(const float rgb[3])
void IMB_colormanagement_scene_linear_to_colorspace(float *buffer, int width, int height, int channels, ColorSpace *colorspace)
void IMB_colormanagement_colorspace_to_scene_linear(float *buffer, int width, int height, int channels, ColorSpace *colorspace, bool predivide)
void IMB_rect_from_float(ImBuf *ibuf)
void IMB_processor_apply_threaded(int buffer_lines, int handle_size, void *init_customdata, void(init_handle)(void *handle, int start_line, int tot_line, void *customdata), void *(do_thread)(void *))
void IMB_float_from_rect(ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
static void mul(btAlignedObjectArray< T > &items, const Q &value)
local_group_size(16, 16) .push_constant(Type b
pow(value.r - subtrahend, 2.0)") .do_static_compilation(true)
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
blender::gpu::Batch * quad
void IMB_freeImBuf(ImBuf *)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_dupallocN)(const void *vmemh)
#define unit_float_to_uchar_clamp(val)
ccl_device_inline float2 power(float2 v, float e)
ccl_device_inline float3 exp(float3 v)
ccl_device_inline float3 log(float3 v)
ccl_device_inline float4 mask(const int4 mask, const float4 a)
T min(const T &a, const T &b)
T interpolate(const T &a, const T &b, const FactorT &t)
T max(const T &a, const T &b)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Value parallel_reduce(IndexRange range, int64_t grain_size, const Value &identity, const Function &function, const Reduction &reduction)
static void init_data(ModifierData *md)
VecBase< float, 4 > float4
void seq_imbuf_to_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float)
StripScreenQuad get_strip_screen_quad(const SeqRenderData *context, const Sequence *seq)
ImBuf * seq_render_mask(const SeqRenderData *context, Mask *mask, float frame_index, bool make_float)
ImBuf * seq_render_strip(const SeqRenderData *context, SeqRenderState *state, Sequence *seq, float timeline_frame)
void SEQ_render_imbuf_from_sequencer_space(Scene *scene, ImBuf *ibuf)
static ImBuf * modifier_render_mask_input(const SeqRenderData *context, int mask_input_type, Sequence *mask_sequence, Mask *mask_id, int timeline_frame, int fra_offset, bool make_float)
void SEQ_modifier_blend_write(BlendWriter *writer, ListBase *modbase)
SequenceModifierData * SEQ_modifier_new(Sequence *seq, const char *name, int type)
bool SEQ_modifier_remove(Sequence *seq, SequenceModifierData *smd)
static ImBuf * modifier_mask_get(SequenceModifierData *smd, const SeqRenderData *context, int timeline_frame, int fra_offset, bool make_float)
static void hue_correct_apply(const StripScreenQuad &, SequenceModifierData *smd, ImBuf *ibuf, ImBuf *mask)
static void scene_linear_to_image_chunk_float(ImBuf *ibuf, IndexRange range)
static void tonemapmodifier_init_data(SequenceModifierData *smd)
static void modifier_apply_threaded(ImBuf *ibuf, ImBuf *mask, modifier_apply_threaded_cb apply_callback, void *user_data)
static StripColorBalance calc_cb_sop(const StripColorBalance *cb_)
SequenceModifierData * SEQ_modifier_find_by_name(Sequence *seq, const char *name)
void SEQ_modifier_apply_stack(const SeqRenderData *context, const Sequence *seq, ImBuf *ibuf, int timeline_frame)
static void hue_correct_free_data(SequenceModifierData *smd)
static void colorBalance_apply(const StripScreenQuad &, SequenceModifierData *smd, ImBuf *ibuf, ImBuf *mask)
static bool is_point_inside_quad(const StripScreenQuad &quad, int x, int y)
void SEQ_modifier_free(SequenceModifierData *smd)
const SequenceModifierTypeInfo * SEQ_modifier_type_info_get(int type)
static void tonemap_rd_photoreceptor(float4 *scene_linear, ImBuf *mask, IndexRange range, const AvgLogLum &avg)
static float color_balance_sop(float in, const float slope, const float offset, const float power, float mul)
static void color_balance_float(const StripColorBalance *cb, float *rect_float, const float *mask_rect_float, int width, int height, float mul)
static void scene_linear_to_image_chunk_byte(float4 *src, ImBuf *ibuf, IndexRange range)
static void whiteBalance_apply_threaded(int width, int height, uchar *rect, float *rect_float, uchar *mask_rect, const float *mask_rect_float, void *data_v)
#define INIT_TYPE(typeName)
static SequenceModifierTypeInfo seqModifier_HueCorrect
static void tonemap_calc_chunk_luminance(const StripScreenQuad &quad, const bool all_pixels_inside_quad, const int width, const IndexRange y_range, const float4 *scene_linear, AreaLuminance &r_lum)
static bool skip_modifier(Scene *scene, const SequenceModifierData *smd, int timeline_frame)
static void brightcontrast_apply_threaded(int width, int height, uchar *rect, float *rect_float, uchar *mask_rect, const float *mask_rect_float, void *data_v)
static void maskmodifier_apply(const StripScreenQuad &, SequenceModifierData *, ImBuf *ibuf, ImBuf *mask)
static float color_balance_lgg(float in, const float lift, const float gain, const float gamma, const float mul)
static void tonemapmodifier_apply(const StripScreenQuad &quad, SequenceModifierData *smd, ImBuf *ibuf, ImBuf *mask)
static AreaLuminance tonemap_calc_input_luminance(const StripScreenQuad &quad, const ImBuf *ibuf)
static void hue_correct_init_data(SequenceModifierData *smd)
static SequenceModifierTypeInfo seqModifier_Curves
void SEQ_modifier_clear(Sequence *seq)
static void hue_correct_copy_data(SequenceModifierData *target, SequenceModifierData *smd)
static void curves_copy_data(SequenceModifierData *target, SequenceModifierData *smd)
static void brightcontrast_apply(const StripScreenQuad &, SequenceModifierData *smd, ImBuf *ibuf, ImBuf *mask)
static void sequence_modifier_type_info_init()
static void curves_free_data(SequenceModifierData *smd)
void SEQ_modifier_blend_read_data(BlendDataReader *reader, ListBase *lb)
static void color_balance_byte(const float cb_tab[3][CB_TABLE_SIZE], uchar *rect, const uchar *mask_rect, int width, int height)
static SequenceModifierTypeInfo seqModifier_Mask
static SequenceModifierTypeInfo seqModifier_ColorBalance
static void * modifier_do_thread(void *thread_data_v)
static void hue_correct_apply_threaded(int width, int height, uchar *rect, float *rect_float, uchar *mask_rect, const float *mask_rect_float, void *data_v)
static void curves_apply_threaded(int width, int height, uchar *rect, float *rect_float, uchar *mask_rect, const float *mask_rect_float, void *data_v)
void(*)(int width, int height, uchar *rect, float *rect_float, uchar *mask_rect, const float *mask_rect_float, void *data_v) modifier_apply_threaded_cb
static SequenceModifierTypeInfo seqModifier_WhiteBalance
static StripColorBalance calc_cb_lgg(const StripColorBalance *cb_)
static SequenceModifierTypeInfo seqModifier_BrightContrast
static void curves_apply(const StripScreenQuad &, SequenceModifierData *smd, ImBuf *ibuf, ImBuf *mask)
static void tonemap_simple(float4 *scene_linear, ImBuf *mask, IndexRange range, const AvgLogLum &avg)
static void curves_init_data(SequenceModifierData *smd)
static SequenceModifierTypeInfo * modifiersTypes[NUM_SEQUENCE_MODIFIER_TYPES]
static StripColorBalance calc_cb(const StripColorBalance *cb_)
void SEQ_modifier_list_copy(Sequence *seqn, Sequence *seq)
static void whiteBalance_apply(const StripScreenQuad &, SequenceModifierData *smd, ImBuf *ibuf, ImBuf *mask)
static SequenceModifierTypeInfo seqModifier_SoundEqualizer
static void whiteBalance_init_data(SequenceModifierData *smd)
static void make_cb_table_lgg(float lift, float gain, float gamma, float mul, float r_table[CB_TABLE_SIZE])
static SequenceModifierTypeInfo seqModifier_Tonemap
static void make_cb_table_sop(float slope, float offset, float power, float mul, float r_table[CB_TABLE_SIZE])
static void maskmodifier_apply_threaded(int width, int height, uchar *rect, float *rect_float, uchar *mask_rect, const float *mask_rect_float, void *)
static void modifier_init_handle(void *handle_v, int start_line, int tot_line, void *init_data_v)
int SEQ_sequence_supports_modifiers(Sequence *seq)
static void pixels_to_scene_linear_byte(ColorSpace *colorspace, const uchar *pixels, float4 *dst, int64_t count)
static void colorBalance_init_data(SequenceModifierData *smd)
static void pixels_to_scene_linear_float(ColorSpace *colorspace, float4 *pixels, int64_t count)
void SEQ_modifier_unique_name(Sequence *seq, SequenceModifierData *smd)
static constexpr int CB_TABLE_SIZE
static bool modifierTypesInit
void SEQ_sound_equalizermodifier_free(SequenceModifierData *smd)
void SEQ_sound_equalizermodifier_init_data(SequenceModifierData *smd)
void SEQ_sound_equalizermodifier_copy_data(SequenceModifierData *target, SequenceModifierData *smd)
bool SEQ_sequence_has_valid_data(const Sequence *seq)
bool SEQ_time_strip_intersects_frame(const Scene *scene, const Sequence *seq, const int timeline_frame)
const SequencerTonemapModifierData * tmmd
StripColorBalance color_balance
struct CurveMapping curve_mapping
struct CurveMapping curve_mapping
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
modifier_apply_threaded_cb apply_callback
modifier_apply_threaded_cb apply_callback
struct SequenceModifierData * next
struct Sequence * mask_sequence
void(* copy_data)(SequenceModifierData *smd, SequenceModifierData *target)
void(* apply)(const StripScreenQuad &quad, SequenceModifierData *smd, ImBuf *ibuf, ImBuf *mask)
void(* init_data)(SequenceModifierData *smd)
void(* free_data)(SequenceModifierData *smd)
VecBase< T, 3 > xyz() const