59 int bufferWidth = inputBuffer->
getWidth();
60 int bufferHeight = inputBuffer->
getHeight();
62 float value =
buffer[(
y * bufferWidth +
x)];
65 int start_x =
max_ff(0,
x - delta + 1), start_y =
max_ff(0,
y - delta + 1),
66 end_x =
min_ff(
x + delta - 1, bufferWidth - 1),
67 end_y =
min_ff(
y + delta - 1, bufferHeight - 1);
69 int count = 0, totalCount = (end_x - start_x + 1) * (end_y - start_y + 1) - 1;
70 int thresholdCount =
ceil((
float)totalCount * 0.9f);
76 for (
int cx = start_x; ok ==
false && cx <= end_x; cx++) {
77 for (
int cy = start_y; ok ==
false && cy <= end_y; cy++) {
82 int bufferIndex = (cy * bufferWidth + cx);
83 float currentValue =
buffer[bufferIndex];
85 if (
fabsf(currentValue - value) < tolerance) {
87 if (
count >= thresholdCount) {
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
_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.
void * initializeTileData(rcti *rect) override
void executePixel(float output[4], int x, int y, void *data) override
calculate a single pixel
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
a MemoryBuffer contains access to the data of a chunk
const int getHeight() const
get the height 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 *)
void addInputSocket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
NodeOperation * getInputOperation(unsigned int inputSocketindex)
void addOutputSocket(DataType datatype)
virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
__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
ccl_device_inline float3 ceil(const float3 &a)