@@ -240,7 +240,6 @@ class Renderer_HSV_TO_RGB : public OpCPU
240
240
241
241
class Renderer_RGB_TO_HSY_LOG : public OpCPU
242
242
{
243
- const float MIN_0 = -0 .1f ;
244
243
public:
245
244
Renderer_RGB_TO_HSY_LOG () = delete ;
246
245
explicit Renderer_RGB_TO_HSY_LOG (ConstFixedFunctionOpDataRcPtr & data);
@@ -250,7 +249,6 @@ class Renderer_RGB_TO_HSY_LOG : public OpCPU
250
249
251
250
class Renderer_HSY_LOG_TO_RGB : public OpCPU
252
251
{
253
- const float MIN_0 = -0 .1f ;;
254
252
public:
255
253
Renderer_HSY_LOG_TO_RGB () = delete ;
256
254
explicit Renderer_HSY_LOG_TO_RGB (ConstFixedFunctionOpDataRcPtr & data);
@@ -260,7 +258,6 @@ class Renderer_HSY_LOG_TO_RGB : public OpCPU
260
258
261
259
class Renderer_RGB_TO_HSY_VID : public OpCPU
262
260
{
263
- const float MIN_0 = 0 .0f ;
264
261
public:
265
262
Renderer_RGB_TO_HSY_VID () = delete ;
266
263
explicit Renderer_RGB_TO_HSY_VID (ConstFixedFunctionOpDataRcPtr & data);
@@ -270,7 +267,6 @@ class Renderer_RGB_TO_HSY_VID : public OpCPU
270
267
271
268
class Renderer_HSY_VID_TO_RGB : public OpCPU
272
269
{
273
- const float MIN_0 = 0 .0f ;
274
270
public:
275
271
Renderer_HSY_VID_TO_RGB () = delete ;
276
272
explicit Renderer_HSY_VID_TO_RGB (ConstFixedFunctionOpDataRcPtr & data);
@@ -280,7 +276,6 @@ class Renderer_HSY_VID_TO_RGB : public OpCPU
280
276
281
277
class Renderer_RGB_TO_HSY_LIN : public OpCPU
282
278
{
283
- const float MIN_0 = 0 .2f ;
284
279
public:
285
280
Renderer_RGB_TO_HSY_LIN () = delete ;
286
281
explicit Renderer_RGB_TO_HSY_LIN (ConstFixedFunctionOpDataRcPtr & data);
@@ -290,7 +285,6 @@ class Renderer_RGB_TO_HSY_LIN : public OpCPU
290
285
291
286
class Renderer_HSY_LIN_TO_RGB : public OpCPU
292
287
{
293
- const float MIN_0 = 0 .2f ;
294
288
public:
295
289
Renderer_HSY_LIN_TO_RGB () = delete ;
296
290
explicit Renderer_HSY_LIN_TO_RGB (ConstFixedFunctionOpDataRcPtr & data);
@@ -1594,7 +1588,7 @@ void Renderer_HSV_TO_RGB::apply(const void * inImg, void * outImg, long numPixel
1594
1588
}
1595
1589
}
1596
1590
1597
- void applyHSYToRGB (const void * inImg, void * outImg, long numPixels, float min0 )
1591
+ void applyHSYToRGB (const void * inImg, void * outImg, long numPixels, FixedFunctionOpData::Style funcStyle )
1598
1592
{
1599
1593
const float * in = (const float *)inImg;
1600
1594
float * out = (float *)outImg;
@@ -1623,7 +1617,7 @@ void applyHSYToRGB(const void * inImg, void * outImg, long numPixels, float min0
1623
1617
1624
1618
const float distRgb = std::fabs (red - luma) + std::fabs (grn - luma) + std::fabs (blu - luma);
1625
1619
1626
- if (min0 > 0 . f ) // linear
1620
+ if (funcStyle == FixedFunctionOpData::HSY_LIN_TO_RGB)
1627
1621
{
1628
1622
const float sumRgb = red + grn + blu;
1629
1623
@@ -1656,13 +1650,13 @@ void applyHSYToRGB(const void * inImg, void * outImg, long numPixels, float min0
1656
1650
gainS = gainS >= 0 .f ? gainS : (2 .f * c) / (denom + discrim * 2 .f );
1657
1651
}
1658
1652
}
1659
- else if (min0 < 0 . f ) // log
1653
+ else if (funcStyle == FixedFunctionOpData::HSY_LOG_TO_RGB)
1660
1654
{
1661
1655
const float satGain = 4 .f ;
1662
1656
const float currSat = distRgb * satGain;
1663
1657
gainS = sat / std::max (1e-10f , currSat);
1664
1658
}
1665
- else // video
1659
+ else // funcStyle == FixedFunctionOpData::HSY_VID_TO_RGB
1666
1660
{
1667
1661
const float satGain = 1 .25f ;
1668
1662
const float currSat = distRgb * satGain;
@@ -1680,7 +1674,7 @@ void applyHSYToRGB(const void * inImg, void * outImg, long numPixels, float min0
1680
1674
1681
1675
}
1682
1676
1683
- void applyRGBToHSY (const void * inImg, void * outImg, long numPixels, float min0 )
1677
+ void applyRGBToHSY (const void * inImg, void * outImg, long numPixels, FixedFunctionOpData::Style funcStyle )
1684
1678
{
1685
1679
const float * in = (const float *)inImg;
1686
1680
float * out = (float *)outImg;
@@ -1704,7 +1698,7 @@ void applyRGBToHSY(const void * inImg, void * outImg, long numPixels, float min0
1704
1698
1705
1699
float sat = 0 .f ;
1706
1700
1707
- if (min0 > 0 . f ) // linear
1701
+ if (funcStyle == FixedFunctionOpData::RGB_TO_HSY_LIN)
1708
1702
{
1709
1703
const float sumRgb = red + grn + blu;
1710
1704
const float k = 0 .15f ;
@@ -1717,12 +1711,12 @@ void applyRGBToHSY(const void * inImg, void * outImg, long numPixels, float min0
1717
1711
sat = satLo + alpha * (satHi - satLo);
1718
1712
sat *= 1 .4f ;
1719
1713
}
1720
- else if (min0 < 0 . f ) // log
1714
+ else if (funcStyle == FixedFunctionOpData::RGB_TO_HSY_LOG)
1721
1715
{
1722
1716
const float sat_gain = 4 .f ;
1723
1717
sat = distRgb * sat_gain;
1724
1718
}
1725
- else // video
1719
+ else // FixedFunctionOpData::RGB_TO_HSY_VID
1726
1720
{
1727
1721
const float sat_gain = 1 .25f ;
1728
1722
sat = distRgb * sat_gain;
@@ -1769,7 +1763,7 @@ Renderer_RGB_TO_HSY_LOG::Renderer_RGB_TO_HSY_LOG(ConstFixedFunctionOpDataRcPtr &
1769
1763
1770
1764
void Renderer_RGB_TO_HSY_LOG::apply (const void * inImg, void * outImg, long numPixels) const
1771
1765
{
1772
- applyRGBToHSY (inImg, outImg, numPixels, MIN_0 );
1766
+ applyRGBToHSY (inImg, outImg, numPixels, FixedFunctionOpData::RGB_TO_HSY_LOG );
1773
1767
}
1774
1768
1775
1769
Renderer_HSY_LOG_TO_RGB::Renderer_HSY_LOG_TO_RGB (ConstFixedFunctionOpDataRcPtr & /* data*/ )
@@ -1779,7 +1773,7 @@ Renderer_HSY_LOG_TO_RGB::Renderer_HSY_LOG_TO_RGB(ConstFixedFunctionOpDataRcPtr &
1779
1773
1780
1774
void Renderer_HSY_LOG_TO_RGB::apply (const void * inImg, void * outImg, long numPixels) const
1781
1775
{
1782
- applyHSYToRGB (inImg, outImg, numPixels, MIN_0 );
1776
+ applyHSYToRGB (inImg, outImg, numPixels, FixedFunctionOpData::HSY_LOG_TO_RGB );
1783
1777
}
1784
1778
1785
1779
Renderer_RGB_TO_HSY_LIN::Renderer_RGB_TO_HSY_LIN (ConstFixedFunctionOpDataRcPtr & /* data*/ )
@@ -1789,7 +1783,7 @@ Renderer_RGB_TO_HSY_LIN::Renderer_RGB_TO_HSY_LIN(ConstFixedFunctionOpDataRcPtr &
1789
1783
1790
1784
void Renderer_RGB_TO_HSY_LIN::apply (const void * inImg, void * outImg, long numPixels) const
1791
1785
{
1792
- applyRGBToHSY (inImg, outImg, numPixels, MIN_0 );
1786
+ applyRGBToHSY (inImg, outImg, numPixels, FixedFunctionOpData::RGB_TO_HSY_LIN );
1793
1787
}
1794
1788
1795
1789
Renderer_HSY_LIN_TO_RGB::Renderer_HSY_LIN_TO_RGB (ConstFixedFunctionOpDataRcPtr & /* data*/ )
@@ -1799,7 +1793,7 @@ Renderer_HSY_LIN_TO_RGB::Renderer_HSY_LIN_TO_RGB(ConstFixedFunctionOpDataRcPtr &
1799
1793
1800
1794
void Renderer_HSY_LIN_TO_RGB::apply (const void * inImg, void * outImg, long numPixels) const
1801
1795
{
1802
- applyHSYToRGB (inImg, outImg, numPixels, MIN_0 );
1796
+ applyHSYToRGB (inImg, outImg, numPixels, FixedFunctionOpData::HSY_LIN_TO_RGB );
1803
1797
}
1804
1798
1805
1799
Renderer_RGB_TO_HSY_VID::Renderer_RGB_TO_HSY_VID (ConstFixedFunctionOpDataRcPtr & /* data*/ )
@@ -1809,7 +1803,7 @@ Renderer_RGB_TO_HSY_VID::Renderer_RGB_TO_HSY_VID(ConstFixedFunctionOpDataRcPtr &
1809
1803
1810
1804
void Renderer_RGB_TO_HSY_VID::apply (const void * inImg, void * outImg, long numPixels) const
1811
1805
{
1812
- applyRGBToHSY (inImg, outImg, numPixels, MIN_0 );
1806
+ applyRGBToHSY (inImg, outImg, numPixels, FixedFunctionOpData::RGB_TO_HSY_VID );
1813
1807
}
1814
1808
1815
1809
Renderer_HSY_VID_TO_RGB::Renderer_HSY_VID_TO_RGB (ConstFixedFunctionOpDataRcPtr & /* data*/ )
@@ -1819,7 +1813,7 @@ Renderer_HSY_VID_TO_RGB::Renderer_HSY_VID_TO_RGB(ConstFixedFunctionOpDataRcPtr &
1819
1813
1820
1814
void Renderer_HSY_VID_TO_RGB::apply (const void * inImg, void * outImg, long numPixels) const
1821
1815
{
1822
- applyHSYToRGB (inImg, outImg, numPixels, MIN_0 );
1816
+ applyHSYToRGB (inImg, outImg, numPixels, FixedFunctionOpData::HSY_VID_TO_RGB );
1823
1817
}
1824
1818
1825
1819
Renderer_XYZ_TO_xyY::Renderer_XYZ_TO_xyY (ConstFixedFunctionOpDataRcPtr & /* data*/ )
0 commit comments