This function apply the transformation on a given number of pixels.
341 {
342
343
344
345
350 float g = 0.0;
352 qreal lumaR, lumaG, lumaB;
353
355 lumaR = 0.2126;
356 lumaG = 0.7152;
357 lumaB = 0.0722;
358 } else {
362 }
363 while (nPixels > 0) {
364
367 if (h >= 360.0)
h = 0;
368
370
374
375 float luminance =
r * lumaR + g * lumaG +
b * lumaB;
376
379 luminance += 1.0 - (1.0 -
m_adj_v);
380 }
383 }
386
387 } else {
388
395 } else {
402 }
404
410 } else {
412
418 } else {
420 }
422 }
424
430 } else {
434 qreal hue, sat, intensity;
435 RGBToHCI(red, green, blue, &hue, &sat, &intensity);
436
437 hue *= 360.0;
442
443 HCIToRGB(hue/360.0, sat, intensity, &red, &green, &blue);
444
446 g = green;
448 }
450
456 } else {
460 qreal hue, sat, luma;
461 RGBToHCY(red, green, blue, &hue, &sat, &luma, lumaR, lumaG, lumaB);
462
463 hue *= 360.0;
468
469 HCYToRGB(hue/360.0, sat, luma, &red, &green, &blue, lumaR, lumaG, lumaB);
471 g = green;
473 }
474
476
481 RGBToYUV(red, green, blue, &y, &cb, &cr, lumaR, lumaG, lumaB);
482
486
487 YUVToRGB(y, cb, cr, &red, &green, &blue, lumaR, lumaG, lumaB);
489 g = green;
491 } else {
492 Q_ASSERT_X(false, "", "invalid type");
493 }
494 }
495
496 clamp< _channel_type_ >(&r, &g, &b);
500 dst->alpha =
src->alpha;
501
502 --nPixels;
504 ++dst;
505 }
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549 }
void RGBToHSV(float r, float g, float b, float *h, float *s, float *v)
void HCIToRGB(const qreal h, const qreal c, const qreal i, qreal *red, qreal *green, qreal *blue)
void RGBToYUV(const qreal r, const qreal g, const qreal b, qreal *y, qreal *u, qreal *v, qreal R, qreal G, qreal B)
void RGBToHCI(const qreal r, const qreal g, const qreal b, qreal *h, qreal *c, qreal *i)
void RGBToHCY(const qreal r, const qreal g, const qreal b, qreal *h, qreal *c, qreal *y, qreal R, qreal G, qreal B)
void RGBToHSL(float r, float g, float b, float *h, float *s, float *l)
void HSVToRGB(float h, float s, float v, float *r, float *g, float *b)
void YUVToRGB(const qreal y, const qreal u, const qreal v, qreal *r, qreal *g, qreal *b, qreal R, qreal G, qreal B)
void HSLToRGB(float h, float sl, float l, float *r, float *g, float *b)
void HCYToRGB(const qreal h, const qreal c, const qreal y, qreal *red, qreal *green, qreal *blue, qreal R, qreal G, qreal B)
std::enable_if< std::is_floating_point< T >::value, T >::type normalizeAngleDegrees(T a)
#define SCALE_FROM_FLOAT(v)
void HSVTransform(float *r, float *g, float *b, float dh, float ds, float dv, ValuePolicy valuePolicy)
#define SCALE_TO_FLOAT(v)