Files
Upsilon/kandinsky/src/context_pixel.cpp
Romain Goyet 5de28e01db Migrate Kandinsky to C++
Change-Id: I2752a8db84ad0bb817119cf6c2993c1622621150
2016-07-21 13:42:32 +02:00

19 lines
511 B
C++

#include <kandinsky/context.h>
void KDContext::setPixel(KDPoint p, KDColor c) {
KDPoint absolutePoint = p.translatedBy(m_origin);
if (m_clippingRect.contains(absolutePoint)) {
pushRect(KDRect(absolutePoint, 1, 1), &c);
}
}
KDColor KDContext::getPixel(KDPoint p) {
KDPoint absolutePoint = p.translatedBy(m_origin);
if (m_clippingRect.contains(absolutePoint)) {
KDColor result = KDColorBlack;
pullRect(KDRect(absolutePoint, 1, 1), &result);
return result;
}
return KDColorBlack;
}