15 input_program_ =
nullptr;
23 const float zoom = data_->
zoom;
25 const float iterations = data_->
iter;
27 const float center_x = data_->
center_x;
28 const float center_y = data_->
center_y;
33 const float itsc = 1.0f /
powf(2.0f, (
float)iterations);
37 center_x_pix_ = center_x *
width;
38 center_y_pix_ = center_y *
height;
48 const int iterations =
pow(2.0f, data_->
iter);
49 float col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
50 float col2[4] = {0.0f, 0.0f, 0.0f, 0.0f};
57 for (
int i = 0; i < iterations; i++) {
58 const float cs =
cosf(lrot), ss =
sinf(lrot);
59 const float isc = 1.0f / (1.0f + lsc);
61 const float v = isc * (
y - center_y_pix_) + lty;
62 const float u = isc * (
x - center_x_pix_) + ltx;
65 cs * u + ss *
v + center_x_pix_,
66 cs *
v - ss * u + center_y_pix_,
83 cl_mem cl_output_buffer,
85 std::list<cl_mem> *cl_mem_to_clean_up,
86 std::list<cl_kernel> * )
91 cl_int iterations =
pow(2.0f, data_->
iter);
92 cl_float2 ltxy = {{tx_, ty_}};
93 cl_float2 centerpix = {{center_x_pix_, center_y_pix_}};
98 directional_blur_kernel, 0, -1, cl_mem_to_clean_up, input_memory_buffers, input_program_);
100 directional_blur_kernel, 1, cl_output_buffer);
102 directional_blur_kernel, 2, output_memory_buffer);
103 clSetKernelArg(directional_blur_kernel, 3,
sizeof(cl_int), &iterations);
104 clSetKernelArg(directional_blur_kernel, 4,
sizeof(cl_float), &lsc);
105 clSetKernelArg(directional_blur_kernel, 5,
sizeof(cl_float), &lrot);
106 clSetKernelArg(directional_blur_kernel, 6,
sizeof(cl_float2), <xy);
107 clSetKernelArg(directional_blur_kernel, 7,
sizeof(cl_float2), ¢erpix);
114 input_program_ =
nullptr;
144 const int iterations =
pow(2.0f, data_->
iter);
148 float color_accum[4];
149 input->read_elem_bilinear(
x,
y, color_accum);
158 for (
int i = 0; i < iterations; i++) {
159 const float cs =
cosf(lrot), ss =
sinf(lrot);
160 const float isc = 1.0f / (1.0f + lsc);
162 const float v = isc * (
y - center_y_pix_) + lty;
163 const float u = isc * (
x - center_x_pix_) + ltx;
166 input->read_elem_bilinear(
167 cs * u + ss *
v + center_x_pix_, cs *
v - ss * u + center_y_pix_,
color);
177 mul_v4_v4fl(it.out, color_accum, 1.0f / (iterations + 1));
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f)
#define UNUSED_VARS_NDEBUG(...)
_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
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
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void deinit_execution() override
void execute_pixel(float output[4], int x, int y, void *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...
DirectionalBlurOperation()
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void init_execution() 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.
a MemoryBuffer contains access to the data of a chunk
unsigned int get_height() const
void add_output_socket(DataType datatype)
SocketReader * get_input_socket_reader(unsigned int index)
unsigned int get_width() const
NodeOperationFlags flags_
const rcti & get_canvas() const
virtual bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output)
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
device representing an GPU OpenCL device. an instance of this class represents a single cl_device
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)
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
ccl_device_inline float3 pow(float3 v, float e)
static void area(int d1, int d2, int e1, int e2, float weights[2])
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
T distance(const T &a, const T &b)
static bNodeSocketTemplate inputs[]