diff options
author | fluxgen <fluxgen> | 2002-03-18 15:32:50 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-03-18 15:32:50 (GMT) |
commit | 2604c09bb0bedeed8d1aee9a03be519ad5142d1a (patch) | |
tree | ea1a1d6b5127c1e92d8fe54c6b876ccd8a5b119c /src/Image.cc | |
parent | bcfcc6403a62a4ba2a0f7d1c4b1b3be9ee07251b (diff) | |
download | fluxbox-2604c09bb0bedeed8d1aee9a03be519ad5142d1a.zip fluxbox-2604c09bb0bedeed8d1aee9a03be519ad5142d1a.tar.bz2 |
using std::max/min
Diffstat (limited to 'src/Image.cc')
-rw-r--r-- | src/Image.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/Image.cc b/src/Image.cc index ec0768a..3088f4c 100644 --- a/src/Image.cc +++ b/src/Image.cc | |||
@@ -25,7 +25,7 @@ | |||
25 | // stupid macros needed to access some functions in version 2 of the GNU C | 25 | // stupid macros needed to access some functions in version 2 of the GNU C |
26 | // library | 26 | // library |
27 | 27 | ||
28 | // $Id: Image.cc,v 1.4 2002/02/04 22:41:27 fluxgen Exp $ | 28 | // $Id: Image.cc,v 1.5 2002/03/18 15:32:50 fluxgen Exp $ |
29 | 29 | ||
30 | #ifndef _GNU_SOURCE | 30 | #ifndef _GNU_SOURCE |
31 | #define _GNU_SOURCE | 31 | #define _GNU_SOURCE |
@@ -1436,9 +1436,9 @@ void BImage::rgradient(void) { | |||
1436 | // normal rgradient | 1436 | // normal rgradient |
1437 | for (yt = ytable, y = 0; y < height; y++, yt += 3) { | 1437 | for (yt = ytable, y = 0; y < height; y++, yt += 3) { |
1438 | for (xt = xtable, x = 0; x < width; x++) { | 1438 | for (xt = xtable, x = 0; x < width; x++) { |
1439 | *(pr++) = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); | 1439 | *(pr++) = (unsigned char) (tr - (rsign * std::max(*(xt++), *(yt)))); |
1440 | *(pg++) = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); | 1440 | *(pg++) = (unsigned char) (tg - (gsign * std::max(*(xt++), *(yt + 1)))); |
1441 | *(pb++) = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); | 1441 | *(pb++) = (unsigned char) (tb - (bsign * std::max(*(xt++), *(yt + 2)))); |
1442 | } | 1442 | } |
1443 | } | 1443 | } |
1444 | 1444 | ||
@@ -1450,32 +1450,32 @@ void BImage::rgradient(void) { | |||
1450 | for (yt = ytable, y = 0; y < height; y++, yt += 3) { | 1450 | for (yt = ytable, y = 0; y < height; y++, yt += 3) { |
1451 | for (xt = xtable, x = 0; x < width; x++) { | 1451 | for (xt = xtable, x = 0; x < width; x++) { |
1452 | if (y & 1) { | 1452 | if (y & 1) { |
1453 | channel = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); | 1453 | channel = (unsigned char) (tr - (rsign * std::max(*(xt++), *(yt)))); |
1454 | channel2 = (channel >> 1) + (channel >> 2); | 1454 | channel2 = (channel >> 1) + (channel >> 2); |
1455 | if (channel2 > channel) channel2 = 0; | 1455 | if (channel2 > channel) channel2 = 0; |
1456 | *(pr++) = channel2; | 1456 | *(pr++) = channel2; |
1457 | 1457 | ||
1458 | channel = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); | 1458 | channel = (unsigned char) (tg - (gsign * std::max(*(xt++), *(yt + 1)))); |
1459 | channel2 = (channel >> 1) + (channel >> 2); | 1459 | channel2 = (channel >> 1) + (channel >> 2); |
1460 | if (channel2 > channel) channel2 = 0; | 1460 | if (channel2 > channel) channel2 = 0; |
1461 | *(pg++) = channel2; | 1461 | *(pg++) = channel2; |
1462 | 1462 | ||
1463 | channel = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); | 1463 | channel = (unsigned char) (tb - (bsign * std::max(*(xt++), *(yt + 2)))); |
1464 | channel2 = (channel >> 1) + (channel >> 2); | 1464 | channel2 = (channel >> 1) + (channel >> 2); |
1465 | if (channel2 > channel) channel2 = 0; | 1465 | if (channel2 > channel) channel2 = 0; |
1466 | *(pb++) = channel2; | 1466 | *(pb++) = channel2; |
1467 | } else { | 1467 | } else { |
1468 | channel = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); | 1468 | channel = (unsigned char) (tr - (rsign * std::max(*(xt++), *(yt)))); |
1469 | channel2 = channel + (channel >> 3); | 1469 | channel2 = channel + (channel >> 3); |
1470 | if (channel2 < channel) channel2 = ~0; | 1470 | if (channel2 < channel) channel2 = ~0; |
1471 | *(pr++) = channel2; | 1471 | *(pr++) = channel2; |
1472 | 1472 | ||
1473 | channel = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); | 1473 | channel = (unsigned char) (tg - (gsign * std::max(*(xt++), *(yt + 1)))); |
1474 | channel2 = channel + (channel >> 3); | 1474 | channel2 = channel + (channel >> 3); |
1475 | if (channel2 < channel) channel2 = ~0; | 1475 | if (channel2 < channel) channel2 = ~0; |
1476 | *(pg++) = channel2; | 1476 | *(pg++) = channel2; |
1477 | 1477 | ||
1478 | channel = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); | 1478 | channel = (unsigned char) (tb - (bsign * std::max(*(xt++), *(yt + 2)))); |
1479 | channel2 = channel + (channel >> 3); | 1479 | channel2 = channel + (channel >> 3); |
1480 | if (channel2 < channel) channel2 = ~0; | 1480 | if (channel2 < channel) channel2 = ~0; |
1481 | *(pb++) = channel2; | 1481 | *(pb++) = channel2; |
@@ -1681,9 +1681,9 @@ void BImage::pcgradient(void) { | |||
1681 | // normal pcgradient | 1681 | // normal pcgradient |
1682 | for (yt = ytable, y = 0; y < height; y++, yt += 3) { | 1682 | for (yt = ytable, y = 0; y < height; y++, yt += 3) { |
1683 | for (xt = xtable, x = 0; x < width; x++) { | 1683 | for (xt = xtable, x = 0; x < width; x++) { |
1684 | *(pr++) = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); | 1684 | *(pr++) = (unsigned char) (tr - (rsign * std::min(*(xt++), *(yt)))); |
1685 | *(pg++) = (unsigned char) (tg - (gsign * min(*(xt++), *(yt + 1)))); | 1685 | *(pg++) = (unsigned char) (tg - (gsign * std::min(*(xt++), *(yt + 1)))); |
1686 | *(pb++) = (unsigned char) (tb - (bsign * min(*(xt++), *(yt + 2)))); | 1686 | *(pb++) = (unsigned char) (tb - (bsign * std::min(*(xt++), *(yt + 2)))); |
1687 | } | 1687 | } |
1688 | } | 1688 | } |
1689 | 1689 | ||
@@ -1695,32 +1695,32 @@ void BImage::pcgradient(void) { | |||
1695 | for (yt = ytable, y = 0; y < height; y++, yt += 3) { | 1695 | for (yt = ytable, y = 0; y < height; y++, yt += 3) { |
1696 | for (xt = xtable, x = 0; x < width; x++) { | 1696 | for (xt = xtable, x = 0; x < width; x++) { |
1697 | if (y & 1) { | 1697 | if (y & 1) { |
1698 | channel = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); | 1698 | channel = (unsigned char) (tr - (rsign * std::min(*(xt++), *(yt)))); |
1699 | channel2 = (channel >> 1) + (channel >> 2); | 1699 | channel2 = (channel >> 1) + (channel >> 2); |
1700 | if (channel2 > channel) channel2 = 0; | 1700 | if (channel2 > channel) channel2 = 0; |
1701 | *(pr++) = channel2; | 1701 | *(pr++) = channel2; |
1702 | 1702 | ||
1703 | channel = (unsigned char) (tg - (bsign * min(*(xt++), *(yt + 1)))); | 1703 | channel = (unsigned char) (tg - (bsign * std::min(*(xt++), *(yt + 1)))); |
1704 | channel2 = (channel >> 1) + (channel >> 2); | 1704 | channel2 = (channel >> 1) + (channel >> 2); |
1705 | if (channel2 > channel) channel2 = 0; | 1705 | if (channel2 > channel) channel2 = 0; |
1706 | *(pg++) = channel2; | 1706 | *(pg++) = channel2; |
1707 | 1707 | ||
1708 | channel = (unsigned char) (tb - (gsign * min(*(xt++), *(yt + 2)))); | 1708 | channel = (unsigned char) (tb - (gsign * std::min(*(xt++), *(yt + 2)))); |
1709 | channel2 = (channel >> 1) + (channel >> 2); | 1709 | channel2 = (channel >> 1) + (channel >> 2); |
1710 | if (channel2 > channel) channel2 = 0; | 1710 | if (channel2 > channel) channel2 = 0; |
1711 | *(pb++) = channel2; | 1711 | *(pb++) = channel2; |
1712 | } else { | 1712 | } else { |
1713 | channel = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); | 1713 | channel = (unsigned char) (tr - (rsign * std::min(*(xt++), *(yt)))); |
1714 | channel2 = channel + (channel >> 3); | 1714 | channel2 = channel + (channel >> 3); |
1715 | if (channel2 < channel) channel2 = ~0; | 1715 | if (channel2 < channel) channel2 = ~0; |
1716 | *(pr++) = channel2; | 1716 | *(pr++) = channel2; |
1717 | 1717 | ||
1718 | channel = (unsigned char) (tg - (gsign * min(*(xt++), *(yt + 1)))); | 1718 | channel = (unsigned char) (tg - (gsign * std::min(*(xt++), *(yt + 1)))); |
1719 | channel2 = channel + (channel >> 3); | 1719 | channel2 = channel + (channel >> 3); |
1720 | if (channel2 < channel) channel2 = ~0; | 1720 | if (channel2 < channel) channel2 = ~0; |
1721 | *(pg++) = channel2; | 1721 | *(pg++) = channel2; |
1722 | 1722 | ||
1723 | channel = (unsigned char) (tb - (bsign * min(*(xt++), *(yt + 2)))); | 1723 | channel = (unsigned char) (tb - (bsign * std::min(*(xt++), *(yt + 2)))); |
1724 | channel2 = channel + (channel >> 3); | 1724 | channel2 = channel + (channel >> 3); |
1725 | if (channel2 < channel) channel2 = ~0; | 1725 | if (channel2 < channel) channel2 = ~0; |
1726 | *(pb++) = channel2; | 1726 | *(pb++) = channel2; |