24 yuv[0] = 0.299f *
rgb[0] + 0.587f *
rgb[1] + 0.114f *
rgb[2];
25 yuv[1] = 0.492f * (
rgb[2] - yuv[0]);
26 yuv[2] = 0.877f * (
rgb[0] - yuv[0]);
29 yuv[1] *= 255.0f / (122 * 2.0f);
32 yuv[2] *= 255.0f / (157 * 2.0f);
45 char newval = table[
pos[
col]];
52 if (last_pos > new_pos) {
53 uchar *temp = new_pos;
58 while (last_pos < new_pos) {
59 if (last_pos[0] == 0) {
60 last_pos[0] = last_pos[1] = last_pos[2] = 32;
69 if (last_pos > new_pos) {
70 uchar *temp = new_pos;
75 while (last_pos < new_pos) {
76 if (last_pos[
col] == 0) {
88 for (
x = 0;
x <
w;
x++) {
91 p[4 *
w + 1] = p[4 *
w + 3] = 155;
92 p = tgt + 4 * (
w * (h - 1) +
x);
94 p[-4 *
w + 1] = p[-4 *
w + 3] = 155;
97 for (
y = 0;
y < h;
y++) {
100 p[4 + 1] = p[4 + 3] = 155;
101 p = tgt + 4 * (
w *
y +
w - 1);
103 p[-4 + 1] = p[-4 + 3] = 155;
109 tgt += (int)(perc / 100.0f * h) *
w * 4;
111 for (
int i = 0; i <
w * 2; i++) {
133 float waveform_gamma = 0.2;
139 for (
x = 0;
x < 256;
x++) {
140 wtable[
x] = (
uchar)(
pow(((
float)
x + 1) / 256, waveform_gamma) * 255);
143 for (
y = 0;
y < ibuf->
y;
y++) {
146 for (
x = 0;
x < ibuf->
x;
x++) {
150 p += 4 * (
w * ((int)(
v * (h - 3)) + 1) +
x + 1);
156 if (last_p !=
NULL) {
174 float waveform_gamma = 0.2;
179 for (
x = 0;
x < 256;
x++) {
180 wtable[
x] = (
uchar)(
pow(((
float)
x + 1) / 256, waveform_gamma) * 255);
183 for (
y = 0;
y < ibuf->
y;
y++) {
186 for (
x = 0;
x < ibuf->
x;
x++) {
187 const float *
rgb =
src + 4 * (ibuf->
x *
y +
x);
193 p += 4 * (
w * ((int)(
v * (h - 3)) + 1) +
x + 1);
199 if (last_p !=
NULL) {
226 int sw = ibuf->
x / 3;
228 float waveform_gamma = 0.2;
233 for (
x = 0;
x < 256;
x++) {
234 wtable[
x] = (
uchar)(
pow(((
float)
x + 1) / 256, waveform_gamma) * 255);
237 for (
y = 0;
y < ibuf->
y;
y++) {
240 for (
x = 0;
x < ibuf->
x;
x++) {
243 for (
c = 0;
c < 3;
c++) {
245 p += 4 * (
w * ((
rgb[
c] * (h - 3)) / 255 + 1) +
c *
sw +
x / 3 + 1);
251 if (last_p[
c] !=
NULL) {
271 int sw = ibuf->
x / 3;
273 float waveform_gamma = 0.2;
278 for (
x = 0;
x < 256;
x++) {
279 wtable[
x] = (
uchar)(
pow(((
float)
x + 1) / 256, waveform_gamma) * 255);
282 for (
y = 0;
y < ibuf->
y;
y++) {
285 for (
x = 0;
x < ibuf->
x;
x++) {
287 const float *
rgb =
src + 4 * (ibuf->
x *
y +
x);
288 for (
c = 0;
c < 3;
c++) {
294 p += 4 * (
w * ((int)(
v * (h - 3)) + 1) +
c *
sw +
x / 3 + 1);
300 if (last_p[
c] !=
NULL) {
323 uint limit = 255.0f * perc / 100.0f;
329 for (
y = 0;
y < ibuf->
y;
y++) {
330 for (
x = 0;
x < ibuf->
x;
x++) {
336 if (
r >= limit ||
g >= limit ||
b >= limit) {
337 if (((
x +
y) & 0x08) != 0) {
353 float limit = perc / 100.0f;
354 const float *p =
src->rect_float;
359 for (
y = 0;
y < ibuf->
y;
y++) {
360 for (
x = 0;
x < ibuf->
x;
x++) {
366 if (
r >= limit ||
g >= limit ||
b >= limit) {
367 if (((
x +
y) & 0x08) != 0) {
398 int barh = ibuf->
y * 0.1;
400 p += 4 * (
x + ibuf->
x * (ibuf->
y - barh + 1));
402 for (
int i = 0; i < barh - 1; i++) {
403 p[0] = p[1] = p[2] = 255;
411 int barh = ibuf->
y * val * 0.9f;
413 p += 4 * (
x + ibuf->
x);
415 for (
int i = 0; i < barh; i++) {
421 #define HIS_STEPS 512
437 for (
int x = 0;
x < ibuf->
x;
x++) {
440 for (
int j = 3; j--;) {
441 cur_bins[j][pixel[j]]++;
447 void *__restrict chunk_join,
448 void *__restrict chunk)
453 for (
int j = 3; j--;) {
455 join_bins[j][i] += bins[j][i];
468 memset(bins, 0,
sizeof(bins));
483 if (bins[0][
x] > nr) {
486 if (bins[1][
x] > ng) {
489 if (bins[2][
x] > nb) {
523 return (
int)(((f + 0.25f) / 1.5f) * 512);
536 for (
int x = 0;
x < ibuf->
x;
x++) {
537 const float *pixel =
src + (
y * ibuf->
x +
x) * 4;
539 for (
int j = 3; j--;) {
553 memset(bins, 0,
sizeof(bins));
568 if (bins[0][
x] > nr) {
571 if (bins[1][
x] > ng) {
574 if (bins[2][
x] > nb) {
610 float rgb[3], yuv[3];
618 p = tgt + 4 * (
w * (int)((yuv[2] * (h - 3) + 1)) + (
int)((yuv[1] * (
w - 3) + 1)));
620 if (
r == 0 &&
g == 0 &&
b == 0) {
626 char *q = p + 4 * (
y *
w +
x);
639 const char *
src = (
const char *)ibuf->
rect;
640 char *tgt = (
char *)rval->
rect;
641 float rgb[3], yuv[3];
644 float scope_gamma = 0.2;
647 for (
x = 0;
x < 256;
x++) {
648 wtable[
x] = (
uchar)(
pow(((
float)
x + 1) / 256, scope_gamma) * 255);
651 for (
x = 0;
x < 256;
x++) {
660 for (
y = 0;
y < ibuf->
y;
y++) {
661 for (
x = 0;
x < ibuf->
x;
x++) {
662 const char *src1 =
src + 4 * (ibuf->
x *
y +
x);
670 p = tgt + 4 * (
w * (int)((yuv[2] * (h - 3) + 1)) + (
int)((yuv[1] * (
w - 3) + 1)));
685 char *tgt = (
char *)rval->
rect;
686 float rgb[3], yuv[3];
689 float scope_gamma = 0.2;
692 for (
x = 0;
x < 256;
x++) {
693 wtable[
x] = (
uchar)(
pow(((
float)
x + 1) / 256, scope_gamma) * 255);
696 for (
x = 0;
x <= 255;
x++) {
705 for (
y = 0;
y < ibuf->
y;
y++) {
706 for (
x = 0;
x < ibuf->
x;
x++) {
707 const float *src1 =
src + 4 * (ibuf->
x *
y +
x);
710 memcpy(
rgb, src1,
sizeof(
float[3]));
716 p = tgt + 4 * (
w * (int)((yuv[2] * (h - 3) + 1)) + (
int)((yuv[1] * (
w - 3) + 1)));
typedef float(TangentPoint)[2]
MINLINE void clamp_v3(float vec[3], float min, float max)
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
_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 GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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
BLI_INLINE unsigned char IMB_colormanagement_get_luminance_byte(const unsigned char[3])
BLI_INLINE float IMB_colormanagement_get_luminance(const float rgb[3])
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
Contains defines and structs used throughout the imbuf module.
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
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SyclQueue void void * src
ccl_gpu_kernel_postfix ccl_global float int int int sw
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
ccl_device_inline float3 pow(float3 v, float e)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static const pxr::TfToken rgb("rgb", pxr::TfToken::Immortal)
ImBuf * make_histogram_view_from_ibuf(ImBuf *ibuf)
static ImBuf * make_waveform_view_from_ibuf_float(ImBuf *ibuf)
static void draw_histogram_marker(ImBuf *ibuf, int x)
static void draw_histogram_bar(ImBuf *ibuf, int x, float val, int col)
static void make_histogram_view_from_ibuf_byte_fn(void *__restrict userdata, const int y, const TaskParallelTLS *__restrict tls)
ImBuf * make_zebra_view_from_ibuf(ImBuf *ibuf, float perc)
ImBuf * make_waveform_view_from_ibuf(ImBuf *ibuf)
static void wform_put_line_single(int w, uchar *last_pos, uchar *new_pos, int col)
static void wform_put_grid(uchar *tgt, int w, int h)
ImBuf * make_vectorscope_view_from_ibuf(ImBuf *ibuf)
static ImBuf * make_vectorscope_view_from_ibuf_byte(ImBuf *ibuf)
static ImBuf * make_sep_waveform_view_from_ibuf_float(ImBuf *ibuf)
static ImBuf * make_vectorscope_view_from_ibuf_float(ImBuf *ibuf)
static void wform_put_line(int w, uchar *last_pos, uchar *new_pos)
BLI_INLINE int get_bin_float(float f)
ImBuf * make_sep_waveform_view_from_ibuf(ImBuf *ibuf)
static ImBuf * make_sep_waveform_view_from_ibuf_byte(ImBuf *ibuf)
static ImBuf * make_histogram_view_from_ibuf_float(ImBuf *ibuf)
static void wform_put_border(uchar *tgt, int w, int h)
struct MakeHistogramViewData MakeHistogramViewData
static void scope_put_pixel(const uchar *table, uchar *pos)
static void wform_put_gridrow(uchar *tgt, float perc, int w, int h)
static void scope_put_pixel_single(const uchar *table, uchar *pos, int col)
static void vectorscope_put_cross(uchar r, uchar g, uchar b, char *tgt, int w, int h, int size)
static void draw_zebra_float(ImBuf *src, ImBuf *ibuf, float perc)
static ImBuf * make_histogram_view_from_ibuf_byte(ImBuf *ibuf)
static void make_histogram_view_from_ibuf_float_fn(void *__restrict userdata, const int y, const TaskParallelTLS *__restrict tls)
static void rgb_to_yuv_normalized(const float rgb[3], float yuv[3])
static ImBuf * make_waveform_view_from_ibuf_byte(ImBuf *ibuf)
static void make_histogram_view_from_ibuf_reduce(const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk)
static void draw_zebra_byte(ImBuf *src, ImBuf *ibuf, float perc)
TaskParallelReduceFunc func_reduce
size_t userdata_chunk_size