108 return this->m_num_channels;
117 return this->m_buffer;
139 x = (
x >= 0.0f ? (
x %
w) : (
x %
w) +
w);
155 y = (
y >= 0.0f ? (
y % h) : (
y % h) + h);
211 if (clip_x || clip_y) {
213 memset(
result, 0, this->m_num_channels *
sizeof(
float));
219 const int offset = (
getWidth() *
y +
x) * this->m_num_channels;
220 float *
buffer = &this->m_buffer[offset];
221 memcpy(
result,
buffer,
sizeof(
float) * this->m_num_channels);
235 const int offset = (
getWidth() *
v + u) * this->m_num_channels;
238 BLI_assert(offset < this->buffer_len() * this->m_num_channels);
241 float *
buffer = &this->m_buffer[offset];
242 memcpy(
result,
buffer,
sizeof(
float) * this->m_num_channels);
246 void addPixel(
int x,
int y,
const float color[4]);
265 this->m_num_channels,
272 void readEWA(
float *
result,
const float uv[2],
const float derivatives[2][2]);
324 const int buffer_len()
const
329 #ifdef WITH_CXX_GUARDEDALLOC
330 MEM_CXX_CLASS_ALLOC_FUNCS(
"COM:MemoryBuffer")
typedef float(TangentPoint)[2]
void BLI_bilinear_interpolation_wrap_fl(const float *buffer, float *output, int width, int height, int components, float u, float v, bool wrap_x, bool wrap_y)
void copy_vn_fl(float *array_tar, const int size, const float val)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
_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
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
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 writePixel(int x, int y, const float color[4])
bool isTemporarily() const
is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk)
void wrap_pixel(int &x, int &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
~MemoryBuffer()
destructor
void readNoCheck(float *result, int x, int y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip)
float get_max_value() const
const rcti & get_rect() const
get the rect of this MemoryBuffer
const int getHeight() const
get the height of this MemoryBuffer
uint8_t get_num_channels()
const int getWidth() const
get the width of this MemoryBuffer
MemoryBuffer(MemoryProxy *memoryProxy, const rcti &rect, MemoryBufferState state)
construct new temporarily MemoryBuffer for an area
void wrap_pixel(float &x, float &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
void fill_from(const MemoryBuffer &src)
add the content from otherBuffer to this MemoryBuffer
void readEWA(float *result, const float uv[2], const float derivatives[2][2])
void readBilinear(float *result, float x, float y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip)
float * getBuffer()
get the data of this MemoryBuffer
void clear()
clear the buffer. Make all pixels black transparent.
void addPixel(int x, int y, const float color[4])
A MemoryProxy is a unique identifier for a memory buffer. A single MemoryProxy is used among all chun...
MemoryBufferState
state of a memory buffer
@ Temporary
chunk is consolidated from other chunks. special state.
@ Default
memory has been allocated on creator device and CPU machine, but kernel has not been executed
DataType
possible data types for sockets
__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