Blender  V2.93
sequencer_scopes.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Author: Peter Schlaile < peter [at] schlaile [dot] de >
17  */
18 
23 #include <math.h>
24 #include <string.h>
25 
26 #include "BLI_task.h"
27 #include "BLI_utildefines.h"
28 
29 #include "IMB_colormanagement.h"
30 #include "IMB_imbuf.h"
31 #include "IMB_imbuf_types.h"
32 
33 #include "sequencer_intern.h"
34 
35 /* XXX, why is this function better than BLI_math version?
36  * only difference is it does some normalize after, need to double check on this - campbell */
37 static void rgb_to_yuv_normalized(const float rgb[3], float yuv[3])
38 {
39  yuv[0] = 0.299f * rgb[0] + 0.587f * rgb[1] + 0.114f * rgb[2];
40  yuv[1] = 0.492f * (rgb[2] - yuv[0]);
41  yuv[2] = 0.877f * (rgb[0] - yuv[0]);
42 
43  /* Normalize. */
44  yuv[1] *= 255.0f / (122 * 2.0f);
45  yuv[1] += 0.5f;
46 
47  yuv[2] *= 255.0f / (157 * 2.0f);
48  yuv[2] += 0.5f;
49 }
50 
51 static void scope_put_pixel(const uchar *table, uchar *pos)
52 {
53  uchar newval = table[*pos];
54  pos[0] = pos[1] = pos[2] = newval;
55  pos[3] = 255;
56 }
57 
58 static void scope_put_pixel_single(const uchar *table, uchar *pos, int col)
59 {
60  char newval = table[pos[col]];
61  pos[col] = newval;
62  pos[3] = 255;
63 }
64 
65 static void wform_put_line(int w, uchar *last_pos, uchar *new_pos)
66 {
67  if (last_pos > new_pos) {
68  uchar *temp = new_pos;
69  new_pos = last_pos;
70  last_pos = temp;
71  }
72 
73  while (last_pos < new_pos) {
74  if (last_pos[0] == 0) {
75  last_pos[0] = last_pos[1] = last_pos[2] = 32;
76  last_pos[3] = 255;
77  }
78  last_pos += 4 * w;
79  }
80 }
81 
82 static void wform_put_line_single(int w, uchar *last_pos, uchar *new_pos, int col)
83 {
84  if (last_pos > new_pos) {
85  uchar *temp = new_pos;
86  new_pos = last_pos;
87  last_pos = temp;
88  }
89 
90  while (last_pos < new_pos) {
91  if (last_pos[col] == 0) {
92  last_pos[col] = 32;
93  last_pos[3] = 255;
94  }
95  last_pos += 4 * w;
96  }
97 }
98 
99 static void wform_put_border(uchar *tgt, int w, int h)
100 {
101  int x, y;
102 
103  for (x = 0; x < w; x++) {
104  uchar *p = tgt + 4 * x;
105  p[1] = p[3] = 155;
106  p[4 * w + 1] = p[4 * w + 3] = 155;
107  p = tgt + 4 * (w * (h - 1) + x);
108  p[1] = p[3] = 155;
109  p[-4 * w + 1] = p[-4 * w + 3] = 155;
110  }
111 
112  for (y = 0; y < h; y++) {
113  uchar *p = tgt + 4 * w * y;
114  p[1] = p[3] = 155;
115  p[4 + 1] = p[4 + 3] = 155;
116  p = tgt + 4 * (w * y + w - 1);
117  p[1] = p[3] = 155;
118  p[-4 + 1] = p[-4 + 3] = 155;
119  }
120 }
121 
122 static void wform_put_gridrow(uchar *tgt, float perc, int w, int h)
123 {
124  tgt += (int)(perc / 100.0f * h) * w * 4;
125 
126  for (int i = 0; i < w * 2; i++) {
127  tgt[0] = 255;
128 
129  tgt += 4;
130  }
131 }
132 
133 static void wform_put_grid(uchar *tgt, int w, int h)
134 {
135  wform_put_gridrow(tgt, 90.0, w, h);
136  wform_put_gridrow(tgt, 70.0, w, h);
137  wform_put_gridrow(tgt, 10.0, w, h);
138 }
139 
141 {
142  ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
143  int x, y;
144  const uchar *src = (uchar *)ibuf->rect;
145  uchar *tgt = (uchar *)rval->rect;
146  int w = ibuf->x + 3;
147  int h = 515;
148  float waveform_gamma = 0.2;
149  uchar wtable[256];
150 
151  wform_put_grid(tgt, w, h);
152  wform_put_border(tgt, w, h);
153 
154  for (x = 0; x < 256; x++) {
155  wtable[x] = (uchar)(pow(((float)x + 1) / 256, waveform_gamma) * 255);
156  }
157 
158  for (y = 0; y < ibuf->y; y++) {
159  uchar *last_p = NULL;
160 
161  for (x = 0; x < ibuf->x; x++) {
162  const uchar *rgb = src + 4 * (ibuf->x * y + x);
163  float v = (float)IMB_colormanagement_get_luminance_byte(rgb) / 255.0f;
164  uchar *p = tgt;
165  p += 4 * (w * ((int)(v * (h - 3)) + 1) + x + 1);
166 
167  scope_put_pixel(wtable, p);
168  p += 4 * w;
169  scope_put_pixel(wtable, p);
170 
171  if (last_p != NULL) {
172  wform_put_line(w, last_p, p);
173  }
174  last_p = p;
175  }
176  }
177 
178  return rval;
179 }
180 
182 {
183  ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
184  int x, y;
185  const float *src = ibuf->rect_float;
186  uchar *tgt = (uchar *)rval->rect;
187  int w = ibuf->x + 3;
188  int h = 515;
189  float waveform_gamma = 0.2;
190  uchar wtable[256];
191 
192  wform_put_grid(tgt, w, h);
193 
194  for (x = 0; x < 256; x++) {
195  wtable[x] = (uchar)(pow(((float)x + 1) / 256, waveform_gamma) * 255);
196  }
197 
198  for (y = 0; y < ibuf->y; y++) {
199  uchar *last_p = NULL;
200 
201  for (x = 0; x < ibuf->x; x++) {
202  const float *rgb = src + 4 * (ibuf->x * y + x);
204  uchar *p = tgt;
205 
206  CLAMP(v, 0.0f, 1.0f);
207 
208  p += 4 * (w * ((int)(v * (h - 3)) + 1) + x + 1);
209 
210  scope_put_pixel(wtable, p);
211  p += 4 * w;
212  scope_put_pixel(wtable, p);
213 
214  if (last_p != NULL) {
215  wform_put_line(w, last_p, p);
216  }
217  last_p = p;
218  }
219  }
220 
221  wform_put_border(tgt, w, h);
222 
223  return rval;
224 }
225 
227 {
228  if (ibuf->rect_float) {
230  }
232 }
233 
235 {
236  ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
237  int x, y;
238  const uchar *src = (const uchar *)ibuf->rect;
239  uchar *tgt = (uchar *)rval->rect;
240  int w = ibuf->x + 3;
241  int sw = ibuf->x / 3;
242  int h = 515;
243  float waveform_gamma = 0.2;
244  uchar wtable[256];
245 
246  wform_put_grid(tgt, w, h);
247 
248  for (x = 0; x < 256; x++) {
249  wtable[x] = (uchar)(pow(((float)x + 1) / 256, waveform_gamma) * 255);
250  }
251 
252  for (y = 0; y < ibuf->y; y++) {
253  uchar *last_p[3] = {NULL, NULL, NULL};
254 
255  for (x = 0; x < ibuf->x; x++) {
256  int c;
257  const uchar *rgb = src + 4 * (ibuf->x * y + x);
258  for (c = 0; c < 3; c++) {
259  uchar *p = tgt;
260  p += 4 * (w * ((rgb[c] * (h - 3)) / 255 + 1) + c * sw + x / 3 + 1);
261 
262  scope_put_pixel_single(wtable, p, c);
263  p += 4 * w;
264  scope_put_pixel_single(wtable, p, c);
265 
266  if (last_p[c] != NULL) {
267  wform_put_line_single(w, last_p[c], p, c);
268  }
269  last_p[c] = p;
270  }
271  }
272  }
273 
274  wform_put_border(tgt, w, h);
275 
276  return rval;
277 }
278 
280 {
281  ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
282  int x, y;
283  const float *src = ibuf->rect_float;
284  uchar *tgt = (uchar *)rval->rect;
285  int w = ibuf->x + 3;
286  int sw = ibuf->x / 3;
287  int h = 515;
288  float waveform_gamma = 0.2;
289  uchar wtable[256];
290 
291  wform_put_grid(tgt, w, h);
292 
293  for (x = 0; x < 256; x++) {
294  wtable[x] = (uchar)(pow(((float)x + 1) / 256, waveform_gamma) * 255);
295  }
296 
297  for (y = 0; y < ibuf->y; y++) {
298  uchar *last_p[3] = {NULL, NULL, NULL};
299 
300  for (x = 0; x < ibuf->x; x++) {
301  int c;
302  const float *rgb = src + 4 * (ibuf->x * y + x);
303  for (c = 0; c < 3; c++) {
304  uchar *p = tgt;
305  float v = rgb[c];
306 
307  CLAMP(v, 0.0f, 1.0f);
308 
309  p += 4 * (w * ((int)(v * (h - 3)) + 1) + c * sw + x / 3 + 1);
310 
311  scope_put_pixel_single(wtable, p, c);
312  p += 4 * w;
313  scope_put_pixel_single(wtable, p, c);
314 
315  if (last_p[c] != NULL) {
316  wform_put_line_single(w, last_p[c], p, c);
317  }
318  last_p[c] = p;
319  }
320  }
321  }
322 
323  wform_put_border(tgt, w, h);
324 
325  return rval;
326 }
327 
329 {
330  if (ibuf->rect_float) {
332  }
334 }
335 
336 static void draw_zebra_byte(ImBuf *src, ImBuf *ibuf, float perc)
337 {
338  uint limit = 255.0f * perc / 100.0f;
339  uchar *p = (uchar *)src->rect;
340  uchar *o = (uchar *)ibuf->rect;
341  int x;
342  int y;
343 
344  for (y = 0; y < ibuf->y; y++) {
345  for (x = 0; x < ibuf->x; x++) {
346  uchar r = *p++;
347  uchar g = *p++;
348  uchar b = *p++;
349  uchar a = *p++;
350 
351  if (r >= limit || g >= limit || b >= limit) {
352  if (((x + y) & 0x08) != 0) {
353  r = 255 - r;
354  g = 255 - g;
355  b = 255 - b;
356  }
357  }
358  *o++ = r;
359  *o++ = g;
360  *o++ = b;
361  *o++ = a;
362  }
363  }
364 }
365 
366 static void draw_zebra_float(ImBuf *src, ImBuf *ibuf, float perc)
367 {
368  float limit = perc / 100.0f;
369  const float *p = src->rect_float;
370  uchar *o = (uchar *)ibuf->rect;
371  int x;
372  int y;
373 
374  for (y = 0; y < ibuf->y; y++) {
375  for (x = 0; x < ibuf->x; x++) {
376  float r = *p++;
377  float g = *p++;
378  float b = *p++;
379  float a = *p++;
380 
381  if (r >= limit || g >= limit || b >= limit) {
382  if (((x + y) & 0x08) != 0) {
383  r = -r;
384  g = -g;
385  b = -b;
386  }
387  }
388 
390  *o++ = unit_float_to_uchar_clamp(g);
391  *o++ = unit_float_to_uchar_clamp(b);
393  }
394  }
395 }
396 
398 {
399  ImBuf *new_ibuf = IMB_allocImBuf(ibuf->x, ibuf->y, 32, IB_rect);
400 
401  if (ibuf->rect_float) {
402  draw_zebra_float(ibuf, new_ibuf, perc);
403  }
404  else {
405  draw_zebra_byte(ibuf, new_ibuf, perc);
406  }
407  return new_ibuf;
408 }
409 
410 static void draw_histogram_marker(ImBuf *ibuf, int x)
411 {
412  uchar *p = (uchar *)ibuf->rect;
413  int barh = ibuf->y * 0.1;
414 
415  p += 4 * (x + ibuf->x * (ibuf->y - barh + 1));
416 
417  for (int i = 0; i < barh - 1; i++) {
418  p[0] = p[1] = p[2] = 255;
419  p += ibuf->x * 4;
420  }
421 }
422 
423 static void draw_histogram_bar(ImBuf *ibuf, int x, float val, int col)
424 {
425  uchar *p = (uchar *)ibuf->rect;
426  int barh = ibuf->y * val * 0.9f;
427 
428  p += 4 * (x + ibuf->x);
429 
430  for (int i = 0; i < barh; i++) {
431  p[col] = 255;
432  p += ibuf->x * 4;
433  }
434 }
435 
436 #define HIS_STEPS 512
437 
438 typedef struct MakeHistogramViewData {
439  const ImBuf *ibuf;
441 
442 static void make_histogram_view_from_ibuf_byte_fn(void *__restrict userdata,
443  const int y,
444  const TaskParallelTLS *__restrict tls)
445 {
446  MakeHistogramViewData *data = userdata;
447  const ImBuf *ibuf = data->ibuf;
448  const uchar *src = (uchar *)ibuf->rect;
449 
450  uint32_t(*cur_bins)[HIS_STEPS] = tls->userdata_chunk;
451 
452  for (int x = 0; x < ibuf->x; x++) {
453  const uchar *pixel = src + (y * ibuf->x + x) * 4;
454 
455  for (int j = 3; j--;) {
456  cur_bins[j][pixel[j]]++;
457  }
458  }
459 }
460 
461 static void make_histogram_view_from_ibuf_reduce(const void *__restrict UNUSED(userdata),
462  void *__restrict chunk_join,
463  void *__restrict chunk)
464 {
465  uint32_t(*join_bins)[HIS_STEPS] = chunk_join;
466  uint32_t(*bins)[HIS_STEPS] = chunk;
467 
468  for (int j = 3; j--;) {
469  for (int i = 0; i < HIS_STEPS; i++) {
470  join_bins[j][i] += bins[j][i];
471  }
472  }
473 }
474 
476 {
477  ImBuf *rval = IMB_allocImBuf(515, 128, 32, IB_rect);
478  int x;
479  uint nr, ng, nb;
480 
481  uint bins[3][HIS_STEPS];
482 
483  memset(bins, 0, sizeof(bins));
484 
486  .ibuf = ibuf,
487  };
488  TaskParallelSettings settings;
490  settings.use_threading = (ibuf->y >= 256);
491  settings.userdata_chunk = bins;
492  settings.userdata_chunk_size = sizeof(bins);
495 
496  nr = nb = ng = 0;
497  for (x = 0; x < HIS_STEPS; x++) {
498  if (bins[0][x] > nr) {
499  nr = bins[0][x];
500  }
501  if (bins[1][x] > ng) {
502  ng = bins[1][x];
503  }
504  if (bins[2][x] > nb) {
505  nb = bins[2][x];
506  }
507  }
508 
509  for (x = 0; x < HIS_STEPS; x++) {
510  if (nr) {
511  draw_histogram_bar(rval, x * 2 + 1, ((float)bins[0][x]) / nr, 0);
512  draw_histogram_bar(rval, x * 2 + 2, ((float)bins[0][x]) / nr, 0);
513  }
514  if (ng) {
515  draw_histogram_bar(rval, x * 2 + 1, ((float)bins[1][x]) / ng, 1);
516  draw_histogram_bar(rval, x * 2 + 2, ((float)bins[1][x]) / ng, 1);
517  }
518  if (nb) {
519  draw_histogram_bar(rval, x * 2 + 1, ((float)bins[2][x]) / nb, 2);
520  draw_histogram_bar(rval, x * 2 + 2, ((float)bins[2][x]) / nb, 2);
521  }
522  }
523 
524  wform_put_border((uchar *)rval->rect, rval->x, rval->y);
525 
526  return rval;
527 }
528 
530 {
531  if (f < -0.25f) {
532  return 0;
533  }
534  if (f >= 1.25f) {
535  return 511;
536  }
537 
538  return (int)(((f + 0.25f) / 1.5f) * 512);
539 }
540 
541 static void make_histogram_view_from_ibuf_float_fn(void *__restrict userdata,
542  const int y,
543  const TaskParallelTLS *__restrict tls)
544 {
545  const MakeHistogramViewData *data = userdata;
546  const ImBuf *ibuf = data->ibuf;
547  const float *src = ibuf->rect_float;
548 
549  uint32_t(*cur_bins)[HIS_STEPS] = tls->userdata_chunk;
550 
551  for (int x = 0; x < ibuf->x; x++) {
552  const float *pixel = src + (y * ibuf->x + x) * 4;
553 
554  for (int j = 3; j--;) {
555  cur_bins[j][get_bin_float(pixel[j])]++;
556  }
557  }
558 }
559 
561 {
562  ImBuf *rval = IMB_allocImBuf(515, 128, 32, IB_rect);
563  int nr, ng, nb;
564  int x;
565 
566  uint bins[3][HIS_STEPS];
567 
568  memset(bins, 0, sizeof(bins));
569 
571  .ibuf = ibuf,
572  };
573  TaskParallelSettings settings;
575  settings.use_threading = (ibuf->y >= 256);
576  settings.userdata_chunk = bins;
577  settings.userdata_chunk_size = sizeof(bins);
580 
581  nr = nb = ng = 0;
582  for (x = 0; x < HIS_STEPS; x++) {
583  if (bins[0][x] > nr) {
584  nr = bins[0][x];
585  }
586  if (bins[1][x] > ng) {
587  ng = bins[1][x];
588  }
589  if (bins[2][x] > nb) {
590  nb = bins[2][x];
591  }
592  }
593 
594  for (x = 0; x < HIS_STEPS; x++) {
595  if (nr) {
596  draw_histogram_bar(rval, x + 1, ((float)bins[0][x]) / nr, 0);
597  }
598  if (ng) {
599  draw_histogram_bar(rval, x + 1, ((float)bins[1][x]) / ng, 1);
600  }
601  if (nb) {
602  draw_histogram_bar(rval, x + 1, ((float)bins[2][x]) / nb, 2);
603  }
604  }
605 
608  wform_put_border((uchar *)rval->rect, rval->x, rval->y);
609 
610  return rval;
611 }
612 
613 #undef HIS_STEPS
614 
616 {
617  if (ibuf->rect_float) {
619  }
621 }
622 
623 static void vectorscope_put_cross(uchar r, uchar g, uchar b, char *tgt, int w, int h, int size)
624 {
625  float rgb[3], yuv[3];
626  char *p;
627  int x = 0;
628  int y = 0;
629 
630  rgb[0] = (float)r / 255.0f;
631  rgb[1] = (float)g / 255.0f;
632  rgb[2] = (float)b / 255.0f;
633  rgb_to_yuv_normalized(rgb, yuv);
634 
635  p = tgt + 4 * (w * (int)((yuv[2] * (h - 3) + 1)) + (int)((yuv[1] * (w - 3) + 1)));
636 
637  if (r == 0 && g == 0 && b == 0) {
638  r = 255;
639  }
640 
641  for (y = -size; y <= size; y++) {
642  for (x = -size; x <= size; x++) {
643  char *q = p + 4 * (y * w + x);
644  q[0] = r;
645  q[1] = g;
646  q[2] = b;
647  q[3] = 255;
648  }
649  }
650 }
651 
653 {
654  ImBuf *rval = IMB_allocImBuf(515, 515, 32, IB_rect);
655  int x, y;
656  const char *src = (const char *)ibuf->rect;
657  char *tgt = (char *)rval->rect;
658  float rgb[3], yuv[3];
659  int w = 515;
660  int h = 515;
661  float scope_gamma = 0.2;
662  uchar wtable[256];
663 
664  for (x = 0; x < 256; x++) {
665  wtable[x] = (uchar)(pow(((float)x + 1) / 256, scope_gamma) * 255);
666  }
667 
668  for (x = 0; x < 256; x++) {
669  vectorscope_put_cross(255, 0, 255 - x, tgt, w, h, 1);
670  vectorscope_put_cross(255, x, 0, tgt, w, h, 1);
671  vectorscope_put_cross(255 - x, 255, 0, tgt, w, h, 1);
672  vectorscope_put_cross(0, 255, x, tgt, w, h, 1);
673  vectorscope_put_cross(0, 255 - x, 255, tgt, w, h, 1);
674  vectorscope_put_cross(x, 0, 255, tgt, w, h, 1);
675  }
676 
677  for (y = 0; y < ibuf->y; y++) {
678  for (x = 0; x < ibuf->x; x++) {
679  const char *src1 = src + 4 * (ibuf->x * y + x);
680  char *p;
681 
682  rgb[0] = (float)src1[0] / 255.0f;
683  rgb[1] = (float)src1[1] / 255.0f;
684  rgb[2] = (float)src1[2] / 255.0f;
685  rgb_to_yuv_normalized(rgb, yuv);
686 
687  p = tgt + 4 * (w * (int)((yuv[2] * (h - 3) + 1)) + (int)((yuv[1] * (w - 3) + 1)));
688  scope_put_pixel(wtable, (uchar *)p);
689  }
690  }
691 
692  vectorscope_put_cross(0, 0, 0, tgt, w, h, 3);
693 
694  return rval;
695 }
696 
698 {
699  ImBuf *rval = IMB_allocImBuf(515, 515, 32, IB_rect);
700  int x, y;
701  const float *src = ibuf->rect_float;
702  char *tgt = (char *)rval->rect;
703  float rgb[3], yuv[3];
704  int w = 515;
705  int h = 515;
706  float scope_gamma = 0.2;
707  uchar wtable[256];
708 
709  for (x = 0; x < 256; x++) {
710  wtable[x] = (uchar)(pow(((float)x + 1) / 256, scope_gamma) * 255);
711  }
712 
713  for (x = 0; x <= 255; x++) {
714  vectorscope_put_cross(255, 0, 255 - x, tgt, w, h, 1);
715  vectorscope_put_cross(255, x, 0, tgt, w, h, 1);
716  vectorscope_put_cross(255 - x, 255, 0, tgt, w, h, 1);
717  vectorscope_put_cross(0, 255, x, tgt, w, h, 1);
718  vectorscope_put_cross(0, 255 - x, 255, tgt, w, h, 1);
719  vectorscope_put_cross(x, 0, 255, tgt, w, h, 1);
720  }
721 
722  for (y = 0; y < ibuf->y; y++) {
723  for (x = 0; x < ibuf->x; x++) {
724  const float *src1 = src + 4 * (ibuf->x * y + x);
725  const char *p;
726 
727  memcpy(rgb, src1, sizeof(float[3]));
728 
729  clamp_v3(rgb, 0.0f, 1.0f);
730 
731  rgb_to_yuv_normalized(rgb, yuv);
732 
733  p = tgt + 4 * (w * (int)((yuv[2] * (h - 3) + 1)) + (int)((yuv[1] * (w - 3) + 1)));
734  scope_put_pixel(wtable, (uchar *)p);
735  }
736  }
737 
738  vectorscope_put_cross(0, 0, 0, tgt, w, h, 3);
739 
740  return rval;
741 }
742 
744 {
745  if (ibuf->rect_float) {
747  }
749 }
typedef float(TangentPoint)[2]
#define BLI_INLINE
MINLINE void clamp_v3(float vec[3], const float min, const float max)
unsigned char uchar
Definition: BLI_sys_types.h:86
unsigned int uint
Definition: BLI_sys_types.h:83
void BLI_task_parallel_range(const int start, const int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
Definition: task_range.cc:110
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
Definition: BLI_task.h:231
#define UNUSED(x)
_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)
Definition: allocimbuf.c:478
Contains defines and structs used throughout the imbuf module.
@ IB_rect
Group RGB to Bright Vector Camera CLAMP
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
uint pos
uint col
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
static unsigned c
Definition: RandGen.cpp:97
static unsigned a[3]
Definition: RandGen.cpp:92
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
Definition: rall1d.h:359
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])
#define HIS_STEPS
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)
unsigned int uint32_t
Definition: stdint.h:83
unsigned int * rect
float * rect_float
TaskParallelReduceFunc func_reduce
Definition: BLI_task.h:158
size_t userdata_chunk_size
Definition: BLI_task.h:150