29 unsigned char *rect,
float *rect_float,
int width,
int height,
const float color[4])
44 unsigned char ccol[4];
61 const int num_scanlines = 1;
62 size_t offset = ((size_t)scanline) *
data->width * 4;
69 unsigned char *rect,
float *rect_float,
int width,
int height,
const float color[4])
77 data.rect_float = rect_float;
90 int checkerwidth = 32;
93 unsigned char *rect_orig = rect;
94 float *rect_float_orig = rect_float;
96 float hsv[3] = {0.0f, 0.9f, 0.9f};
99 float dark_linear_color = 0.0f, bright_linear_color = 0.0f;
100 if (rect_float !=
NULL) {
110 if (
x % checkerwidth == 0) {
116 rect_float[0] = rect_float[1] = rect_float[2] = dark_linear_color;
117 rect_float[3] = 1.0f;
120 rect_float[0] = rect_float[1] = rect_float[2] = bright_linear_color;
121 rect_float[3] = 1.0f;
127 rect[0] = rect[1] = rect[2] = 64;
131 rect[0] = rect[1] = rect[2] = 150;
140 rect_float = rect_float_orig;
144 float hoffs = 0.125f *
floorf(
y / checkerwidth);
147 float h = 0.125f *
floorf(
x / checkerwidth);
149 if ((
abs((
x % checkerwidth) - (checkerwidth / 2)) < 4) &&
150 (
abs((
y % checkerwidth) - (checkerwidth / 2)) < 4)) {
151 if ((
abs((
x % checkerwidth) - (checkerwidth / 2)) < 1) ||
152 (
abs((
y % checkerwidth) - (checkerwidth / 2)) < 1)) {
157 rect[0] = (char)(
rgb[0] * 255.0f);
158 rect[1] = (char)(
rgb[1] * 255.0f);
159 rect[2] = (char)(
rgb[2] * 255.0f);
165 rect_float[3] = 1.0f;
189 size_t offset = ((size_t)scanline) *
data->width * 4;
190 const int num_scanlines = 1;
204 data.rect_float = rect_float;
212 #define BLEND_FLOAT(real, add) (real + add <= 1.0f) ? (real + add) : 1.0f
213 #define BLEND_CHAR(real, add) \
214 ((real + (char)(add * 255.0f)) <= 255) ? (real + (char)(add * 255.0f)) : 255
217 unsigned char *rect,
float *rect_float,
int width,
int height,
int offset,
int total_height)
220 float hsv[3],
rgb[3];
231 hsv[2] = 0.1 + (
y * (0.4 / total_height));
234 hsv[0] = (
float)((
double)(
x / hue_step) * 1.0 /
width * hue_step);
238 rect[0] = (char)(
rgb[0] * 255.0f);
239 rect[1] = (char)(
rgb[1] * 255.0f);
240 rect[2] = (char)(
rgb[2] * 255.0f);
247 rect_float[0] =
rgb[0];
248 rect_float[1] =
rgb[1];
249 rect_float[2] =
rgb[2];
250 rect_float[3] = 1.0f;
267 float blend_half =
blend * 0.5f;
271 if (((
y /
size) % 2 == 1 && (
x /
size) % 2 == 1) ||
272 ((
y /
size) % 2 == 0 && (
x /
size) % 2 == 0)) {
285 rect_float[3] = 1.0f;
292 rect[0] = (char)
BLEND_CHAR(rect[0], blend_half);
293 rect[1] = (char)
BLEND_CHAR(rect[1], blend_half);
294 rect[2] = (char)
BLEND_CHAR(rect[2], blend_half);
300 rect_float[0] =
BLEND_FLOAT(rect_float[0], blend_half);
301 rect_float[1] =
BLEND_FLOAT(rect_float[1], blend_half);
302 rect_float[2] =
BLEND_FLOAT(rect_float[2], blend_half);
303 rect_float[3] = 1.0f;
318 if (((
y % 32) == 0) || ((
x % 32) == 0) ||
x == 0) {
331 rect_float[3] = 1.0f;
351 unsigned char *rect,
float *rect_float,
int width,
int height,
int step,
int outline)
355 char text[3] = {
'A',
'1',
'\0'};
366 const float text_color[4] = {0.0, 0.0, 0.0, 1.0};
367 const float text_outline[4] = {1.0, 1.0, 1.0, 1.0};
369 const char char_array[36] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
371 int first_char_index = 0;
373 text[0] = char_array[first_char_index];
375 int second_char_index = 27;
377 text[1] = char_array[second_char_index];
395 BLF_position(mono, pen_x - outline, pen_y - outline, 0.0);
397 BLF_position(mono, pen_x + outline, pen_y + outline, 0.0);
399 BLF_position(mono, pen_x - outline, pen_y + outline, 0.0);
401 BLF_position(mono, pen_x + outline, pen_y - outline, 0.0);
408 second_char_index = (second_char_index + 1) %
ARRAY_SIZE(char_array);
410 first_char_index = (first_char_index + 1) %
ARRAY_SIZE(char_array);
418 unsigned char *rect,
float *rect_float,
int width,
int height,
int offset,
int total_height)
437 const int num_scanlines = 1;
438 size_t offset = ((size_t)
data->width) * scanline * 4;
442 rect, rect_float,
data->width, num_scanlines, scanline,
data->height);
456 data.rect_float = rect_float;
464 if (rect_float !=
NULL) {
typedef float(TangentPoint)[2]
void BLF_draw_buffer(int fontid, const char *str, size_t str_len) ATTR_NONNULL(2)
void BLF_buffer_col(int fontid, const float rgba[4]) ATTR_NONNULL(2)
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, struct ColorManagedDisplay *display)
void BLF_size(int fontid, float size, int dpi)
void BLF_position(int fontid, float x, float y, float z)
MINLINE int power_of_2_max_i(int n)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
MINLINE void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
float srgb_to_linearrgb(float c)
MINLINE void copy_v4_v4(float r[4], const float a[4])
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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 width
void IMB_processor_apply_threaded_scanlines(int total_scanlines, ScanlineThreadFunc do_thread, void *custom_data)
void IMB_buffer_float_from_float_threaded(float *rect_to, const float *rect_from, int channels_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
Contains defines and structs used throughout the imbuf module.
#define IB_PROFILE_LINEAR_RGB
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
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static void image_buf_fill_color_thread_do(void *data_v, int scanline)
static void image_buf_fill_checker_thread_do(void *data_v, int scanline)
static void checker_board_color_fill(unsigned char *rect, float *rect_float, int width, int height, int offset, int total_height)
static void image_buf_fill_checker_slice(unsigned char *rect, float *rect_float, int width, int height, int offset)
#define BLEND_FLOAT(real, add)
static void checker_board_grid_fill(unsigned char *rect, float *rect_float, int width, int height, float blend, int offset)
static void checker_board_text(unsigned char *rect, float *rect_float, int width, int height, int step, int outline)
struct FillCheckerThreadData FillCheckerThreadData
struct FillCheckerColorThreadData FillCheckerColorThreadData
struct FillColorThreadData FillColorThreadData
void BKE_image_buf_fill_checker_color(unsigned char *rect, float *rect_float, int width, int height)
static void checker_board_color_prepare_thread_do(void *data_v, int scanline)
void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int width, int height)
#define BLEND_CHAR(real, add)
static void checker_board_color_prepare_slice(unsigned char *rect, float *rect_float, int width, int height, int offset, int total_height)
static void image_buf_fill_color_slice(unsigned char *rect, float *rect_float, int width, int height, const float color[4])
static void checker_board_color_tint(unsigned char *rect, float *rect_float, int width, int height, int size, float blend, int offset)
void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width, int height, const float color[4])
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
static const pxr::TfToken rgb("rgb", pxr::TfToken::Immortal)
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)