43 unsigned char *rect,
float *rect_float,
int width,
int height,
const float color[4])
58 unsigned char ccol[4];
75 size_t offset = ((size_t)start_scanline) *
data->width * 4;
77 float *rect_float = (
data->rect_float !=
NULL) ? (
data->rect_float + offset) :
NULL;
82 unsigned char *rect,
float *rect_float,
int width,
int height,
const float color[4])
90 data.rect_float = rect_float;
98 unsigned char *rect,
float *rect_float,
int width,
int height,
int offset)
103 int checkerwidth = 32, dark = 1;
106 unsigned char *rect_orig = rect;
107 float *rect_float_orig = rect_float;
109 float h = 0.0, hoffs = 0.0;
110 float hsv[3] = {0.0f, 0.9f, 0.9f};
113 float dark_linear_color = 0.0f, bright_linear_color = 0.0f;
114 if (rect_float !=
NULL) {
120 for (
y = offset;
y <
height + offset;
y++) {
124 if (
x % checkerwidth == 0) {
130 rect_float[0] = rect_float[1] = rect_float[2] = dark_linear_color;
131 rect_float[3] = 1.0f;
134 rect_float[0] = rect_float[1] = rect_float[2] = bright_linear_color;
135 rect_float[3] = 1.0f;
141 rect[0] = rect[1] = rect[2] = 64;
145 rect[0] = rect[1] = rect[2] = 150;
154 rect_float = rect_float_orig;
157 for (
y = offset;
y <
height + offset;
y++) {
158 hoffs = 0.125f *
floorf(
y / checkerwidth);
161 h = 0.125f *
floorf(
x / checkerwidth);
163 if ((
abs((
x % checkerwidth) - (checkerwidth / 2)) < 4) &&
164 (
abs((
y % checkerwidth) - (checkerwidth / 2)) < 4)) {
165 if ((
abs((
x % checkerwidth) - (checkerwidth / 2)) < 1) ||
166 (
abs((
y % checkerwidth) - (checkerwidth / 2)) < 1)) {
171 rect[0] = (char)(rgb[0] * 255.0f);
172 rect[1] = (char)(rgb[1] * 255.0f);
173 rect[2] = (char)(rgb[2] * 255.0f);
179 rect_float[3] = 1.0f;
203 size_t offset = ((size_t)start_scanline) *
data->width * 4;
205 float *rect_float = (
data->rect_float !=
NULL) ? (
data->rect_float + offset) :
NULL;
217 data.rect_float = rect_float;
225 #define BLEND_FLOAT(real, add) (real + add <= 1.0f) ? (real + add) : 1.0f
226 #define BLEND_CHAR(real, add) \
227 ((real + (char)(add * 255.0f)) <= 255) ? (real + (char)(add * 255.0f)) : 255
230 unsigned char *rect,
float *rect_float,
int width,
int height,
int offset,
int total_height)
233 float hsv[3], rgb[3];
242 for (
y = offset;
y <
height + offset;
y++) {
244 hsv[2] = 0.1 + (
y * (0.4 / total_height));
247 hsv[0] = (
float)((
double)(
x / hue_step) * 1.0 /
width * hue_step);
251 rect[0] = (char)(rgb[0] * 255.0f);
252 rect[1] = (char)(rgb[1] * 255.0f);
253 rect[2] = (char)(rgb[2] * 255.0f);
260 rect_float[0] = rgb[0];
261 rect_float[1] = rgb[1];
262 rect_float[2] = rgb[2];
263 rect_float[3] = 1.0f;
280 float blend_half =
blend * 0.5f;
282 for (
y = offset;
y <
height + offset;
y++) {
284 if (((
y /
size) % 2 == 1 && (
x /
size) % 2 == 1) ||
285 ((
y /
size) % 2 == 0 && (
x /
size) % 2 == 0)) {
298 rect_float[3] = 1.0f;
305 rect[0] = (char)
BLEND_CHAR(rect[0], blend_half);
306 rect[1] = (char)
BLEND_CHAR(rect[1], blend_half);
307 rect[2] = (char)
BLEND_CHAR(rect[2], blend_half);
313 rect_float[0] =
BLEND_FLOAT(rect_float[0], blend_half);
314 rect_float[1] =
BLEND_FLOAT(rect_float[1], blend_half);
315 rect_float[2] =
BLEND_FLOAT(rect_float[2], blend_half);
316 rect_float[3] = 1.0f;
326 unsigned char *rect,
float *rect_float,
int width,
int height,
float blend,
int offset)
329 for (
y = offset;
y <
height + offset;
y++) {
331 if (((
y % 32) == 0) || ((
x % 32) == 0) ||
x == 0) {
344 rect_float[3] = 1.0f;
364 unsigned char *rect,
float *rect_float,
int width,
int height,
int step,
int outline)
368 char text[3] = {
'A',
'1',
'\0'};
379 const float text_color[4] = {0.0, 0.0, 0.0, 1.0};
380 const float text_outline[4] = {1.0, 1.0, 1.0, 1.0};
382 const char char_array[36] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
384 int first_char_index = 0;
386 text[0] = char_array[first_char_index];
388 int second_char_index = 27;
390 text[1] = char_array[second_char_index];
408 BLF_position(mono, pen_x - outline, pen_y - outline, 0.0);
410 BLF_position(mono, pen_x + outline, pen_y + outline, 0.0);
412 BLF_position(mono, pen_x - outline, pen_y + outline, 0.0);
414 BLF_position(mono, pen_x + outline, pen_y - outline, 0.0);
421 second_char_index = (second_char_index + 1) %
ARRAY_SIZE(char_array);
423 first_char_index = (first_char_index + 1) %
ARRAY_SIZE(char_array);
431 unsigned char *rect,
float *rect_float,
int width,
int height,
int offset,
int total_height)
452 size_t offset = ((size_t)
data->width) * start_scanline * 4;
454 float *rect_float = (
data->rect_float !=
NULL) ? (
data->rect_float + offset) :
NULL;
456 rect, rect_float,
data->width, num_scanlines, start_scanline,
data->height);
470 data.rect_float = rect_float;
478 if (rect_float !=
NULL) {
typedef float(TangentPoint)[2]
void BLF_draw_buffer(int fontid, const char *str, size_t 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, int 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 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
_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
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
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static void image_buf_fill_checker_thread_do(void *data_v, int start_scanline, int num_scanlines)
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)
static void image_buf_fill_color_thread_do(void *data_v, int start_scanline, int num_scanlines)
#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)
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])
static void checker_board_color_prepare_thread_do(void *data_v, int start_scanline, int num_scanlines)
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
__forceinline const avxi abs(const avxi &a)