14 #ifdef COM_DEFOCUS_SEARCH
22 input_program_ =
nullptr;
23 input_bokeh_program_ =
nullptr;
24 input_size_program_ =
nullptr;
27 do_size_scale_ =
false;
28 #ifdef COM_DEFOCUS_SEARCH
29 input_search_program_ =
nullptr;
38 #ifdef COM_DEFOCUS_SEARCH
62 const float scalar = do_size_scale_ ? (max_dim / 100.0f) : 1.0f;
64 data->max_blur_scalar = (int)(
data->size->get_max_value(rect2) * scalar);
65 CLAMP(
data->max_blur_scalar, 1.0f, max_blur_);
81 float *input_size_float_buffer = input_size_buffer->
get_buffer();
82 float *input_program_float_buffer = input_program_buffer->
get_buffer();
86 float multiplier_accum[4];
90 const float scalar = do_size_scale_ ? (max_dim / 100.0f) : 1.0f;
96 #ifdef COM_DEFOCUS_SEARCH
98 input_search_program_->read(search,
99 x / InverseSearchRadiusOperation::DIVIDER,
100 y / InverseSearchRadiusOperation::DIVIDER,
102 int minx = search[0];
103 int miny = search[1];
104 int maxx = search[2];
105 int maxy = search[3];
107 int minx =
MAX2(
x - max_blur_scalar, 0);
108 int miny =
MAX2(
y - max_blur_scalar, 0);
118 float size_center = temp_size[0] * scalar;
121 const int add_ystep_value = add_xstep_value;
124 if (size_center > threshold_) {
125 for (
int ny = miny;
ny < maxy;
ny += add_ystep_value) {
127 int offset_value_ny =
ny * input_size_buffer->
get_width();
128 int offset_value_nx_ny = offset_value_ny + (minx);
130 for (
int nx = minx; nx < maxx; nx += add_xstep_value) {
131 if (nx !=
x ||
ny !=
y) {
132 float size =
MIN2(input_size_float_buffer[offset_value_nx_ny] * scalar, size_center);
133 if (
size > threshold_) {
142 input_bokeh_buffer->
read(bokeh, uv[0], uv[1]);
143 madd_v4_v4v4(color_accum, bokeh, &input_program_float_buffer[offset_color_nx_ny]);
148 offset_color_nx_ny += add_xstep_color;
149 offset_value_nx_ny += add_xstep_value;
154 output[0] = color_accum[0] / multiplier_accum[0];
155 output[1] = color_accum[1] / multiplier_accum[1];
156 output[2] = color_accum[2] / multiplier_accum[2];
157 output[3] = color_accum[3] / multiplier_accum[3];
160 if ((size_center > threshold_) && (size_center < threshold_ * 2.0f)) {
162 float fac = (size_center - threshold_) / threshold_;
171 cl_mem cl_output_buffer,
173 std::list<cl_mem> *cl_mem_to_clean_up,
174 std::list<cl_kernel> * )
183 input_memory_buffers);
186 cl_float scalar = do_size_scale_ ? (max_dim / 100.0f) : 1.0f;
191 defocus_kernel, 0, -1, cl_mem_to_clean_up, input_memory_buffers, input_program_);
193 defocus_kernel, 1, -1, cl_mem_to_clean_up, input_memory_buffers, input_bokeh_program_);
195 defocus_kernel, 2, 4, cl_mem_to_clean_up, input_memory_buffers, input_size_program_);
197 defocus_kernel, 3, cl_output_buffer);
199 defocus_kernel, 5, output_memory_buffer);
200 clSetKernelArg(defocus_kernel, 6,
sizeof(cl_int), &step);
201 clSetKernelArg(defocus_kernel, 7,
sizeof(cl_int), &max_blur);
202 clSetKernelArg(defocus_kernel, 8,
sizeof(cl_float), &
threshold);
203 clSetKernelArg(defocus_kernel, 9,
sizeof(cl_float), &scalar);
211 input_program_ =
nullptr;
212 input_bokeh_program_ =
nullptr;
213 input_size_program_ =
nullptr;
214 #ifdef COM_DEFOCUS_SEARCH
215 input_search_program_ =
nullptr;
226 const float scalar = do_size_scale_ ? (max_dim / 100.0f) : 1.0f;
227 int max_blur_scalar = max_blur_ * scalar;
229 new_input.
xmax =
input->xmax + max_blur_scalar + 2;
230 new_input.
xmin =
input->xmin - max_blur_scalar + 2;
231 new_input.
ymax =
input->ymax + max_blur_scalar - 2;
232 new_input.
ymin =
input->ymin - max_blur_scalar - 2;
234 bokeh_input.
xmin = 0;
236 bokeh_input.
ymin = 0;
246 #ifdef COM_DEFOCUS_SEARCH
248 search_input.
xmax = (
input->xmax / InverseSearchRadiusOperation::DIVIDER) + 1;
249 search_input.
xmin = (
input->xmin / InverseSearchRadiusOperation::DIVIDER) - 1;
250 search_input.
ymax = (
input->ymax / InverseSearchRadiusOperation::DIVIDER) + 1;
251 search_input.
ymin = (
input->ymin / InverseSearchRadiusOperation::DIVIDER) - 1;
265 const rcti &output_area,
269 case IMAGE_INPUT_INDEX:
270 case SIZE_INPUT_INDEX: {
272 const float scalar = do_size_scale_ ? (max_dim / 100.0f) : 1.0f;
273 const int max_blur_scalar = max_blur_ * scalar;
274 r_input_area.
xmax = output_area.
xmax + max_blur_scalar + 2;
275 r_input_area.
xmin = output_area.
xmin - max_blur_scalar - 2;
276 r_input_area.
ymax = output_area.
ymax + max_blur_scalar + 2;
277 r_input_area.
ymin = output_area.
ymin - max_blur_scalar - 2;
280 case BOKEH_INPUT_INDEX: {
281 r_input_area = output_area;
286 #ifdef COM_DEFOCUS_SEARCH
287 case DEFOCUS_INPUT_INDEX: {
288 r_input_area.
xmax = (output_area.
xmax / InverseSearchRadiusOperation::DIVIDER) + 1;
289 r_input_area.
xmin = (output_area.
xmin / InverseSearchRadiusOperation::DIVIDER) - 1;
290 r_input_area.
ymax = (output_area.
ymax / InverseSearchRadiusOperation::DIVIDER) + 1;
291 r_input_area.
ymin = (output_area.
ymin / InverseSearchRadiusOperation::DIVIDER) - 1;
318 #ifdef COM_DEFOCUS_SEARCH
320 inputs[DEFOCUS_INPUT_INDEX]->read_elem_checked(
x / InverseSearchRadiusOperation::DIVIDER,
321 y / InverseSearchRadiusOperation::DIVIDER,
323 const int minx = search[0];
324 const int miny = search[1];
325 const int maxx = search[2];
326 const int maxy = search[3];
340 for (
int ny = miny;
ny < maxy;
341 ny += p.
step, row_size += size_row_stride, row_color += color_row_stride) {
342 const float dy =
ny -
y;
343 const float *size_elem = row_size;
344 const float *
color = row_color;
345 for (
int nx = minx; nx < maxx;
346 nx += p.
step, size_elem += size_elem_stride,
color += color_elem_stride) {
347 if (nx ==
x &&
ny ==
y) {
354 const float dx = nx -
x;
392 p.
scalar = do_size_scale_ ? (max_dim / 100.0f) : 1.0f;
399 const float *
color = it.in(0);
400 const float size = *it.in(1);
423 #ifdef COM_DEFOCUS_SEARCH
425 InverseSearchRadiusOperation::InverseSearchRadiusOperation()
429 this->flags.complex =
true;
430 input_radius_ =
nullptr;
435 input_radius_ = this->get_input_socket_reader(0);
438 void *InverseSearchRadiusOperation::initialize_tile_data(
rcti *rect)
443 int width = input_radius_->get_width();
444 int height = input_radius_->get_height();
447 for (
y = rect->
ymin; y < rect->ymax;
y++) {
448 for (
x = rect->
xmin; x < rect->xmax;
x++) {
449 int rx =
x * DIVIDER;
450 int ry =
y * DIVIDER;
459 for (
x = rect->
xmin; x < rect->xmax;
x++) {
460 for (
y = rect->
ymin; y < rect->ymax;
y++) {
461 int rx =
x * DIVIDER;
462 int ry =
y * DIVIDER;
467 for (
int x2 = 0;
x2 < DIVIDER;
x2++) {
468 for (
int y2 = 0; y2 < DIVIDER; y2++) {
470 if (radius < temp[0]) {
477 int impact_radius =
ceil(radius / DIVIDER);
478 for (
int x2 =
x - impact_radius;
x2 <
x + impact_radius;
x2++) {
479 for (
int y2 =
y - impact_radius; y2 <
y + impact_radius; y2++) {
481 temp[0] =
MIN2(temp[0], maxx);
482 temp[1] =
MIN2(temp[1], maxy);
483 temp[2] =
MAX2(temp[2], maxx);
484 temp[3] =
MAX2(temp[3], maxy);
485 data->write_pixel(
x2, y2, temp);
494 void InverseSearchRadiusOperation::execute_pixel_chunk(
float output[4],
int x,
int y,
void *
data)
500 void InverseSearchRadiusOperation::deinitialize_tile_data(
rcti *rect,
void *
data)
503 MemoryBuffer *mb = (MemoryBuffer *)
data;
508 void InverseSearchRadiusOperation::deinit_execution()
510 input_radius_ =
nullptr;
513 void InverseSearchRadiusOperation::determine_resolution(
unsigned int resolution[2],
514 unsigned int preferred_resolution[2])
516 NodeOperation::determine_resolution(resolution, preferred_resolution);
517 resolution[0] = resolution[0] / DIVIDER;
518 resolution[1] = resolution[1] / DIVIDER;
521 bool InverseSearchRadiusOperation::determine_depending_area_of_interest(
525 new_rect.
ymin =
input->ymin * DIVIDER - max_blur_;
526 new_rect.
ymax =
input->ymax * DIVIDER + max_blur_;
527 new_rect.
xmin =
input->xmin * DIVIDER - max_blur_;
528 new_rect.
xmax =
input->xmax * DIVIDER + max_blur_;
typedef float(TangentPoint)[2]
MINLINE float min_ff(float a, float b)
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void madd_v4_v4v4(float r[4], const float a[4], const float b[4])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
MINLINE void copy_v4_fl(float r[4], float f)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble ny
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
a MemoryBuffer contains access to the data of a chunk
void read(float *result, int x, int y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip)
void read_elem_checked(int x, int y, float *out) const
float get_max_value() const
const rcti & get_rect() const
get the rect of this MemoryBuffer
float * get_elem(int x, int y)
const int get_width() const
get the width of this MemoryBuffer
const int get_height() const
get the height of this MemoryBuffer
float * get_buffer()
get the data of this MemoryBuffer
void read_no_check(float *result, int x, int y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip)
NodeOperation contains calculation logic.
unsigned int get_height() const
void add_output_socket(DataType datatype)
SocketReader * get_input_socket_reader(unsigned int index)
virtual MemoryBuffer * get_input_memory_buffer(MemoryBuffer **)
unsigned int get_width() const
NodeOperationFlags flags_
NodeOperation * get_input_operation(int index)
virtual bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
virtual void * initialize_tile_data(rcti *)
device representing an GPU OpenCL device. an instance of this class represents a single cl_device
void COM_cl_attach_size_to_kernel_parameter(cl_kernel kernel, int offset_index, NodeOperation *operation)
cl_mem COM_cl_attach_memory_buffer_to_kernel_parameter(cl_kernel kernel, int parameter_index, int offset_index, std::list< cl_mem > *cleanup, MemoryBuffer **input_memory_buffers, SocketReader *reader)
void COM_cl_attach_output_memory_buffer_to_kernel_parameter(cl_kernel kernel, int parameter_index, cl_mem cl_output_memory_buffer)
void COM_cl_enqueue_range(cl_kernel kernel, MemoryBuffer *output_memory_buffer)
cl_kernel COM_cl_create_kernel(const char *kernelname, std::list< cl_kernel > *cl_kernels_to_clean_up)
void COM_cl_attach_memory_buffer_offset_to_kernel_parameter(cl_kernel kernel, int offset_index, MemoryBuffer *memory_buffers)
void init_execution(QualityHelper helper)
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void * initialize_tile_data(rcti *rect) override
void deinitialize_tile_data(rcti *rect, void *data) override
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
void execute_opencl(OpenCLDevice *device, MemoryBuffer *output_memory_buffer, cl_mem cl_output_buffer, MemoryBuffer **input_memory_buffers, std::list< cl_mem > *cl_mem_to_clean_up, std::list< cl_kernel > *cl_kernels_to_clean_up) override
custom handle to add new tasks to the OpenCL command queue in order to execute a chunk on an GPUDevic...
void execute_pixel(float output[4], int x, int y, void *data) override
void init_execution() override
VariableSizeBokehBlurOperation()
void deinit_execution() override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
static struct ImBuf * init_execution(const SeqRenderData *context, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *ibuf3)
ccl_global float * buffer
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_global KernelShaderEvalInput * input
ccl_device_inline float3 ceil(const float3 &a)
static void area(int d1, int d2, int e1, int e2, float weights[2])
constexpr int COM_DATA_TYPE_COLOR_CHANNELS
static void blur_pixel(PixelCursor &p)
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
constexpr float COM_BLUR_BOKEH_PIXELS
constexpr rcti COM_AREA_NONE
static bNodeSocketTemplate inputs[]
float multiplier_accum[4]
MemoryBuffer * bokeh_input
MemoryBuffer * size_input
MemoryBuffer * image_input