27 const float4 *src,
float4 *map,
int width,
int height,
float blur,
int quality)
35 const int halfWidth = ((quality + 1) * blur);
45 const float k = -1.0f / (2.0f *
float(
M_PI) * blur * blur);
47 for (
int ix = 0; ix < halfWidth; ix++) {
48 weight =
exp(k * (ix * ix));
49 filter[halfWidth - ix] = weight;
50 filter[halfWidth + ix] = weight;
55 for (
int ix = 0; ix < halfWidth * 2; ix++) {
58 for (
int ix = 0; ix < halfWidth * 2; ix++) {
64 for (
const int y : y_range) {
65 for (
int x = 0;
x < width;
x++) {
69 for (
int nx = xmin,
index = (xmin -
x) + halfWidth; nx < xmax; nx++,
index++) {
72 temp[
x +
y * width] = curColor;
80 for (
const int x : x_range) {
81 for (
int y = 0;
y < height;
y++) {
85 for (
int ny = ymin,
index = (ymin -
y) + halfWidth; ny < ymax; ny++,
index++) {
89 curColor =
math::min(one, src[
x +
y * width] + curColor);
91 map[
x +
y * width] = curColor;
107 for (
const int y : y_range) {
109 for (
int x = 0;
x < width;
x++,
index++) {
129 strip->effectdata =
data;
140 if (strip->effectdata) {
143 strip->effectdata =
nullptr;
169 glow->
dDist * (render_size / 100.0f),
173 size_t offset = y_range.
first() *
x;
175 out + offset * 4, *(outbuf.
data() + offset), 4, 0.0f,
true,
x, y_range.
size(),
x);
189 const float4 *inbuf =
reinterpret_cast<const float4 *
>(rect1);
198 glow->
dDist * (render_size / 100.0f),
213 int render_size = 100 * context->rectx / context->scene->r.xsch;
215 if (
out.image->float_data()) {
223 out.image->float_data_for_write());
233 out.image->byte_data_for_write());
#define PRF_scope_with_name(ui_name, category)
constexpr int64_t first() const
constexpr int64_t size() const
constexpr IndexRange()=default
constexpr T clamp(T, U, U) RET
T min(const T &a, const T &b)
T max(const T &a, const T &b)
static void do_glow_effect_float(Strip *strip, int render_size, float fac, int x, int y, const float *rect1, const float *, float *out)
static void init_glow_effect(Strip *strip)
static SeqResult do_glow_effect(const RenderData *context, SeqRenderState *, Strip *strip, float, float fac, const SeqResult &ibuf1, const SeqResult &)
SeqResult prepare_effect_imbufs(const RenderData *context, const SeqResult &ibuf1, const SeqResult &ibuf2, bool uninitialized_pixels)
static void glow_blur_bitmap(const float4 *src, float4 *map, int width, int height, float blur, int quality)
static void free_glow_effect(Strip *strip, const bool)
static void do_glow_effect_byte(Strip *strip, int render_size, float fac, int x, int y, const uchar *rect1, const uchar *, uchar *out)
static void blur_isolate_highlights(const float4 *in, float4 *out, int width, int height, float threshold, float boost, float clamp)
void glow_effect_get_handle(EffectHandle &rval)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
void IMB_colormanagement_transform_byte_to_float(float *float_buffer, const unsigned char *byte_buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
void IMB_buffer_byte_from_float(unsigned char *dest, const float *src, int src_channels, float dither, bool predivide, int width, int height, int stride, int start_y=0)
VecBase< float, 4 > float4
BMesh const char void * data
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
const uint8_t * byte_data() const
const float * float_data() const
void(*) free(Strip *strip, bool do_id_user)
void(*) init(Strip *strip)
SeqResult(*) execute(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame, float fac, const SeqResult &input1, const SeqResult &input2)