Changeset View
Changeset View
Standalone View
Standalone View
libs/image/kis_painter.cc
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | |||||
63 | #include "kis_lod_transform.h" | 63 | #include "kis_lod_transform.h" | ||
64 | #include "kis_algebra_2d.h" | 64 | #include "kis_algebra_2d.h" | ||
65 | #include "krita_utils.h" | 65 | #include "krita_utils.h" | ||
66 | 66 | | |||
67 | 67 | | |||
68 | // Maximum distance from a Bezier control point to the line through the start | 68 | // Maximum distance from a Bezier control point to the line through the start | ||
69 | // and end points for the curve to be considered flat. | 69 | // and end points for the curve to be considered flat. | ||
70 | #define BEZIER_FLATNESS_THRESHOLD 0.5 | 70 | #define BEZIER_FLATNESS_THRESHOLD 0.5 | ||
71 | #define trunc(x) ((int)(x)) | | |||
72 | #ifndef Q_OS_WIN | | |||
73 | | ||||
74 | #endif | | |||
75 | 71 | | |||
76 | #include "kis_painter_p.h" | 72 | #include "kis_painter_p.h" | ||
77 | 73 | | |||
78 | KisPainter::KisPainter() | 74 | KisPainter::KisPainter() | ||
79 | : d(new Private(this)) | 75 | : d(new Private(this)) | ||
80 | { | 76 | { | ||
81 | init(); | 77 | init(); | ||
82 | } | 78 | } | ||
▲ Show 20 Lines • Show All 1428 Lines • ▼ Show 20 Line(s) | 1498 | { | |||
1511 | 1507 | | |||
1512 | d->colorSpace->bitBlt(color.colorSpace(), d->paramInfo, d->compositeOp, | 1508 | d->colorSpace->bitBlt(color.colorSpace(), d->paramInfo, d->compositeOp, | ||
1513 | d->renderingIntent, | 1509 | d->renderingIntent, | ||
1514 | d->conversionFlags); | 1510 | d->conversionFlags); | ||
1515 | } | 1511 | } | ||
1516 | 1512 | | |||
1517 | /**/ | 1513 | /**/ | ||
1518 | void KisPainter::drawLine(const QPointF& start, const QPointF& end, qreal width, bool antialias){ | 1514 | void KisPainter::drawLine(const QPointF& start, const QPointF& end, qreal width, bool antialias){ | ||
1519 | int x1 = start.x(); | 1515 | int x1 = qFloor(start.x()); | ||
1520 | int y1 = start.y(); | 1516 | int y1 = qFloor(start.y()); | ||
1521 | int x2 = end.x(); | 1517 | int x2 = qFloor(end.x()); | ||
1522 | int y2 = end.y(); | 1518 | int y2 = qFloor(end.y()); | ||
1523 | 1519 | | |||
1524 | if ((x2 == x1 ) && (y2 == y1)) return; | 1520 | if ((x2 == x1 ) && (y2 == y1)) return; | ||
1525 | 1521 | | |||
1526 | int dstX = x2-x1; | 1522 | int dstX = x2-x1; | ||
1527 | int dstY = y2-y1; | 1523 | int dstY = y2-y1; | ||
1528 | 1524 | | |||
1529 | qreal uniC = dstX*y1 - dstY*x1; | 1525 | qreal uniC = dstX*y1 - dstY*x1; | ||
1530 | qreal projectionDenominator = 1.0 / (pow((double)dstX, 2) + pow((double)dstY, 2)); | 1526 | qreal projectionDenominator = 1.0 / (pow((double)dstX, 2) + pow((double)dstY, 2)); | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
1600 | void KisPainter::drawLine(const QPointF & start, const QPointF & end) | 1596 | void KisPainter::drawLine(const QPointF & start, const QPointF & end) | ||
1601 | { | 1597 | { | ||
1602 | drawThickLine(start, end, 1, 1); | 1598 | drawThickLine(start, end, 1, 1); | ||
1603 | } | 1599 | } | ||
1604 | 1600 | | |||
1605 | 1601 | | |||
1606 | void KisPainter::drawDDALine(const QPointF & start, const QPointF & end) | 1602 | void KisPainter::drawDDALine(const QPointF & start, const QPointF & end) | ||
1607 | { | 1603 | { | ||
1608 | int x = int(start.x()); | 1604 | int x = qFloor(start.x()); | ||
1609 | int y = int(start.y()); | 1605 | int y = qFloor(start.y()); | ||
1610 | 1606 | | |||
1611 | int x2 = int(end.x()); | 1607 | int x2 = qFloor(end.x()); | ||
1612 | int y2 = int(end.y()); | 1608 | int y2 = qFloor(end.y()); | ||
1613 | 1609 | | |||
1614 | // Width and height of the line | 1610 | // Width and height of the line | ||
1615 | int xd = x2 - x; | 1611 | int xd = x2 - x; | ||
1616 | int yd = y2 - y; | 1612 | int yd = y2 - y; | ||
1617 | 1613 | | |||
1618 | float m = (float)yd / (float)xd; | 1614 | float m = (float)yd / (float)xd; | ||
1619 | 1615 | | |||
1620 | float fx = x; | 1616 | float fx = x; | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 1661 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | |||
1666 | compositeOnePixel(accessor->rawData(), d->paintColor); | 1662 | compositeOnePixel(accessor->rawData(), d->paintColor); | ||
1667 | } | 1663 | } | ||
1668 | } | 1664 | } | ||
1669 | } | 1665 | } | ||
1670 | } | 1666 | } | ||
1671 | 1667 | | |||
1672 | void KisPainter::drawWobblyLine(const QPointF & start, const QPointF & end) | 1668 | void KisPainter::drawWobblyLine(const QPointF & start, const QPointF & end) | ||
1673 | { | 1669 | { | ||
1674 | KisRandomAccessorSP accessor = d->device->createRandomAccessorNG(start.x(), start.y()); | 1670 | KoColor mycolor(d->paintColor); | ||
1671 | | ||||
1672 | int x1 = qFloor(start.x()); | ||||
1673 | int y1 = qFloor(start.y()); | ||||
1674 | int x2 = qFloor(end.x()); | ||||
1675 | int y2 = qFloor(end.y()); | ||||
1676 | | ||||
1677 | KisRandomAccessorSP accessor = d->device->createRandomAccessorNG(x1, y1); | ||||
1675 | KisRandomConstAccessorSP selectionAccessor; | 1678 | KisRandomConstAccessorSP selectionAccessor; | ||
1676 | if (d->selection) { | 1679 | if (d->selection) { | ||
1677 | selectionAccessor = d->selection->projection()->createRandomConstAccessorNG(start.x(), start.y()); | 1680 | selectionAccessor = d->selection->projection()->createRandomConstAccessorNG(x1, y1); | ||
1678 | } | 1681 | } | ||
1679 | 1682 | | |||
1680 | KoColor mycolor(d->paintColor); | | |||
1681 | | ||||
1682 | int x1 = start.x(); | | |||
1683 | int y1 = start.y(); | | |||
1684 | int x2 = end.x(); | | |||
1685 | int y2 = end.y(); | | |||
1686 | | ||||
1687 | // Width and height of the line | 1683 | // Width and height of the line | ||
1688 | int xd = (x2 - x1); | 1684 | int xd = (x2 - x1); | ||
1689 | int yd = (y2 - y1); | 1685 | int yd = (y2 - y1); | ||
1690 | 1686 | | |||
1691 | int x; | 1687 | int x; | ||
1692 | int y; | 1688 | int y; | ||
1693 | float fx = (x = x1); | 1689 | float fx = (x = x1); | ||
1694 | float fy = (y = y1); | 1690 | float fy = (y = y1); | ||
1695 | float m = (float)yd / (float)xd; | 1691 | float m = (float)yd / (float)xd; | ||
1696 | int inc; | 1692 | int inc; | ||
1697 | 1693 | | |||
1698 | if (fabs(m) > 1) { | 1694 | if (fabs(m) > 1) { | ||
1699 | inc = (yd > 0) ? 1 : -1; | 1695 | inc = (yd > 0) ? 1 : -1; | ||
1700 | m = 1.0f / m; | 1696 | m = 1.0f / m; | ||
1701 | m *= inc; | 1697 | m *= inc; | ||
1702 | while (y != y2) { | 1698 | while (y != y2) { | ||
1703 | fx = fx + m; | 1699 | fx = fx + m; | ||
1704 | y = y + inc; | 1700 | y = y + inc; | ||
1705 | x = qRound(fx); | 1701 | x = qRound(fx); | ||
1706 | 1702 | | |||
1707 | float br1 = int(fx + 1) - fx; | 1703 | float br1 = qFloor(fx + 1) - fx; | ||
1708 | float br2 = fx - (int)fx; | 1704 | float br2 = fx - qFloor(fx); | ||
1709 | 1705 | | |||
1710 | accessor->moveTo(x, y); | 1706 | accessor->moveTo(x, y); | ||
1711 | if (selectionAccessor) selectionAccessor->moveTo(x, y); | 1707 | if (selectionAccessor) selectionAccessor->moveTo(x, y); | ||
1712 | 1708 | | |||
1713 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 1709 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
1714 | mycolor.setOpacity((quint8)(255*br1)); | 1710 | mycolor.setOpacity((quint8)(255*br1)); | ||
1715 | compositeOnePixel(accessor->rawData(), mycolor); | 1711 | compositeOnePixel(accessor->rawData(), mycolor); | ||
1716 | } | 1712 | } | ||
Show All 9 Lines | |||||
1726 | } else { | 1722 | } else { | ||
1727 | inc = (xd > 0) ? 1 : -1; | 1723 | inc = (xd > 0) ? 1 : -1; | ||
1728 | m *= inc; | 1724 | m *= inc; | ||
1729 | while (x != x2) { | 1725 | while (x != x2) { | ||
1730 | fy = fy + m; | 1726 | fy = fy + m; | ||
1731 | x = x + inc; | 1727 | x = x + inc; | ||
1732 | y = qRound(fy); | 1728 | y = qRound(fy); | ||
1733 | 1729 | | |||
1734 | float br1 = int(fy + 1) - fy; | 1730 | float br1 = qFloor(fy + 1) - fy; | ||
1735 | float br2 = fy - (int)fy; | 1731 | float br2 = fy - qFloor(fy); | ||
1736 | 1732 | | |||
1737 | accessor->moveTo(x, y); | 1733 | accessor->moveTo(x, y); | ||
1738 | if (selectionAccessor) selectionAccessor->moveTo(x, y); | 1734 | if (selectionAccessor) selectionAccessor->moveTo(x, y); | ||
1739 | 1735 | | |||
1740 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 1736 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
1741 | mycolor.setOpacity((quint8)(255*br1)); | 1737 | mycolor.setOpacity((quint8)(255*br1)); | ||
1742 | compositeOnePixel(accessor->rawData(), mycolor); | 1738 | compositeOnePixel(accessor->rawData(), mycolor); | ||
1743 | } | 1739 | } | ||
1744 | 1740 | | |||
1745 | accessor->moveTo(x, y + 1); | 1741 | accessor->moveTo(x, y + 1); | ||
1746 | if (selectionAccessor) selectionAccessor->moveTo(x, y + 1); | 1742 | if (selectionAccessor) selectionAccessor->moveTo(x, y + 1); | ||
1747 | 1743 | | |||
1748 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 1744 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
1749 | mycolor.setOpacity((quint8)(255*br2)); | 1745 | mycolor.setOpacity((quint8)(255*br2)); | ||
1750 | compositeOnePixel(accessor->rawData(), mycolor); | 1746 | compositeOnePixel(accessor->rawData(), mycolor); | ||
1751 | } | 1747 | } | ||
1752 | } | 1748 | } | ||
1753 | } | 1749 | } | ||
1754 | 1750 | | |||
1755 | } | 1751 | } | ||
1756 | 1752 | | |||
1757 | void KisPainter::drawWuLine(const QPointF & start, const QPointF & end) | 1753 | void KisPainter::drawWuLine(const QPointF & start, const QPointF & end) | ||
1758 | { | 1754 | { | ||
1759 | KisRandomAccessorSP accessor = d->device->createRandomAccessorNG(start.x(), start.y()); | | |||
1760 | KisRandomConstAccessorSP selectionAccessor; | | |||
1761 | if (d->selection) { | | |||
1762 | selectionAccessor = d->selection->projection()->createRandomConstAccessorNG(start.x(), start.y()); | | |||
1763 | } | | |||
1764 | | ||||
1765 | KoColor lineColor(d->paintColor); | 1755 | KoColor lineColor(d->paintColor); | ||
1766 | 1756 | | |||
1767 | int x1 = start.x(); | 1757 | int x1 = qFloor(start.x()); | ||
1768 | int y1 = start.y(); | 1758 | int y1 = qFloor(start.y()); | ||
1769 | int x2 = end.x(); | 1759 | int x2 = qFloor(end.x()); | ||
1770 | int y2 = end.y(); | 1760 | int y2 = qFloor(end.y()); | ||
1771 | 1761 | | |||
1762 | KisRandomAccessorSP accessor = d->device->createRandomAccessorNG(x1, y1); | ||||
1763 | KisRandomConstAccessorSP selectionAccessor; | ||||
1764 | if (d->selection) { | ||||
1765 | selectionAccessor = d->selection->projection()->createRandomConstAccessorNG(x1, y1); | ||||
1766 | } | ||||
1772 | 1767 | | |||
1773 | float grad, xd, yd; | 1768 | float grad, xd, yd; | ||
1774 | float xgap, ygap, xend, yend, yf, xf; | 1769 | float xgap, ygap, xend, yend, yf, xf; | ||
1775 | float brightness1, brightness2; | 1770 | float brightness1, brightness2; | ||
1776 | 1771 | | |||
1777 | int ix1, ix2, iy1, iy2; | 1772 | int ix1, ix2, iy1, iy2; | ||
1778 | quint8 c1, c2; | 1773 | quint8 c1, c2; | ||
1779 | 1774 | | |||
Show All 38 Lines | 1798 | if (xd == 0) { | |||
1818 | } | 1813 | } | ||
1819 | return; | 1814 | return; | ||
1820 | } | 1815 | } | ||
1821 | 1816 | | |||
1822 | if (fabs(xd) > fabs(yd)) { | 1817 | if (fabs(xd) > fabs(yd)) { | ||
1823 | // horizontal line | 1818 | // horizontal line | ||
1824 | // line have to be paint from left to right | 1819 | // line have to be paint from left to right | ||
1825 | if (x1 > x2) { | 1820 | if (x1 > x2) { | ||
1826 | float tmp; | 1821 | std::swap(x1, x2); | ||
1827 | tmp = x1; x1 = x2; x2 = tmp; | 1822 | std::swap(y1, y2); | ||
1828 | tmp = y1; y1 = y2; y2 = tmp; | | |||
1829 | xd = (x2 - x1); | 1823 | xd = (x2 - x1); | ||
1830 | yd = (y2 - y1); | 1824 | yd = (y2 - y1); | ||
1831 | } | 1825 | } | ||
1832 | grad = yd / xd; | 1826 | grad = yd / xd; | ||
1833 | // nearest X,Y interger coordinates | 1827 | // nearest X,Y interger coordinates | ||
1834 | xend = static_cast<int>(x1 + 0.5f); | 1828 | xend = x1; | ||
1835 | yend = y1 + grad * (xend - x1); | 1829 | yend = y1 + grad * (xend - x1); | ||
1836 | 1830 | | |||
1837 | xgap = invertFrac(x1 + 0.5f); | 1831 | xgap = invertFrac(x1 + 0.5f); | ||
1838 | 1832 | | |||
1839 | ix1 = static_cast<int>(xend); | 1833 | ix1 = x1; | ||
1840 | iy1 = static_cast<int>(yend); | 1834 | iy1 = qFloor(yend); | ||
1841 | 1835 | | |||
1842 | // calc the intensity of the other end point pixel pair. | 1836 | // calc the intensity of the other end point pixel pair. | ||
1843 | brightness1 = invertFrac(yend) * xgap; | 1837 | brightness1 = invertFrac(yend) * xgap; | ||
1844 | brightness2 = frac(yend) * xgap; | 1838 | brightness2 = frac(yend) * xgap; | ||
1845 | 1839 | | |||
1846 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | 1840 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | ||
1847 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | 1841 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | ||
1848 | 1842 | | |||
Show All 11 Lines | |||||
1860 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 1854 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
1861 | lineColor.setOpacity(c2); | 1855 | lineColor.setOpacity(c2); | ||
1862 | compositeOnePixel(accessor->rawData(), lineColor); | 1856 | compositeOnePixel(accessor->rawData(), lineColor); | ||
1863 | } | 1857 | } | ||
1864 | 1858 | | |||
1865 | // calc first Y-intersection for main loop | 1859 | // calc first Y-intersection for main loop | ||
1866 | yf = yend + grad; | 1860 | yf = yend + grad; | ||
1867 | 1861 | | |||
1868 | xend = trunc(x2 + 0.5f); | 1862 | xend = x2; | ||
1869 | yend = y2 + grad * (xend - x2); | 1863 | yend = y2 + grad * (xend - x2); | ||
1870 | 1864 | | |||
1871 | xgap = invertFrac(x2 - 0.5f); | 1865 | xgap = invertFrac(x2 - 0.5f); | ||
1872 | 1866 | | |||
1873 | ix2 = static_cast<int>(xend); | 1867 | ix2 = x2; | ||
1874 | iy2 = static_cast<int>(yend); | 1868 | iy2 = qFloor(yend); | ||
1875 | 1869 | | |||
1876 | brightness1 = invertFrac(yend) * xgap; | 1870 | brightness1 = invertFrac(yend) * xgap; | ||
1877 | brightness2 = frac(yend) * xgap; | 1871 | brightness2 = frac(yend) * xgap; | ||
1878 | 1872 | | |||
1879 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | 1873 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | ||
1880 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | 1874 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | ||
1881 | 1875 | | |||
1882 | accessor->moveTo(ix2, iy2); | 1876 | accessor->moveTo(ix2, iy2); | ||
Show All 14 Lines | |||||
1897 | 1891 | | |||
1898 | // main loop | 1892 | // main loop | ||
1899 | for (int x = ix1 + 1; x <= ix2 - 1; x++) { | 1893 | for (int x = ix1 + 1; x <= ix2 - 1; x++) { | ||
1900 | brightness1 = invertFrac(yf); | 1894 | brightness1 = invertFrac(yf); | ||
1901 | brightness2 = frac(yf); | 1895 | brightness2 = frac(yf); | ||
1902 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | 1896 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | ||
1903 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | 1897 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | ||
1904 | 1898 | | |||
1905 | accessor->moveTo(x, int (yf)); | 1899 | accessor->moveTo(x, qFloor(yf)); | ||
1906 | if (selectionAccessor) selectionAccessor->moveTo(x, int (yf)); | 1900 | if (selectionAccessor) selectionAccessor->moveTo(x, qFloor(yf)); | ||
1907 | 1901 | | |||
1908 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 1902 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
1909 | lineColor.setOpacity(c1); | 1903 | lineColor.setOpacity(c1); | ||
1910 | compositeOnePixel(accessor->rawData(), lineColor); | 1904 | compositeOnePixel(accessor->rawData(), lineColor); | ||
1911 | } | 1905 | } | ||
1912 | 1906 | | |||
1913 | accessor->moveTo(x, int (yf) + 1); | 1907 | accessor->moveTo(x, qFloor(yf) + 1); | ||
1914 | if (selectionAccessor) selectionAccessor->moveTo(x, int (yf) + 1); | 1908 | if (selectionAccessor) selectionAccessor->moveTo(x, qFloor(yf) + 1); | ||
1915 | 1909 | | |||
1916 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 1910 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
1917 | lineColor.setOpacity(c2); | 1911 | lineColor.setOpacity(c2); | ||
1918 | compositeOnePixel(accessor->rawData(), lineColor); | 1912 | compositeOnePixel(accessor->rawData(), lineColor); | ||
1919 | } | 1913 | } | ||
1920 | 1914 | | |||
1921 | yf = yf + grad; | 1915 | yf = yf + grad; | ||
1922 | } | 1916 | } | ||
1923 | } else { | 1917 | } else { | ||
1924 | //vertical | 1918 | //vertical | ||
1925 | // line have to be painted from left to right | 1919 | // line have to be painted from left to right | ||
1926 | if (y1 > y2) { | 1920 | if (y1 > y2) { | ||
1927 | float tmp; | 1921 | std::swap(x1, x2); | ||
1928 | tmp = x1; x1 = x2; x2 = tmp; | 1922 | std::swap(y1, y2); | ||
1929 | tmp = y1; y1 = y2; y2 = tmp; | | |||
1930 | xd = (x2 - x1); | 1923 | xd = (x2 - x1); | ||
1931 | yd = (y2 - y1); | 1924 | yd = (y2 - y1); | ||
1932 | } | 1925 | } | ||
1933 | 1926 | | |||
1934 | grad = xd / yd; | 1927 | grad = xd / yd; | ||
1935 | 1928 | | |||
1936 | // nearest X,Y interger coordinates | 1929 | // nearest X,Y interger coordinates | ||
1937 | yend = static_cast<int>(y1 + 0.5f); | 1930 | yend = y1; | ||
1938 | xend = x1 + grad * (yend - y1); | 1931 | xend = x1 + grad * (yend - y1); | ||
1939 | 1932 | | |||
1940 | ygap = invertFrac(y1 + 0.5f); | 1933 | ygap = y1; | ||
1941 | 1934 | | |||
1942 | ix1 = static_cast<int>(xend); | 1935 | ix1 = qFloor(xend); | ||
1943 | iy1 = static_cast<int>(yend); | 1936 | iy1 = y1; | ||
1944 | 1937 | | |||
1945 | // calc the intensity of the other end point pixel pair. | 1938 | // calc the intensity of the other end point pixel pair. | ||
1946 | brightness1 = invertFrac(xend) * ygap; | 1939 | brightness1 = invertFrac(xend) * ygap; | ||
1947 | brightness2 = frac(xend) * ygap; | 1940 | brightness2 = frac(xend) * ygap; | ||
1948 | 1941 | | |||
1949 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | 1942 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | ||
1950 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | 1943 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | ||
1951 | 1944 | | |||
Show All 11 Lines | |||||
1963 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 1956 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
1964 | lineColor.setOpacity(c2); | 1957 | lineColor.setOpacity(c2); | ||
1965 | compositeOnePixel(accessor->rawData(), lineColor); | 1958 | compositeOnePixel(accessor->rawData(), lineColor); | ||
1966 | } | 1959 | } | ||
1967 | 1960 | | |||
1968 | // calc first Y-intersection for main loop | 1961 | // calc first Y-intersection for main loop | ||
1969 | xf = xend + grad; | 1962 | xf = xend + grad; | ||
1970 | 1963 | | |||
1971 | yend = trunc(y2 + 0.5f); | 1964 | yend = y2; | ||
1972 | xend = x2 + grad * (yend - y2); | 1965 | xend = x2 + grad * (yend - y2); | ||
1973 | 1966 | | |||
1974 | ygap = invertFrac(y2 - 0.5f); | 1967 | ygap = invertFrac(y2 - 0.5f); | ||
1975 | 1968 | | |||
1976 | ix2 = static_cast<int>(xend); | 1969 | ix2 = qFloor(xend); | ||
1977 | iy2 = static_cast<int>(yend); | 1970 | iy2 = y2; | ||
1978 | 1971 | | |||
1979 | brightness1 = invertFrac(xend) * ygap; | 1972 | brightness1 = invertFrac(xend) * ygap; | ||
1980 | brightness2 = frac(xend) * ygap; | 1973 | brightness2 = frac(xend) * ygap; | ||
1981 | 1974 | | |||
1982 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | 1975 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | ||
1983 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | 1976 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | ||
1984 | 1977 | | |||
1985 | accessor->moveTo(ix2, iy2); | 1978 | accessor->moveTo(ix2, iy2); | ||
Show All 14 Lines | |||||
2000 | 1993 | | |||
2001 | // main loop | 1994 | // main loop | ||
2002 | for (int y = iy1 + 1; y <= iy2 - 1; y++) { | 1995 | for (int y = iy1 + 1; y <= iy2 - 1; y++) { | ||
2003 | brightness1 = invertFrac(xf); | 1996 | brightness1 = invertFrac(xf); | ||
2004 | brightness2 = frac(xf); | 1997 | brightness2 = frac(xf); | ||
2005 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | 1998 | c1 = (int)(brightness1 * OPACITY_OPAQUE_U8); | ||
2006 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | 1999 | c2 = (int)(brightness2 * OPACITY_OPAQUE_U8); | ||
2007 | 2000 | | |||
2008 | accessor->moveTo(int (xf), y); | 2001 | accessor->moveTo(qFloor(xf), y); | ||
2009 | if (selectionAccessor) selectionAccessor->moveTo(int (xf), y); | 2002 | if (selectionAccessor) selectionAccessor->moveTo(qFloor(xf), y); | ||
2010 | 2003 | | |||
2011 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2004 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2012 | lineColor.setOpacity(c1); | 2005 | lineColor.setOpacity(c1); | ||
2013 | compositeOnePixel(accessor->rawData(), lineColor); | 2006 | compositeOnePixel(accessor->rawData(), lineColor); | ||
2014 | } | 2007 | } | ||
2015 | 2008 | | |||
2016 | accessor->moveTo(int (xf) + 1, y); | 2009 | accessor->moveTo(qFloor(xf) + 1, y); | ||
2017 | if (selectionAccessor) selectionAccessor->moveTo(int (xf) + 1, y); | 2010 | if (selectionAccessor) selectionAccessor->moveTo(qFloor(xf) + 1, y); | ||
2018 | 2011 | | |||
2019 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2012 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2020 | lineColor.setOpacity(c2); | 2013 | lineColor.setOpacity(c2); | ||
2021 | compositeOnePixel(accessor->rawData(), lineColor); | 2014 | compositeOnePixel(accessor->rawData(), lineColor); | ||
2022 | } | 2015 | } | ||
2023 | 2016 | | |||
2024 | xf = xf + grad; | 2017 | xf = xf + grad; | ||
2025 | } | 2018 | } | ||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Line(s) | 2175 | if (horizontal) { // horizontal-ish lines | |||
2199 | 2192 | | |||
2200 | ix1 = x0; iy1 = y0; | 2193 | ix1 = x0; iy1 = y0; | ||
2201 | ix2 = x1; iy2 = y1; | 2194 | ix2 = x1; iy2 = y1; | ||
2202 | 2195 | | |||
2203 | yfa = y0a + grada; | 2196 | yfa = y0a + grada; | ||
2204 | yfb = y0b + gradb; | 2197 | yfb = y0b + gradb; | ||
2205 | 2198 | | |||
2206 | for (x = ix1 + 1; x <= ix2 - 1; x++) { | 2199 | for (x = ix1 + 1; x <= ix2 - 1; x++) { | ||
2207 | fraca = yfa - int (yfa); | 2200 | fraca = yfa - qFloor(yfa); | ||
2208 | b1a = 1 - fraca; | 2201 | b1a = 1 - fraca; | ||
2209 | b2a = fraca; | 2202 | b2a = fraca; | ||
2210 | 2203 | | |||
2211 | fracb = yfb - int (yfb); | 2204 | fracb = yfb - qFloor(yfb); | ||
2212 | b1b = 1 - fracb; | 2205 | b1b = 1 - fracb; | ||
2213 | b2b = fracb; | 2206 | b2b = fracb; | ||
2214 | 2207 | | |||
2215 | // color first pixel of bottom line | 2208 | // color first pixel of bottom line | ||
2216 | opacity = ((x - ix1) / dstX) * c2.opacityF() + (1 - (x - ix1) / dstX) * c1.opacityF(); | 2209 | opacity = ((x - ix1) / dstX) * c2.opacityF() + (1 - (x - ix1) / dstX) * c1.opacityF(); | ||
2217 | c3.setOpacity(opacity); | 2210 | c3.setOpacity(opacity); | ||
2218 | 2211 | | |||
2219 | accessor->moveTo(x, (int)yfa); | 2212 | accessor->moveTo(x, qFloor(yfa)); | ||
2220 | if (selectionAccessor) selectionAccessor->moveTo(x, (int)yfa); | 2213 | if (selectionAccessor) selectionAccessor->moveTo(x, qFloor(yfa)); | ||
2221 | 2214 | | |||
2222 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2215 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2223 | qreal alpha = cs->opacityF(accessor->rawData()); | 2216 | qreal alpha = cs->opacityF(accessor->rawData()); | ||
2224 | opacity = b1a * c3.opacityF() + (1 - b1a) * alpha; | 2217 | opacity = b1a * c3.opacityF() + (1 - b1a) * alpha; | ||
2225 | col1.setOpacity(opacity); | 2218 | col1.setOpacity(opacity); | ||
2226 | compositeOnePixel(accessor->rawData(), col1); | 2219 | compositeOnePixel(accessor->rawData(), col1); | ||
2227 | } | 2220 | } | ||
2228 | 2221 | | |||
2229 | // color first pixel of top line | 2222 | // color first pixel of top line | ||
2230 | if (!(startWidth == 1 && endWidth == 1)) { | 2223 | if (!(startWidth == 1 && endWidth == 1)) { | ||
2231 | accessor->moveTo(x, (int)yfb); | 2224 | accessor->moveTo(x, qFloor(yfb)); | ||
2232 | if (selectionAccessor) selectionAccessor->moveTo(x, (int)yfb); | 2225 | if (selectionAccessor) selectionAccessor->moveTo(x, qFloor(yfb)); | ||
2233 | 2226 | | |||
2234 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2227 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2235 | qreal alpha = cs->opacityF(accessor->rawData()); | 2228 | qreal alpha = cs->opacityF(accessor->rawData()); | ||
2236 | opacity = b1b * c3.opacityF() + (1 - b1b) * alpha; | 2229 | opacity = b1b * c3.opacityF() + (1 - b1b) * alpha; | ||
2237 | col1.setOpacity(opacity); | 2230 | col1.setOpacity(opacity); | ||
2238 | compositeOnePixel(accessor->rawData(), col1); | 2231 | compositeOnePixel(accessor->rawData(), col1); | ||
2239 | } | 2232 | } | ||
2240 | } | 2233 | } | ||
2241 | 2234 | | |||
2242 | // color second pixel of bottom line | 2235 | // color second pixel of bottom line | ||
2243 | if (grada != 0 && grada != 1) { // if not flat or exact diagonal | 2236 | if (grada != 0 && grada != 1) { // if not flat or exact diagonal | ||
2244 | 2237 | | |||
2245 | accessor->moveTo(x, int (yfa) + 1); | 2238 | accessor->moveTo(x, qFloor(yfa) + 1); | ||
2246 | if (selectionAccessor) selectionAccessor->moveTo(x, int (yfa) + 1); | 2239 | if (selectionAccessor) selectionAccessor->moveTo(x, qFloor(yfa) + 1); | ||
2247 | 2240 | | |||
2248 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2241 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2249 | qreal alpha = cs->opacityF(accessor->rawData()); | 2242 | qreal alpha = cs->opacityF(accessor->rawData()); | ||
2250 | opacity = b2a * c3.opacityF() + (1 - b2a) * alpha; | 2243 | opacity = b2a * c3.opacityF() + (1 - b2a) * alpha; | ||
2251 | col2.setOpacity(opacity); | 2244 | col2.setOpacity(opacity); | ||
2252 | compositeOnePixel(accessor->rawData(), col2); | 2245 | compositeOnePixel(accessor->rawData(), col2); | ||
2253 | } | 2246 | } | ||
2254 | 2247 | | |||
2255 | } | 2248 | } | ||
2256 | 2249 | | |||
2257 | // color second pixel of top line | 2250 | // color second pixel of top line | ||
2258 | if (gradb != 0 && gradb != 1 && !(startWidth == 1 && endWidth == 1)) { | 2251 | if (gradb != 0 && gradb != 1 && !(startWidth == 1 && endWidth == 1)) { | ||
2259 | 2252 | | |||
2260 | accessor->moveTo(x, int (yfb) + 1); | 2253 | accessor->moveTo(x, qFloor(yfb) + 1); | ||
2261 | if (selectionAccessor) selectionAccessor->moveTo(x, int (yfb) + 1); | 2254 | if (selectionAccessor) selectionAccessor->moveTo(x, qFloor(yfb) + 1); | ||
2262 | 2255 | | |||
2263 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2256 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2264 | qreal alpha = cs->opacityF(accessor->rawData()); | 2257 | qreal alpha = cs->opacityF(accessor->rawData()); | ||
2265 | opacity = b2b * c3.opacityF() + (1 - b2b) * alpha; | 2258 | opacity = b2b * c3.opacityF() + (1 - b2b) * alpha; | ||
2266 | col2.setOpacity(opacity); | 2259 | col2.setOpacity(opacity); | ||
2267 | compositeOnePixel(accessor->rawData(), col2); | 2260 | compositeOnePixel(accessor->rawData(), col2); | ||
2268 | } | 2261 | } | ||
2269 | 2262 | | |||
2270 | } | 2263 | } | ||
2271 | 2264 | | |||
2272 | // fill remaining pixels | 2265 | // fill remaining pixels | ||
2273 | if (!(startWidth == 1 && endWidth == 1)) { | 2266 | if (!(startWidth == 1 && endWidth == 1)) { | ||
2274 | if (yfa < yfb) | 2267 | if (yfa < yfb) | ||
2275 | for (int i = yfa + 1; i <= yfb; i++) { | 2268 | for (int i = qFloor(yfa) + 1; i <= qFloor(yfb); i++) { | ||
2276 | 2269 | | |||
2277 | accessor->moveTo(x, i); | 2270 | accessor->moveTo(x, i); | ||
2278 | if (selectionAccessor) selectionAccessor->moveTo(x, i); | 2271 | if (selectionAccessor) selectionAccessor->moveTo(x, i); | ||
2279 | 2272 | | |||
2280 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2273 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2281 | compositeOnePixel(accessor->rawData(), c3); | 2274 | compositeOnePixel(accessor->rawData(), c3); | ||
2282 | } | 2275 | } | ||
2283 | } | 2276 | } | ||
2284 | else | 2277 | else | ||
2285 | for (int i = yfa + 1; i >= yfb; i--) { | 2278 | for (int i = qFloor(yfa) + 1; i >= qFloor(yfb); i--) { | ||
2286 | 2279 | | |||
2287 | accessor->moveTo(x, i); | 2280 | accessor->moveTo(x, i); | ||
2288 | if (selectionAccessor) selectionAccessor->moveTo(x, i); | 2281 | if (selectionAccessor) selectionAccessor->moveTo(x, i); | ||
2289 | 2282 | | |||
2290 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2283 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2291 | compositeOnePixel(accessor->rawData(), c3); | 2284 | compositeOnePixel(accessor->rawData(), c3); | ||
2292 | } | 2285 | } | ||
2293 | } | 2286 | } | ||
Show All 23 Lines | 2293 | } else { // vertical-ish lines | |||
2317 | 2310 | | |||
2318 | ix1 = x0; iy1 = y0; | 2311 | ix1 = x0; iy1 = y0; | ||
2319 | ix2 = x1; iy2 = y1; | 2312 | ix2 = x1; iy2 = y1; | ||
2320 | 2313 | | |||
2321 | xfa = x0a + grada; | 2314 | xfa = x0a + grada; | ||
2322 | xfb = x0b + gradb; | 2315 | xfb = x0b + gradb; | ||
2323 | 2316 | | |||
2324 | for (y = iy1 + 1; y <= iy2 - 1; y++) { | 2317 | for (y = iy1 + 1; y <= iy2 - 1; y++) { | ||
2325 | fraca = xfa - int (xfa); | 2318 | fraca = xfa - qFloor(xfa); | ||
2326 | b1a = 1 - fraca; | 2319 | b1a = 1 - fraca; | ||
2327 | b2a = fraca; | 2320 | b2a = fraca; | ||
2328 | 2321 | | |||
2329 | fracb = xfb - int (xfb); | 2322 | fracb = xfb - qFloor(xfb); | ||
2330 | b1b = 1 - fracb; | 2323 | b1b = 1 - fracb; | ||
2331 | b2b = fracb; | 2324 | b2b = fracb; | ||
2332 | 2325 | | |||
2333 | // color first pixel of left line | 2326 | // color first pixel of left line | ||
2334 | opacity = ((y - iy1) / dstY) * c2.opacityF() + (1 - (y - iy1) / dstY) * c1.opacityF(); | 2327 | opacity = ((y - iy1) / dstY) * c2.opacityF() + (1 - (y - iy1) / dstY) * c1.opacityF(); | ||
2335 | c3.setOpacity(opacity); | 2328 | c3.setOpacity(opacity); | ||
2336 | 2329 | | |||
2337 | accessor->moveTo(int (xfa), y); | 2330 | accessor->moveTo(qFloor(xfa), y); | ||
2338 | if (selectionAccessor) selectionAccessor->moveTo(int (xfa), y); | 2331 | if (selectionAccessor) selectionAccessor->moveTo(qFloor(xfa), y); | ||
2339 | 2332 | | |||
2340 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2333 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2341 | qreal alpha = cs->opacityF(accessor->rawData()); | 2334 | qreal alpha = cs->opacityF(accessor->rawData()); | ||
2342 | opacity = b1a * c3.opacityF() + (1 - b1a) * alpha; | 2335 | opacity = b1a * c3.opacityF() + (1 - b1a) * alpha; | ||
2343 | col1.setOpacity(opacity); | 2336 | col1.setOpacity(opacity); | ||
2344 | compositeOnePixel(accessor->rawData(), col1); | 2337 | compositeOnePixel(accessor->rawData(), col1); | ||
2345 | } | 2338 | } | ||
2346 | 2339 | | |||
2347 | // color first pixel of right line | 2340 | // color first pixel of right line | ||
2348 | if (!(startWidth == 1 && endWidth == 1)) { | 2341 | if (!(startWidth == 1 && endWidth == 1)) { | ||
2349 | 2342 | | |||
2350 | accessor->moveTo(int(xfb), y); | 2343 | accessor->moveTo(qFloor(xfb), y); | ||
2351 | if (selectionAccessor) selectionAccessor->moveTo(int(xfb), y); | 2344 | if (selectionAccessor) selectionAccessor->moveTo(qFloor(xfb), y); | ||
2352 | 2345 | | |||
2353 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2346 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2354 | qreal alpha = cs->opacityF(accessor->rawData()); | 2347 | qreal alpha = cs->opacityF(accessor->rawData()); | ||
2355 | opacity = b1b * c3.opacityF() + (1 - b1b) * alpha; | 2348 | opacity = b1b * c3.opacityF() + (1 - b1b) * alpha; | ||
2356 | col1.setOpacity(opacity); | 2349 | col1.setOpacity(opacity); | ||
2357 | compositeOnePixel(accessor->rawData(), col1); | 2350 | compositeOnePixel(accessor->rawData(), col1); | ||
2358 | } | 2351 | } | ||
2359 | } | 2352 | } | ||
2360 | 2353 | | |||
2361 | // color second pixel of left line | 2354 | // color second pixel of left line | ||
2362 | if (grada != 0 && grada != 1) { // if not flat or exact diagonal | 2355 | if (grada != 0 && grada != 1) { // if not flat or exact diagonal | ||
2363 | 2356 | | |||
2364 | accessor->moveTo(int(xfa) + 1, y); | 2357 | accessor->moveTo(qFloor(xfa) + 1, y); | ||
2365 | if (selectionAccessor) selectionAccessor->moveTo(int(xfa) + 1, y); | 2358 | if (selectionAccessor) selectionAccessor->moveTo(qFloor(xfa) + 1, y); | ||
2366 | 2359 | | |||
2367 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2360 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2368 | qreal alpha = cs->opacityF(accessor->rawData()); | 2361 | qreal alpha = cs->opacityF(accessor->rawData()); | ||
2369 | opacity = b2a * c3.opacityF() + (1 - b2a) * alpha; | 2362 | opacity = b2a * c3.opacityF() + (1 - b2a) * alpha; | ||
2370 | col2.setOpacity(opacity); | 2363 | col2.setOpacity(opacity); | ||
2371 | compositeOnePixel(accessor->rawData(), col2); | 2364 | compositeOnePixel(accessor->rawData(), col2); | ||
2372 | } | 2365 | } | ||
2373 | 2366 | | |||
2374 | } | 2367 | } | ||
2375 | 2368 | | |||
2376 | // color second pixel of right line | 2369 | // color second pixel of right line | ||
2377 | if (gradb != 0 && gradb != 1 && !(startWidth == 1 && endWidth == 1)) { | 2370 | if (gradb != 0 && gradb != 1 && !(startWidth == 1 && endWidth == 1)) { | ||
2378 | 2371 | | |||
2379 | accessor->moveTo(int(xfb) + 1, y); | 2372 | accessor->moveTo(qFloor(xfb) + 1, y); | ||
2380 | if (selectionAccessor) selectionAccessor->moveTo(int(xfb) + 1, y); | 2373 | if (selectionAccessor) selectionAccessor->moveTo(qFloor(xfb) + 1, y); | ||
2381 | 2374 | | |||
2382 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2375 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2383 | qreal alpha = cs->opacityF(accessor->rawData()); | 2376 | qreal alpha = cs->opacityF(accessor->rawData()); | ||
2384 | opacity = b2b * c3.opacityF() + (1 - b2b) * alpha; | 2377 | opacity = b2b * c3.opacityF() + (1 - b2b) * alpha; | ||
2385 | col2.setOpacity(opacity); | 2378 | col2.setOpacity(opacity); | ||
2386 | compositeOnePixel(accessor->rawData(), col2); | 2379 | compositeOnePixel(accessor->rawData(), col2); | ||
2387 | } | 2380 | } | ||
2388 | } | 2381 | } | ||
2389 | 2382 | | |||
2390 | // fill remaining pixels between current xfa,xfb | 2383 | // fill remaining pixels between current xfa,xfb | ||
2391 | if (!(startWidth == 1 && endWidth == 1)) { | 2384 | if (!(startWidth == 1 && endWidth == 1)) { | ||
2392 | if (xfa < xfb) | 2385 | if (xfa < xfb) | ||
2393 | for (int i = (int) xfa + 1; i <= (int) xfb; i++) { | 2386 | for (int i = qFloor(xfa) + 1; i <= qFloor(xfb); i++) { | ||
2394 | 2387 | | |||
2395 | accessor->moveTo(i, y); | 2388 | accessor->moveTo(i, y); | ||
2396 | if (selectionAccessor) selectionAccessor->moveTo(i, y); | 2389 | if (selectionAccessor) selectionAccessor->moveTo(i, y); | ||
2397 | 2390 | | |||
2398 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2391 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2399 | compositeOnePixel(accessor->rawData(), c3); | 2392 | compositeOnePixel(accessor->rawData(), c3); | ||
2400 | } | 2393 | } | ||
2401 | } | 2394 | } | ||
2402 | else | 2395 | else | ||
2403 | for (int i = (int) xfb; i <= (int) xfa + 1; i++) { | 2396 | for (int i = qFloor(xfb); i <= qFloor(xfa) + 1; i++) { | ||
2404 | 2397 | | |||
2405 | accessor->moveTo(i, y); | 2398 | accessor->moveTo(i, y); | ||
2406 | if (selectionAccessor) selectionAccessor->moveTo(i, y); | 2399 | if (selectionAccessor) selectionAccessor->moveTo(i, y); | ||
2407 | 2400 | | |||
2408 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | 2401 | if (!selectionAccessor || *selectionAccessor->oldRawData() > SELECTION_THRESHOLD) { | ||
2409 | compositeOnePixel(accessor->rawData(), c3); | 2402 | compositeOnePixel(accessor->rawData(), c3); | ||
2410 | } | 2403 | } | ||
2411 | } | 2404 | } | ||
▲ Show 20 Lines • Show All 495 Lines • Show Last 20 Lines |