29 unsigned char rt, *cp = (
unsigned char *)ibuf->
rect;
62 const struct ImBuf *ibuf,
unsigned char **outI,
float **outF,
int x,
int y)
65 size_t offset = ((size_t)ibuf->
x) *
y * 4 + 4 *
x;
81 const struct ImBuf *in,
unsigned char outI[4],
float outF[4],
float u,
float v)
93 unsigned char *outI =
NULL;
113 const struct ImBuf *in,
unsigned char UNUSED(outI[4]),
float outF[4],
float u,
float v)
121 const struct ImBuf *in,
unsigned char outI[4],
float UNUSED(outF[4]),
float u,
float v)
129 const struct ImBuf *in,
unsigned char outI[4],
float outF[4],
float u,
float v)
143 const struct ImBuf *in,
unsigned char outI[4],
float outF[4],
float u,
float v)
145 float *row1, *row2, *row3, *row4,
a,
b;
146 unsigned char *row1I, *row2I, *row3I, *row4I;
147 float a_b, ma_b, a_mb, ma_mb;
158 if (x2 < 0 || x1 > in->
x - 1 || y2 < 0 || y1 > in->
y - 1) {
180 ma_b = (1.0f -
a) *
b;
181 a_mb =
a * (1.0f -
b);
182 ma_mb = (1.0f -
a) * (1.0f -
b);
187 row2 = in->
rect_float + ((size_t)in->
x) * y2 * 4 + 4 * x1;
191 outF[0] = ma_mb * row1[0] + a_mb * row3[0] + ma_b * row2[0] + a_b * row4[0];
192 outF[1] = ma_mb * row1[1] + a_mb * row3[1] + ma_b * row2[1] + a_b * row4[1];
193 outF[2] = ma_mb * row1[2] + a_mb * row3[2] + ma_b * row2[2] + a_b * row4[2];
194 outF[3] = ma_mb * row1[3] + a_mb * row3[3] + ma_b * row2[3] + a_b * row4[3];
201 row1I = (
unsigned char *)in->
rect + ((
size_t)in->
x) *
y1 * 4 + 4 * x1;
202 row2I = (
unsigned char *)in->
rect + ((
size_t)in->
x) * y2 * 4 + 4 * x1;
203 row3I = (
unsigned char *)in->
rect + ((
size_t)in->
x) *
y1 * 4 + 4 *
x2;
204 row4I = (
unsigned char *)in->
rect + ((
size_t)in->
x) * y2 * 4 + 4 *
x2;
207 outI[0] = roundf(ma_mb * row1I[0] + a_mb * row3I[0] + ma_b * row2I[0] + a_b * row4I[0]);
208 outI[1] = roundf(ma_mb * row1I[1] + a_mb * row3I[1] + ma_b * row2I[1] + a_b * row4I[1]);
209 outI[2] = roundf(ma_mb * row1I[2] + a_mb * row3I[2] + ma_b * row2I[2] + a_b * row4I[2]);
210 outI[3] = roundf(ma_mb * row1I[3] + a_mb * row3I[3] + ma_b * row2I[3] + a_b * row4I[3]);
216 unsigned char *outI =
NULL;
236 const struct ImBuf *in,
unsigned char outI[4],
float UNUSED(outF[4]),
float u,
float v)
245 if (x1 < 0 || x1 >= in->
x || y1 < 0 || y1 >= in->
y) {
246 outI[0] = outI[1] = outI[2] = outI[3] = 0;
250 const size_t offset = ((size_t)in->
x *
y1 + x1) * 4;
251 const unsigned char *dataI = (
unsigned char *)in->
rect +
offset;
259 const struct ImBuf *in,
unsigned char UNUSED(outI[4]),
float outF[4],
float u,
float v)
268 if (x1 < 0 || x1 >= in->
x || y1 < 0 || y1 >= in->
y) {
273 const size_t offset = ((size_t)in->
x *
y1 + x1) * 4;
279 const struct ImBuf *in,
unsigned char outI[4],
float outF[4],
float u,
float v)
290 const struct ImBuf *in,
unsigned char outI[4],
float outF[4],
float u,
float v)
293 unsigned char *dataI;
312 dataI = (
unsigned char *)in->
rect + ((
size_t)in->
x) *
y * 4 + 4 *
x;
330 unsigned char *outI =
NULL;
358 void *init_customdata,
359 void(init_handle)(
void *handle,
int start_line,
int tot_line,
void *customdata),
360 void *(do_thread)(
void *))
362 const int lines_per_task = 64;
367 int total_tasks = (buffer_lines + lines_per_task - 1) / lines_per_task;
376 for (i = 0; i < total_tasks; i++) {
377 int lines_per_current_task;
378 void *handle = ((
char *)
handles) + handle_size * i;
380 if (i < total_tasks - 1) {
381 lines_per_current_task = lines_per_task;
384 lines_per_current_task = buffer_lines - start_line;
387 init_handle(handle, start_line, lines_per_current_task, init_customdata);
391 start_line += lines_per_task;
412 data->do_thread(
data->custom_data, scanline);
421 .do_thread = do_thread,
422 .custom_data = custom_data,
437 size_t a = ((size_t)
x) *
y;
438 float *fp = rect_float;
441 const float mul = 1.0f - fp[3];
451 size_t a = ((size_t)
x) *
y;
452 unsigned char *cp = rect;
458 else if (cp[3] == 0) {
459 cp[0] = backcol[0] * 255;
460 cp[1] = backcol[1] * 255;
461 cp[2] = backcol[2] * 255;
464 float alpha = cp[3] / 255.0;
465 float mul = 1.0f - alpha;
467 cp[0] = (cp[0] * alpha) +
mul * backcol[0];
468 cp[1] = (cp[1] * alpha) +
mul * backcol[1];
469 cp[2] = (cp[2] * alpha) +
mul * backcol[2];
490 unsigned char byte_color[4];
493 if (make_linear_rgb) {
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void BLI_bilinear_interpolation_fl(const float *buffer, float *output, int width, int height, int components, float u, float v)
void BLI_bicubic_interpolation_fl(const float *buffer, float *output, int width, int height, int components, float u, float v)
void BLI_bicubic_interpolation_char(const unsigned char *buffer, unsigned char *output, int width, int height, int components, float u, float v)
void BLI_bilinear_interpolation_char(const unsigned char *buffer, unsigned char *output, int width, int height, int components, float u, float v)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void clamp_v4(float vec[4], float min, float max)
MINLINE void zero_v4(float r[4])
void * BLI_task_pool_user_data(TaskPool *pool)
void BLI_task_pool_work_and_wait(TaskPool *pool)
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
TaskPool * BLI_task_pool_create(void *userdata, eTaskPriority priority)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
void BLI_task_pool_free(TaskPool *pool)
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
_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 GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_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 GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], bool predivide, struct ColorSpace *colorspace)
void(* ScanlineThreadFunc)(void *custom_data, int scanline)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
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
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static void mul(btAlignedObjectArray< T > &items, const Q &value)
SyclQueue void void size_t num_bytes void
void nearest_interpolation(const ImBuf *in, ImBuf *out, float u, float v, int xout, int yout)
struct ScanlineGlobalData ScanlineGlobalData
static void processor_apply_parallel(void *__restrict userdata, const int scanline, const TaskParallelTLS *__restrict UNUSED(tls))
void bilinear_interpolation(const ImBuf *in, ImBuf *out, float u, float v, int xout, int yout)
void IMB_sampleImageAtLocation(ImBuf *ibuf, float x, float y, bool make_linear_rgb, float color[4])
static void processor_apply_func(TaskPool *__restrict pool, void *taskdata)
void IMB_processor_apply_threaded(int buffer_lines, int handle_size, void *init_customdata, void(init_handle)(void *handle, int start_line, int tot_line, void *customdata), void *(do_thread)(void *))
void bilinear_interpolation_color_char(const struct ImBuf *in, unsigned char outI[4], float UNUSED(outF[4]), float u, float v)
static void pixel_from_buffer(const struct ImBuf *ibuf, unsigned char **outI, float **outF, int x, int y)
void bicubic_interpolation(const ImBuf *in, ImBuf *out, float u, float v, int xout, int yout)
void IMB_processor_apply_threaded_scanlines(int total_scanlines, ScanlineThreadFunc do_thread, void *custom_data)
void bilinear_interpolation_color_fl(const struct ImBuf *in, unsigned char UNUSED(outI[4]), float outF[4], float u, float v)
void bicubic_interpolation_color(const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
void nearest_interpolation_color(const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
void nearest_interpolation_color_wrap(const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf)
void nearest_interpolation_color_fl(const struct ImBuf *in, unsigned char UNUSED(outI[4]), float outF[4], float u, float v)
void nearest_interpolation_color_char(const struct ImBuf *in, unsigned char outI[4], float UNUSED(outF[4]), float u, float v)
void bilinear_interpolation_color(const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[3])
void IMB_alpha_under_color_byte(unsigned char *rect, int x, int y, const float backcol[3])
void bilinear_interpolation_color_wrap(const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float3 ceil(const float3 &a)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
struct ColorSpace * rect_colorspace
ScanlineThreadFunc do_thread