Implement remaining raster operations

pull/1/head
Timothy Pearson 12 years ago
parent 2cec804e02
commit 467876d56a

@ -181,12 +181,96 @@ void TQt3CairoPaintDevice::transferIntermediateSurface() {
devicePixel_b = (*(device_surface_data+offset+ARGB_B_BYTE_NUMBER)); devicePixel_b = (*(device_surface_data+offset+ARGB_B_BYTE_NUMBER));
// Perform requested bitwise operation // 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_a = devicePixel_a;
combinedPixel_r = devicePixel_r ^ intermediatePixel_r; combinedPixel_r = devicePixel_r ^ intermediatePixel_r;
combinedPixel_g = devicePixel_g ^ intermediatePixel_g; combinedPixel_g = devicePixel_g ^ intermediatePixel_g;
combinedPixel_b = devicePixel_b ^ intermediatePixel_b; 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 { else {
tqWarning("TQt3CairoPaintDevice::cmd: Unhandled raster operation [Was attempting to use raster operation %d\n\r", m_rop); tqWarning("TQt3CairoPaintDevice::cmd: Unhandled raster operation [Was attempting to use raster operation %d\n\r", m_rop);
combinedPixel_a = devicePixel_a; combinedPixel_a = devicePixel_a;

Loading…
Cancel
Save