Blame view

build3/kandinsky/src/context_pixel.cpp 511 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #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;
  }