28 this->m_memoryProxy = memoryProxy;
31 sizeof(
float) * buffer_len() * this->m_num_channels, 16,
"COM_MemoryBuffer");
32 this->m_state =
state;
39 this->m_memoryProxy =
nullptr;
42 sizeof(
float) * buffer_len() * this->m_num_channels, 16,
"COM_MemoryBuffer");
44 this->m_datatype = dataType;
50 memcpy(m_buffer, src.m_buffer, buffer_len() * m_num_channels *
sizeof(
float));
55 memset(m_buffer, 0, buffer_len() * m_num_channels *
sizeof(
float));
60 float result = this->m_buffer[0];
61 const unsigned int size = this->buffer_len();
64 const float *fp_src = this->m_buffer;
66 for (i = 0; i <
size; i++, fp_src += this->m_num_channels) {
67 float value = *fp_src;
97 this->m_buffer =
nullptr;
104 unsigned int minX =
MAX2(this->m_rect.
xmin, src.m_rect.
xmin);
105 unsigned int maxX =
MIN2(this->m_rect.
xmax, src.m_rect.
xmax);
106 unsigned int minY =
MAX2(this->m_rect.
ymin, src.m_rect.
ymin);
107 unsigned int maxY =
MIN2(this->m_rect.
ymax, src.m_rect.
ymax);
111 for (otherY = minY; otherY < maxY; otherY++) {
112 otherOffset = ((otherY - src.m_rect.
ymin) * src.
getWidth() + minX - src.m_rect.
xmin) *
113 this->m_num_channels;
114 offset = ((otherY - this->m_rect.
ymin) *
getWidth() + minX - this->m_rect.
xmin) *
115 this->m_num_channels;
116 memcpy(&this->m_buffer[offset],
117 &src.m_buffer[otherOffset],
118 (maxX - minX) * this->m_num_channels *
sizeof(
float));
124 if (
x >= this->m_rect.
xmin && x < this->m_rect.
xmax &&
y >= this->m_rect.ymin &&
125 y < this->m_rect.
ymax) {
127 this->m_num_channels;
128 memcpy(&this->m_buffer[offset], color,
sizeof(
float) * this->m_num_channels);
134 if (
x >= this->m_rect.
xmin && x < this->m_rect.
xmax &&
y >= this->m_rect.ymin &&
135 y < this->m_rect.
ymax) {
137 this->m_num_channels;
138 float *dst = &this->m_buffer[offset];
139 const float *src = color;
140 for (
int i = 0; i < this->m_num_channels; i++, dst++, src++) {
160 float uv_normal[2] = {uv[0] * inv_width, uv[1] * inv_height};
161 float du_normal[2] = {derivatives[0][0] * inv_width, derivatives[0][1] * inv_height};
162 float dv_normal[2] = {derivatives[1][0] * inv_width, derivatives[1][1] * inv_height};
typedef float(TangentPoint)[2]
void BLI_ewa_filter(const int width, const int height, const bool intpol, const bool use_alpha, const float uv[2], const float du[2], const float dv[2], ewa_filter_read_pixel_cb read_pixel_cb, void *userdata, float result[4])
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
bool BLI_rcti_is_empty(const struct rcti *rect)
_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.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
a MemoryBuffer contains access to the data of a chunk
void writePixel(int x, int y, const float color[4])
~MemoryBuffer()
destructor
float get_max_value() const
const int getHeight() const
get the height of this MemoryBuffer
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 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 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.
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
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN_aligned)(size_t len, size_t alignment, const char *str)
static void read_ewa_pixel_sampled(void *userdata, int x, int y, float result[4])
constexpr int COM_data_type_num_channels(const DataType datatype)