diff options
author | Timothy Pearson <[email protected]> | 2012-09-17 18:17:30 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-09-17 18:17:30 -0500 |
commit | 467876d56afdf133bdce18b7a1ed13a303e82703 (patch) | |
tree | ec544cb9f023b3ba18a4ab5612734f3b9a303093 /tdegtk | |
parent | 2cec804e02eca375250dcd9689a31ab91e4505d9 (diff) | |
download | gtk3-tqt-engine-467876d56afdf133bdce18b7a1ed13a303e82703.tar.gz gtk3-tqt-engine-467876d56afdf133bdce18b7a1ed13a303e82703.zip |
Implement remaining raster operations
Diffstat (limited to 'tdegtk')
-rw-r--r-- | tdegtk/tqtcairopainter.cpp | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/tdegtk/tqtcairopainter.cpp b/tdegtk/tqtcairopainter.cpp index f45bce2..44b1895 100644 --- a/tdegtk/tqtcairopainter.cpp +++ b/tdegtk/tqtcairopainter.cpp @@ -181,12 +181,96 @@ void TQt3CairoPaintDevice::transferIntermediateSurface() { devicePixel_b = (*(device_surface_data+offset+ARGB_B_BYTE_NUMBER)); // Perform requested bitwise operation - if (m_rop == TQPainter::XorROP) { + if (m_rop == TQPainter::OrROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = devicePixel_r | intermediatePixel_r; + combinedPixel_g = devicePixel_g | intermediatePixel_g; + combinedPixel_b = devicePixel_b | intermediatePixel_b; + } + else if (m_rop == TQPainter::XorROP) { combinedPixel_a = devicePixel_a; combinedPixel_r = devicePixel_r ^ intermediatePixel_r; combinedPixel_g = devicePixel_g ^ intermediatePixel_g; combinedPixel_b = devicePixel_b ^ intermediatePixel_b; } + else if (m_rop == TQPainter::NotAndROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = devicePixel_r & (~intermediatePixel_r); + combinedPixel_g = devicePixel_g & (~intermediatePixel_g); + combinedPixel_b = devicePixel_b & (~intermediatePixel_b); + } + else if (m_rop == TQPainter::NotCopyROP) { + combinedPixel_a = intermediatePixel_a; + combinedPixel_r = ~intermediatePixel_r; + combinedPixel_g = ~intermediatePixel_g; + combinedPixel_b = ~intermediatePixel_b; + } + else if (m_rop == TQPainter::NotOrROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = devicePixel_r | (~intermediatePixel_r); + combinedPixel_g = devicePixel_g | (~intermediatePixel_g); + combinedPixel_b = devicePixel_b | (~intermediatePixel_b); + } + else if (m_rop == TQPainter::NotXorROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = devicePixel_r ^ (~intermediatePixel_r); + combinedPixel_g = devicePixel_g ^ (~intermediatePixel_g); + combinedPixel_b = devicePixel_b ^ (~intermediatePixel_b); + } + else if (m_rop == TQPainter::AndROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = devicePixel_r & intermediatePixel_r; + combinedPixel_g = devicePixel_g & intermediatePixel_g; + combinedPixel_b = devicePixel_b & intermediatePixel_b; + } + else if (m_rop == TQPainter::NotROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = ~devicePixel_r; + combinedPixel_g = ~devicePixel_g; + combinedPixel_b = ~devicePixel_b; + } + else if (m_rop == TQPainter::ClearROP) { + combinedPixel_a = 0x0; + combinedPixel_r = 0x0; + combinedPixel_g = 0x0; + combinedPixel_b = 0x0; + } + else if (m_rop == TQPainter::SetROP) { + combinedPixel_a = 0xff; + combinedPixel_r = 0xff; + combinedPixel_g = 0xff; + combinedPixel_b = 0xff; + } + else if (m_rop == TQPainter::NopROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = devicePixel_r; + combinedPixel_g = devicePixel_g; + combinedPixel_b = devicePixel_b; + } + else if (m_rop == TQPainter::AndNotROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = (~devicePixel_r) & intermediatePixel_r; + combinedPixel_g = (~devicePixel_g) & intermediatePixel_g; + combinedPixel_b = (~devicePixel_b) & intermediatePixel_b; + } + else if (m_rop == TQPainter::OrNotROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = (~devicePixel_r) | intermediatePixel_r; + combinedPixel_g = (~devicePixel_g) | intermediatePixel_g; + combinedPixel_b = (~devicePixel_b) | intermediatePixel_b; + } + else if (m_rop == TQPainter::NandROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = ~(devicePixel_r & intermediatePixel_r); + combinedPixel_g = ~(devicePixel_g & intermediatePixel_g); + combinedPixel_b = ~(devicePixel_b & intermediatePixel_b); + } + else if (m_rop == TQPainter::NorROP) { + combinedPixel_a = devicePixel_a; + combinedPixel_r = ~(devicePixel_r | intermediatePixel_r); + combinedPixel_g = ~(devicePixel_g | intermediatePixel_g); + combinedPixel_b = ~(devicePixel_b | intermediatePixel_b); + } else { tqWarning("TQt3CairoPaintDevice::cmd: Unhandled raster operation [Was attempting to use raster operation %d\n\r", m_rop); combinedPixel_a = devicePixel_a; |