Numworks Epsilon
1.4.1
Graphing Calculator Operating System
context_pixel.cpp
Go to the documentation of this file.
1
#include <
kandinsky/context.h
>
2
3
void
KDContext::setPixel
(
KDPoint
p,
KDColor
c
) {
4
KDPoint
absolutePoint = p.
translatedBy
(m_origin);
5
if
(m_clippingRect.
contains
(absolutePoint)) {
6
pushRect
(
KDRect
(absolutePoint, 1, 1), &
c
);
7
}
8
}
9
10
KDColor
KDContext::getPixel
(
KDPoint
p) {
11
KDPoint
absolutePoint = p.
translatedBy
(m_origin);
12
if
(m_clippingRect.
contains
(absolutePoint)) {
13
KDColor
result =
KDColorBlack
;
14
pullRect
(
KDRect
(absolutePoint, 1, 1), &result);
15
return
result;
16
}
17
return
KDColorBlack
;
18
}
context.h
KDContext::setPixel
void setPixel(KDPoint p, KDColor c)
Definition:
context_pixel.cpp:3
KDRect::contains
bool contains(KDPoint p) const
Definition:
rect.cpp:104
KDPoint
Definition:
point.h:6
c
c(generic_all_nodes)
KDContext::pullRect
virtual void pullRect(KDRect rect, KDColor *pixels)=0
KDContext::pushRect
virtual void pushRect(KDRect, const KDColor *pixels)=0
KDColorBlack
constexpr KDColor KDColorBlack
Definition:
color.h:41
KDRect
Definition:
rect.h:26
KDColor
Definition:
color.h:6
KDPoint::translatedBy
KDPoint translatedBy(KDPoint other) const
Definition:
point.cpp:3
KDContext::getPixel
KDColor getPixel(KDPoint p)
Definition:
context_pixel.cpp:10
epsilon
kandinsky
src
context_pixel.cpp
Generated by
1.8.14