64 int x0 = (int)source[0];
65 int y0 = (int)source[1];
68 u =
x * fxu +
y * fyu;
69 v =
x * fxv +
y * fyv;
74 int x0 = (int)source[0];
75 int y0 = (int)source[1];
78 u =
x * fxu +
y * fyu;
79 v =
x * fxv +
y * fyv;
84 int x0 = (int)source[0];
85 int y0 = (int)source[1];
86 x = x0 + u * fxu +
v * fxv;
87 y = y0 + u * fyu +
v * fyv;
92 int x0 = (int)source[0];
93 int y0 = (int)source[1];
94 x = (
float)x0 + u * fxu +
v * fxv;
95 y = (
float)y0 + u * fyu +
v * fyv;
110 const float source[2],
119 float &falloff_factor)
125 float tan_phi = pv / pu;
126 float dr =
sqrtf(tan_phi * tan_phi + 1.0f);
127 float cos_phi = 1.0f / dr;
130 float umin =
max_ff(pu - cos_phi * dist_min, 0.0f);
131 float umax =
max_ff(pu - cos_phi * dist_max, 0.0f);
135 int start = (int)
floorf(umax);
136 int end = (int)
ceilf(umin);
141 falloff_factor = dist_max > dist_min ? dr / (
float)(dist_max - dist_min) : 0.0f;
157 const float source[2],
162 int buffer_width = input->
getWidth();
165 float falloff_factor;
170 if ((
int)(co[0] - source[0]) == 0 && (
int)(co[1] - source[1]) == 0) {
173 ((
int)source[0] + input->
getWidth() * (
int)source[1]));
179 input, source, co, dist_min, dist_max,
x,
y, num,
v, dv, falloff_factor);
186 for (
int i = 0; i < num; i++) {
187 float weight = 1.0f - (
float)i * falloff_factor;
191 if (
x >= rect.
xmin && x < rect.xmax && y >= rect.
ymin &&
y < rect.
ymax) {
217 if (v_local < 0.0f) {
244 const float source[2],
249 float pt_ofs[2] = {co[0] - source[0], co[1] - source[1]};
268 if (pt_ofs[0] > 0.0f) {
269 if (pt_ofs[1] > 0.0f) {
279 if (pt_ofs[1] > 0.0f) {
290 if (pt_ofs[0] > 0.0f) {
291 if (pt_ofs[1] > 0.0f) {
301 if (pt_ofs[1] > 0.0f) {
321 const float co[2] = {(
float)
x, (
float)
y};
329 float co[2] = {(
float)
x, (
float)
y};
338 int ico[2] = {(int)co[0], (
int)co[1]};
typedef float(TangentPoint)[2]
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE void mul_v4_fl(float r[4], float f)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void zero_v4(float r[4])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f)
MINLINE void zero_v3(float r[3])
MINLINE float normalize_v2(float r[2])
void BLI_rcti_do_minmax_v(struct rcti *rect, const int xy[2])
_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
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
a MemoryBuffer contains access to the data of a chunk
const rcti & get_rect() const
get the rect of this MemoryBuffer
const int getWidth() const
get the width of this MemoryBuffer
float * getBuffer()
get the data of this MemoryBuffer
virtual void * initializeTileData(rcti *)
unsigned int getHeight() const
void addInputSocket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
NodeOperation * getInputOperation(unsigned int inputSocketindex)
void addOutputSocket(DataType datatype)
unsigned int getWidth() const
void setResolutionInputSocketIndex(unsigned int index)
set the index of the input socket that will determine the resolution of this operation
virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
void initExecution() override
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
void * initializeTileData(rcti *rect) override
void executePixel(float output[4], int x, int y, void *data) override
calculate a single pixel
IconTextureDrawCall border
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
constexpr int COM_DATA_TYPE_COLOR_CHANNELS
static void calc_ray_shift(rcti *rect, float x, float y, const float source[2], float ray_length)
static void accumulate_line(MemoryBuffer *input, float output[4], const float co[2], const float source[2], float dist_min, float dist_max)
static void sector_to_buffer(const float source[2], int u, int v, int &x, int &y)
static void sector_to_buffer(const float source[2], float u, float v, float &x, float &y)
static void buffer_to_sector(const float source[2], float x, float y, float &u, float &v)
static void eval(MemoryBuffer *input, float output[4], const float co[2], const float source[2], float dist_min, float dist_max)
static float * init_buffer_iterator(MemoryBuffer *input, const float source[2], const float co[2], float dist_min, float dist_max, int &x, int &y, int &num, float &v, float &dv, float &falloff_factor)
static void buffer_to_sector(const float source[2], int x, int y, int &u, int &v)