Blender  V2.93
ColorBlock.cpp
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 
21 /*
22  * This file is based on a similar file from the NVIDIA texture tools
23  * (http://nvidia-texture-tools.googlecode.com/)
24  *
25  * Original license from NVIDIA follows.
26  */
27 
28 /* This code is in the public domain - <castanyo@yahoo.es> */
29 
30 #include <ColorBlock.h>
31 #include <Common.h>
32 #include <Image.h>
33 
34 #if 0
35 /* Get approximate luminance. */
36 inline static uint colorLuminance(Color32 c)
37 {
38  return c.r + c.g + c.b;
39 }
40 
41 /* Get the euclidean distance between the given colors. */
42 inline static uint colorDistance(Color32 c0, Color32 c1)
43 {
44  return (c0.r - c1.r) * (c0.r - c1.r) + (c0.g - c1.g) * (c0.g - c1.g) +
45  (c0.b - c1.b) * (c0.b - c1.b);
46 }
47 #endif
48 
50 ColorBlock::ColorBlock(const uint *linearImage)
51 {
52  for (uint i = 0; i < 16; i++) {
53  color(i) = Color32(linearImage[i]);
54  }
55 }
56 
59 {
60  for (uint i = 0; i < 16; i++) {
61  color(i) = block.color(i);
62  }
63 }
64 
67 {
68  init(img, x, y);
69 }
70 
71 void ColorBlock::init(const Image *img, uint x, uint y)
72 {
73  init(img->width(), img->height(), (const uint *)img->pixels(), x, y);
74 }
75 
77 {
78  const uint bw = MIN(w - x, 4U);
79  const uint bh = MIN(h - y, 4U);
80 
81  /* Blocks that are smaller than 4x4 are handled by repeating the pixels.
82  * @@ That's only correct when block size is 1, 2 or 4, but not with 3. :(
83  * @@ Ideally we should zero the weights of the pixels out of range. */
84 
85  for (uint i = 0; i < 4; i++) {
86  const int by = i % bh;
87 
88  for (uint e = 0; e < 4; e++) {
89  const int bx = e % bw;
90  const uint idx = (y + by) * w + x + bx;
91 
92  color(e, i).u = data[idx];
93  }
94  }
95 }
96 
97 void ColorBlock::init(uint w, uint h, const float *data, uint x, uint y)
98 {
99  const uint bw = MIN(w - x, 4U);
100  const uint bh = MIN(h - y, 4U);
101 
102  /* Blocks that are smaller than 4x4 are handled by repeating the pixels.
103  * @@ That's only correct when block size is 1, 2 or 4, but not with 3. :(
104  * @@ Ideally we should zero the weights of the pixels out of range. */
105 
106  uint srcPlane = w * h;
107 
108  for (uint i = 0; i < 4; i++) {
109  const uint by = i % bh;
110 
111  for (uint e = 0; e < 4; e++) {
112  const uint bx = e % bw;
113  const uint idx = ((y + by) * w + x + bx);
114 
115  Color32 &c = color(e, i);
116  c.r = uint8(255 * CLAMP(data[idx + 0 * srcPlane],
117  0.0f,
118  1.0f)); /* @@ Is this the right way to quantize floats to bytes? */
119  c.g = uint8(255 * CLAMP(data[idx + 1 * srcPlane], 0.0f, 1.0f));
120  c.b = uint8(255 * CLAMP(data[idx + 2 * srcPlane], 0.0f, 1.0f));
121  c.a = uint8(255 * CLAMP(data[idx + 3 * srcPlane], 0.0f, 1.0f));
122  }
123  }
124 }
125 
126 static inline uint8 component(Color32 c, uint i)
127 {
128  if (i == 0) {
129  return c.r;
130  }
131  if (i == 1) {
132  return c.g;
133  }
134  if (i == 2) {
135  return c.b;
136  }
137  if (i == 3) {
138  return c.a;
139  }
140  if (i == 4) {
141  return 0xFF;
142  }
143  return 0;
144 }
145 
147 {
148  for (Color32 &color : m_color) {
149  const Color32 c = color;
150  color.r = component(c, x);
151  color.g = component(c, y);
152  color.b = component(c, z);
153  color.a = component(c, w);
154  }
155 }
156 
158 bool ColorBlock::isSingleColor(Color32 mask /*= Color32(0xFF, 0xFF, 0xFF, 0x00)*/) const
159 {
160  uint u = m_color[0].u & mask.u;
161 
162  for (int i = 1; i < 16; i++) {
163  if (u != (m_color[i].u & mask.u)) {
164  return false;
165  }
166  }
167 
168  return true;
169 }
170 
171 #if 0
173 bool ColorBlock::isSingleColorNoAlpha() const
174 {
175  Color32 c;
176  int i;
177  for (i = 0; i < 16; i++) {
178  if (m_color[i].a != 0) {
179  c = m_color[i];
180  }
181  }
182 
183  Color32 mask(0xFF, 0xFF, 0xFF, 0x00);
184  uint u = c.u & mask.u;
185 
186  for (; i < 16; i++) {
187  if (u != (m_color[i].u & mask.u)) {
188  return false;
189  }
190  }
191 
192  return true;
193 }
194 #endif
195 
196 #if 0
198 uint ColorBlock::countUniqueColors() const
199 {
200  uint count = 0;
201 
202  /* @@ This does not have to be o(n^2) */
203  for (int i = 0; i < 16; i++) {
204  bool unique = true;
205  for (int j = 0; j < i; j++) {
206  if (m_color[i] != m_color[j]) {
207  unique = false;
208  }
209  }
210 
211  if (unique) {
212  count++;
213  }
214  }
215 
216  return count;
217 }
218 #endif
219 
220 #if 0
222 Color32 ColorBlock::averageColor() const
223 {
224  uint r, g, b, a;
225  r = g = b = a = 0;
226 
227  for (uint i = 0; i < 16; i++) {
228  r += m_color[i].r;
229  g += m_color[i].g;
230  b += m_color[i].b;
231  a += m_color[i].a;
232  }
233 
234  return Color32(uint8(r / 16), uint8(g / 16), uint8(b / 16), uint8(a / 16));
235 }
236 #endif
237 
240 {
241  for (const auto &i : m_color) {
242  if (i.a != 255) {
243  return true;
244  }
245  }
246  return false;
247 }
248 
249 #if 0
250 
252 void ColorBlock::diameterRange(Color32 *start, Color32 *end) const
253 {
254  Color32 c0, c1;
255  uint best_dist = 0;
256 
257  for (int i = 0; i < 16; i++) {
258  for (int j = i + 1; j < 16; j++) {
259  uint dist = colorDistance(m_color[i], m_color[j]);
260  if (dist > best_dist) {
261  best_dist = dist;
262  c0 = m_color[i];
263  c1 = m_color[j];
264  }
265  }
266  }
267 
268  *start = c0;
269  *end = c1;
270 }
271 
273 void ColorBlock::luminanceRange(Color32 *start, Color32 *end) const
274 {
275  Color32 minColor, maxColor;
276  uint minLuminance, maxLuminance;
277 
278  maxLuminance = minLuminance = colorLuminance(m_color[0]);
279 
280  for (uint i = 1; i < 16; i++) {
281  uint luminance = colorLuminance(m_color[i]);
282 
283  if (luminance > maxLuminance) {
284  maxLuminance = luminance;
285  maxColor = m_color[i];
286  }
287  else if (luminance < minLuminance) {
288  minLuminance = luminance;
289  minColor = m_color[i];
290  }
291  }
292 
293  *start = minColor;
294  *end = maxColor;
295 }
296 
298 void ColorBlock::boundsRange(Color32 *start, Color32 *end) const
299 {
300  Color32 minColor(255, 255, 255);
301  Color32 maxColor(0, 0, 0);
302 
303  for (uint i = 0; i < 16; i++) {
304  if (m_color[i].r < minColor.r) {
305  minColor.r = m_color[i].r;
306  }
307  if (m_color[i].g < minColor.g) {
308  minColor.g = m_color[i].g;
309  }
310  if (m_color[i].b < minColor.b) {
311  minColor.b = m_color[i].b;
312  }
313  if (m_color[i].r > maxColor.r) {
314  maxColor.r = m_color[i].r;
315  }
316  if (m_color[i].g > maxColor.g) {
317  maxColor.g = m_color[i].g;
318  }
319  if (m_color[i].b > maxColor.b) {
320  maxColor.b = m_color[i].b;
321  }
322  }
323 
324  /* Offset range by 1/16 of the extents */
325  Color32 inset;
326  inset.r = (maxColor.r - minColor.r) >> 4;
327  inset.g = (maxColor.g - minColor.g) >> 4;
328  inset.b = (maxColor.b - minColor.b) >> 4;
329 
330  minColor.r = (minColor.r + inset.r <= 255) ? minColor.r + inset.r : 255;
331  minColor.g = (minColor.g + inset.g <= 255) ? minColor.g + inset.g : 255;
332  minColor.b = (minColor.b + inset.b <= 255) ? minColor.b + inset.b : 255;
333 
334  maxColor.r = (maxColor.r >= inset.r) ? maxColor.r - inset.r : 0;
335  maxColor.g = (maxColor.g >= inset.g) ? maxColor.g - inset.g : 0;
336  maxColor.b = (maxColor.b >= inset.b) ? maxColor.b - inset.b : 0;
337 
338  *start = minColor;
339  *end = maxColor;
340 }
341 
343 void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
344 {
345  Color32 minColor(255, 255, 255, 255);
346  Color32 maxColor(0, 0, 0, 0);
347 
348  for (uint i = 0; i < 16; i++) {
349  if (m_color[i].r < minColor.r) {
350  minColor.r = m_color[i].r;
351  }
352  if (m_color[i].g < minColor.g) {
353  minColor.g = m_color[i].g;
354  }
355  if (m_color[i].b < minColor.b) {
356  minColor.b = m_color[i].b;
357  }
358  if (m_color[i].a < minColor.a) {
359  minColor.a = m_color[i].a;
360  }
361  if (m_color[i].r > maxColor.r) {
362  maxColor.r = m_color[i].r;
363  }
364  if (m_color[i].g > maxColor.g) {
365  maxColor.g = m_color[i].g;
366  }
367  if (m_color[i].b > maxColor.b) {
368  maxColor.b = m_color[i].b;
369  }
370  if (m_color[i].a > maxColor.a) {
371  maxColor.a = m_color[i].a;
372  }
373  }
374 
375  /* Offset range by 1/16 of the extents */
376  Color32 inset;
377  inset.r = (maxColor.r - minColor.r) >> 4;
378  inset.g = (maxColor.g - minColor.g) >> 4;
379  inset.b = (maxColor.b - minColor.b) >> 4;
380  inset.a = (maxColor.a - minColor.a) >> 4;
381 
382  minColor.r = (minColor.r + inset.r <= 255) ? minColor.r + inset.r : 255;
383  minColor.g = (minColor.g + inset.g <= 255) ? minColor.g + inset.g : 255;
384  minColor.b = (minColor.b + inset.b <= 255) ? minColor.b + inset.b : 255;
385  minColor.a = (minColor.a + inset.a <= 255) ? minColor.a + inset.a : 255;
386 
387  maxColor.r = (maxColor.r >= inset.r) ? maxColor.r - inset.r : 0;
388  maxColor.g = (maxColor.g >= inset.g) ? maxColor.g - inset.g : 0;
389  maxColor.b = (maxColor.b >= inset.b) ? maxColor.b - inset.b : 0;
390  maxColor.a = (maxColor.a >= inset.a) ? maxColor.a - inset.a : 0;
391 
392  *start = minColor;
393  *end = maxColor;
394 }
395 #endif
396 
397 #if 0
399 void ColorBlock::sortColorsByAbsoluteValue()
400 {
401  /* Dummy selection sort. */
402  for (uint a = 0; a < 16; a++) {
403  uint max = a;
404  Color16 cmax(m_color[a]);
405 
406  for (uint b = a + 1; b < 16; b++) {
407  Color16 cb(m_color[b]);
408 
409  if (cb.u > cmax.u) {
410  max = b;
411  cmax = cb;
412  }
413  }
414  swap(m_color[a], m_color[max]);
415  }
416 }
417 #endif
418 
419 #if 0
421 void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) const
422 {
423 
424  int mini, maxi;
425  mini = maxi = 0;
426 
427  float min, max;
428  min = max = dot(Vector3(m_color[0].r, m_color[0].g, m_color[0].b), axis);
429 
430  for (uint i = 1; i < 16; i++) {
431  const Vector3 vec(m_color[i].r, m_color[i].g, m_color[i].b);
432 
433  float val = dot(vec, axis);
434  if (val < min) {
435  mini = i;
436  min = val;
437  }
438  else if (val > max) {
439  maxi = i;
440  max = val;
441  }
442  }
443 
444  *start = m_color[mini];
445  *end = m_color[maxi];
446 }
447 #endif
448 
449 #if 0
451 void ColorBlock::sortColors(const Vector3 &axis)
452 {
453  float luma_array[16];
454 
455  for (uint i = 0; i < 16; i++) {
456  const Vector3 vec(m_color[i].r, m_color[i].g, m_color[i].b);
457  luma_array[i] = dot(vec, axis);
458  }
459 
460  /* Dummy selection sort. */
461  for (uint a = 0; a < 16; a++) {
462  uint min = a;
463  for (uint b = a + 1; b < 16; b++) {
464  if (luma_array[b] < luma_array[min]) {
465  min = b;
466  }
467  }
468  swap(luma_array[a], luma_array[min]);
469  swap(m_color[a], m_color[min]);
470  }
471 }
472 #endif
473 
474 #if 0
476 float ColorBlock::volume() const
477 {
478  Box bounds;
479  bounds.clearBounds();
480 
481  for (int i = 0; i < 16; i++) {
482  const Vector3 point(m_color[i].r, m_color[i].g, m_color[i].b);
483  bounds.addPointToBounds(point);
484  }
485 
486  return bounds.volume();
487 }
488 #endif
unsigned int uint
Definition: BLI_sys_types.h:83
static uint8 component(Color32 c, uint i)
Definition: ColorBlock.cpp:126
#define MIN(a, b)
Definition: Common.h:24
void swap(T &a, T &b)
Definition: Common.h:33
unsigned char uint8
Definition: Common.h:40
_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 z
_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
Group RGB to Bright Vector Camera CLAMP
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
Definition: Color.h:97
Definition: Color.h:33
unsigned char g
Definition: Color.h:90
unsigned char b
Definition: Color.h:90
unsigned int u
Definition: Color.h:92
unsigned char r
Definition: Color.h:90
unsigned char a
Definition: Color.h:90
const Color32 * pixels() const
Definition: Image.cpp:86
uint height() const
Definition: Image.cpp:63
uint width() const
Definition: Image.cpp:58
int count
float[3] Vector3
static unsigned c
Definition: RandGen.cpp:97
static unsigned a[3]
Definition: RandGen.cpp:92
#define min(a, b)
Definition: sort.c:51
Color32 color(uint i) const
Definition: ColorBlock.h:71
ColorBlock()=default
void init(const Image *img, uint x, uint y)
Definition: ColorBlock.cpp:71
bool isSingleColor(Color32 mask=Color32(0xFF, 0xFF, 0xFF, 0x00)) const
Definition: ColorBlock.cpp:158
bool hasAlpha() const
Definition: ColorBlock.cpp:239
void swizzle(uint x, uint y, uint z, uint w)
Definition: ColorBlock.cpp:146
float max
__forceinline avxf maxi(const avxf &a, const avxf &b)
Definition: util_avxf.h:318
__forceinline avxf mini(const avxf &a, const avxf &b)
Definition: util_avxf.h:324
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)