14 input_program_ =
nullptr;
22 if (distance_ < 0.0f) {
23 scope_ = -distance_ + inset_;
26 if (inset_ * 2 > distance_) {
27 scope_ =
MAX2(inset_ * 2 - distance_, distance_);
52 const float sw = switch_;
55 const float rd = scope_ * scope_;
56 const float inset = inset_;
57 float mindist = rd * 2;
62 const int minx =
MAX2(
x - scope_, input_rect.
xmin);
63 const int miny =
MAX2(
y - scope_, input_rect.
ymin);
64 const int maxx =
MIN2(
x + scope_, input_rect.
xmax);
65 const int maxy =
MIN2(
y + scope_, input_rect.
ymax);
66 const int buffer_width = input_buffer->
get_width();
69 input_buffer->
read(input_value,
x,
y);
70 if (input_value[0] >
sw) {
71 for (
int yi = miny; yi < maxy; yi++) {
72 const float dy = yi -
y;
73 offset = ((yi - input_rect.
ymin) * buffer_width + (minx - input_rect.
xmin));
74 for (
int xi = minx; xi < maxx; xi++) {
76 const float dx = xi -
x;
77 const float dis = dx * dx + dy * dy;
78 mindist =
MIN2(mindist, dis);
83 pixelvalue = -
sqrtf(mindist);
86 for (
int yi = miny; yi < maxy; yi++) {
87 const float dy = yi -
y;
88 offset = ((yi - input_rect.
ymin) * buffer_width + (minx - input_rect.
xmin));
89 for (
int xi = minx; xi < maxx; xi++) {
91 const float dx = xi -
x;
92 const float dis = dx * dx + dy * dy;
93 mindist =
MIN2(mindist, dis);
98 pixelvalue =
sqrtf(mindist);
102 const float delta =
distance - pixelvalue;
104 if (delta >= inset) {
108 output[0] = delta / inset;
116 const float delta = -
distance + pixelvalue;
118 if (delta < -inset) {
122 output[0] = (-delta) / inset;
133 input_program_ =
nullptr;
150 const rcti &output_area,
155 r_input_area.
xmin = output_area.
xmin - scope_;
156 r_input_area.
xmax = output_area.
xmax + scope_;
157 r_input_area.
ymin = output_area.
ymin - scope_;
158 r_input_area.
ymax = output_area.
ymax + scope_;
176 template<
template<
typename>
typename TCompare>
182 const TCompare compare;
186 for (
int yi = p.
ymin; yi < p.
ymax; yi++) {
187 const float dy = yi - p.
y;
188 const float dist_y = dy * dy;
189 const float *elem = row;
190 for (
int xi = p.
xmin; xi < p.
xmax; xi++) {
191 if (compare(*elem, p.
sw)) {
192 const float dx = xi - p.
x;
193 const float dist = dx * dx + dist_y;
194 min_dist =
MIN2(min_dist, dist);
208 const rcti &input_rect =
input->get_rect();
209 const float rd = scope_ * scope_;
210 const float inset = inset_;
228 pixel_value = -
sqrtf(get_min_distance<std::less>(p));
231 pixel_value =
sqrtf(get_min_distance<std::greater>(p));
234 if (distance_ > 0.0f) {
235 const float delta = distance_ - pixel_value;
237 *it.out = delta >= inset ? 1.0f : delta / inset;
244 const float delta = -distance_ + pixel_value;
246 *it.out = delta < -inset ? 1.0f : (-delta) / inset;
296 const int buffer_width = input_buffer->
get_width();
301 for (
int yi = miny; yi < maxy; yi++) {
302 const float dy = yi -
y;
303 offset = ((yi - input_rect.
ymin) * buffer_width + (minx - input_rect.
xmin));
304 for (
int xi = minx; xi < maxx; xi++) {
305 const float dx = xi -
x;
306 const float dis = dx * dx + dy * dy;
307 if (dis <= mindist) {
336 cl_mem cl_output_buffer,
338 std::list<cl_mem> *cl_mem_to_clean_up,
339 std::list<cl_kernel> * )
347 dilate_kernel, 0, 2, cl_mem_to_clean_up, input_memory_buffers,
input_program_);
349 dilate_kernel, 1, cl_output_buffer);
351 dilate_kernel, 3, output_memory_buffer);
352 clSetKernelArg(dilate_kernel, 4,
sizeof(cl_int), &scope);
359 const rcti &output_area,
405 template<
template<
typename>
typename TCompare>
410 const TCompare compare;
412 float value = start_value;
415 for (
int yi = p.
ymin; yi < p.
ymax; yi++) {
416 const float dy = yi - p.
y;
417 const float dist_y = dy * dy;
418 const float *elem = row;
419 for (
int xi = p.
xmin; xi < p.
xmax; xi++) {
420 const float dx = xi - p.
x;
421 const float dist = dx * dx + dist_y;
422 if (dist <= min_dist) {
423 value = compare(*elem, value) ? *elem : value;
440 *it.out = get_distance_value<std::greater>(p, 0.0f);
461 const int buffer_width = input_buffer->
get_width();
466 for (
int yi = miny; yi < maxy; yi++) {
467 const float dy = yi -
y;
468 offset = ((yi - input_rect.
ymin) * buffer_width + (minx - input_rect.
xmin));
469 for (
int xi = minx; xi < maxx; xi++) {
470 const float dx = xi -
x;
471 const float dis = dx * dx + dy * dy;
472 if (dis <= mindist) {
483 cl_mem cl_output_buffer,
485 std::list<cl_mem> *cl_mem_to_clean_up,
486 std::list<cl_kernel> * )
494 erode_kernel, 0, 2, cl_mem_to_clean_up, input_memory_buffers,
input_program_);
496 erode_kernel, 1, cl_output_buffer);
498 erode_kernel, 3, output_memory_buffer);
499 clSetKernelArg(erode_kernel, 4,
sizeof(cl_int), &scope);
512 *it.out = get_distance_value<std::less>(p, 1.0f);
542 result->width = xmax - xmin;
544 "dilate erode cache");
557 int window = half_window * 2 + 1;
559 int xmin =
MAX2(0, rect->
xmin - half_window);
560 int ymin =
MAX2(0, rect->
ymin - half_window);
564 int bwidth = rect->
xmax - rect->
xmin;
565 int bheight = rect->
ymax - rect->
ymin;
571 float *rectf =
result->buffer;
576 float *temp = (
float *)
MEM_mallocN(
sizeof(
float) * (2 * window - 1),
"dilate erode temp");
577 float *buf = (
float *)
MEM_mallocN(
sizeof(
float) * (
MAX2(bwidth, bheight) + 5 * half_window),
582 for (
y = ymin;
y < ymax;
y++) {
583 for (
x = 0;
x < bwidth + 5 * half_window;
x++) {
586 for (
x = xmin;
x < xmax;
x++) {
590 for (i = 0; i < (bwidth + 3 * half_window) / window; i++) {
591 int start = (i + 1) * window - 1;
593 temp[window - 1] = buf[start];
594 for (
x = 1;
x < window;
x++) {
595 temp[window - 1 -
x] =
MAX2(temp[window -
x], buf[start -
x]);
596 temp[window - 1 +
x] =
MAX2(temp[window +
x - 2], buf[start +
x]);
599 start = half_window + (i - 1) * window + 1;
600 for (
x = -
MIN2(0, start);
x < window -
MAX2(0, start + window - bwidth);
x++) {
601 rectf[bwidth * (
y - ymin) + (start +
x)] =
MAX2(temp[
x], temp[
x + window - 1]);
607 for (
x = 0;
x < bwidth;
x++) {
608 for (
y = 0;
y < bheight + 5 * half_window;
y++) {
611 for (
y = ymin;
y < ymax;
y++) {
612 buf[
y - rect->
ymin + window - 1] = rectf[(
y - ymin) * bwidth +
x];
615 for (i = 0; i < (bheight + 3 * half_window) / window; i++) {
616 int start = (i + 1) * window - 1;
618 temp[window - 1] = buf[start];
619 for (
y = 1;
y < window;
y++) {
620 temp[window - 1 -
y] =
MAX2(temp[window -
y], buf[start -
y]);
621 temp[window - 1 +
y] =
MAX2(temp[window +
y - 2], buf[start +
y]);
624 start = half_window + (i - 1) * window + 1;
625 for (
y = -
MIN2(0, start);
y < window -
MAX2(0, start + window - bheight);
y++) {
626 rectf[bwidth * (
y + start + (rect->
ymin - ymin)) +
x] =
MAX2(temp[
y],
627 temp[
y + window - 1]);
641 int nx =
x -
tile->rect.xmin;
673 const rcti &output_area,
684 template<
typename TCompareSelector>
688 const int num_iterations,
689 const float compare_min_value)
691 TCompareSelector selector;
696 const int half_window = num_iterations;
697 const int window = half_window * 2 + 1;
699 const int xmin =
MAX2(0,
area.xmin - half_window);
700 const int ymin =
MAX2(0,
area.ymin - half_window);
704 const int bwidth =
area.xmax -
area.xmin;
705 const int bheight =
area.ymax -
area.ymin;
717 float *temp = (
float *)
MEM_mallocN(
sizeof(
float) * (2 * window - 1),
"dilate erode temp");
718 float *buf = (
float *)
MEM_mallocN(
sizeof(
float) * (
MAX2(bwidth, bheight) + 5 * half_window),
723 for (
int y = ymin;
y < ymax;
y++) {
724 for (
int x = 0;
x < bwidth + 5 * half_window;
x++) {
725 buf[
x] = compare_min_value;
727 for (
int x = xmin;
x < xmax;
x++) {
728 buf[
x -
area.xmin + window - 1] =
input->get_value(
x,
y, 0);
731 for (
int i = 0; i < (bwidth + 3 * half_window) / window; i++) {
732 int start = (i + 1) * window - 1;
734 temp[window - 1] = buf[start];
735 for (
int x = 1;
x < window;
x++) {
736 temp[window - 1 -
x] = selector(temp[window -
x], buf[start -
x]);
737 temp[window - 1 +
x] = selector(temp[window +
x - 2], buf[start +
x]);
740 start = half_window + (i - 1) * window + 1;
741 for (
int x = -
MIN2(0, start);
x < window -
MAX2(0, start + window - bwidth);
x++) {
742 result.get_value(start +
x +
area.xmin,
y, 0) = selector(temp[
x], temp[
x + window - 1]);
748 for (
int x = 0;
x < bwidth;
x++) {
749 for (
int y = 0;
y < bheight + 5 * half_window;
y++) {
750 buf[
y] = compare_min_value;
752 for (
int y = ymin;
y < ymax;
y++) {
756 for (
int i = 0; i < (bheight + 3 * half_window) / window; i++) {
757 int start = (i + 1) * window - 1;
759 temp[window - 1] = buf[start];
760 for (
int y = 1;
y < window;
y++) {
761 temp[window - 1 -
y] = selector(temp[window -
y], buf[start -
y]);
762 temp[window - 1 +
y] = selector(temp[window +
y - 2], buf[start +
y]);
765 start = half_window + (i - 1) * window + 1;
766 for (
int y = -
MIN2(0, start);
y < window -
MAX2(0, start + window - bheight);
y++) {
768 temp[
y + window - 1]);
807 int window = half_window * 2 + 1;
809 int xmin =
MAX2(0, rect->
xmin - half_window);
810 int ymin =
MAX2(0, rect->
ymin - half_window);
814 int bwidth = rect->
xmax - rect->
xmin;
815 int bheight = rect->
ymax - rect->
ymin;
821 float *rectf =
result->buffer;
826 float *temp = (
float *)
MEM_mallocN(
sizeof(
float) * (2 * window - 1),
"dilate erode temp");
827 float *buf = (
float *)
MEM_mallocN(
sizeof(
float) * (
MAX2(bwidth, bheight) + 5 * half_window),
832 for (
y = ymin;
y < ymax;
y++) {
833 for (
x = 0;
x < bwidth + 5 * half_window;
x++) {
836 for (
x = xmin;
x < xmax;
x++) {
840 for (i = 0; i < (bwidth + 3 * half_window) / window; i++) {
841 int start = (i + 1) * window - 1;
843 temp[window - 1] = buf[start];
844 for (
x = 1;
x < window;
x++) {
845 temp[window - 1 -
x] =
MIN2(temp[window -
x], buf[start -
x]);
846 temp[window - 1 +
x] =
MIN2(temp[window +
x - 2], buf[start +
x]);
849 start = half_window + (i - 1) * window + 1;
850 for (
x = -
MIN2(0, start);
x < window -
MAX2(0, start + window - bwidth);
x++) {
851 rectf[bwidth * (
y - ymin) + (start +
x)] =
MIN2(temp[
x], temp[
x + window - 1]);
857 for (
x = 0;
x < bwidth;
x++) {
858 for (
y = 0;
y < bheight + 5 * half_window;
y++) {
861 for (
y = ymin;
y < ymax;
y++) {
862 buf[
y - rect->
ymin + window - 1] = rectf[(
y - ymin) * bwidth +
x];
865 for (i = 0; i < (bheight + 3 * half_window) / window; i++) {
866 int start = (i + 1) * window - 1;
868 temp[window - 1] = buf[start];
869 for (
y = 1;
y < window;
y++) {
870 temp[window - 1 -
y] =
MIN2(temp[window -
y], buf[start -
y]);
871 temp[window - 1 +
y] =
MIN2(temp[window +
y - 2], buf[start +
y]);
874 start = half_window + (i - 1) * window + 1;
875 for (
y = -
MIN2(0, start);
y < window -
MAX2(0, start + window - bheight);
y++) {
876 rectf[bwidth * (
y + start + (rect->
ymin - ymin)) +
x] =
MIN2(temp[
y],
877 temp[
y + window - 1]);
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
#define UNUSED_VARS_NDEBUG(...)
_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 width
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) final
Get input operation area being read by this operation on rendering given output area.
void execute_pixel(float output[4], int x, int y, void *data) override
virtual void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
DilateDistanceOperation()
void init_data() override
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 init_execution() override
SocketReader * input_program_
void * initialize_tile_data(rcti *rect) override
void deinit_execution() override
void execute_pixel(float output[4], int x, int y, void *data) override
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void * initialize_tile_data(rcti *rect) override
void deinit_execution() override
DilateErodeThresholdOperation()
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 init_execution() override
void init_data() override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
SocketReader * input_program_
void deinit_execution() override
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void execute_pixel(float output[4], int x, int y, void *data) override
virtual void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) final
Get input operation area being read by this operation on rendering given output area.
void * initialize_tile_data(rcti *rect) override
void deinitialize_tile_data(rcti *rect, void *data) override
void init_execution() override
void execute_pixel(float output[4], int x, int y, void *data) override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
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 * initialize_tile_data(rcti *rect) override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
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)
const rcti & get_rect() const
get the rect of this MemoryBuffer
const int get_width() const
get the width of this MemoryBuffer
float * get_buffer()
get the data of this MemoryBuffer
void add_output_socket(DataType datatype)
SocketReader * get_input_socket_reader(unsigned int index)
NodeOperationFlags flags_
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)
ccl_global float * buffer
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_gpu_kernel_postfix ccl_global float int int int sw
ccl_global const KernelWorkTile * tile
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_global KernelShaderEvalInput * input
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static tile_info * create_cache(int xmin, int xmax, int ymin, int ymax)
static void step_update_memory_buffer(MemoryBuffer *output, const MemoryBuffer *input, const rcti &area, const int num_iterations, const float compare_min_value)
static float get_min_distance(DilateErodeThresholdOperation::PixelData &p)
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
static float get_distance_value(DilateDistanceOperation::PixelData &p, const float start_value)
T distance_squared(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
T distance(const T &a, const T &b)
static bNodeSocketTemplate inputs[]
PixelData(MemoryBuffer *input, const int distance, const int scope)
void update(BuffersIterator< float > &it)
float operator()(float f1, float f2) const
float operator()(float f1, float f2) const