Numworks Epsilon
1.4.1
Graphing Calculator Operating System
image_view.cpp
Go to the documentation of this file.
1
#include <
escher/image_view.h
>
2
extern
"C"
{
3
#include <
assert.h
>
4
}
5
6
ImageView::ImageView
() :
7
View
(),
8
m_image(nullptr)
9
{
10
}
11
12
void
ImageView::drawRect
(
KDContext
* ctx,
KDRect
rect)
const
{
13
if
(m_image ==
nullptr
) {
14
return
;
15
}
16
assert
(
bounds
().width() == m_image->
width
());
17
assert
(
bounds
().height() == m_image->
height
());
18
ctx->
fillRectWithPixels
(
bounds
(), m_image->
pixels
(),
nullptr
);
19
}
20
21
void
ImageView::setImage
(
const
Image
* image) {
22
if
(image != m_image) {
23
m_image = image;
24
markRectAsDirty
(
bounds
());
25
}
26
}
assert
#define assert(e)
Definition:
assert.h:9
View::markRectAsDirty
void markRectAsDirty(KDRect rect)
Definition:
view.cpp:39
Image
Definition:
image.h:6
assert.h
KDContext
Definition:
context.h:8
KDContext::fillRectWithPixels
void fillRectWithPixels(KDRect rect, const KDColor *pixels, KDColor *workingBuffer)
Definition:
context_rect.cpp:17
ImageView::setImage
void setImage(const Image *image)
Definition:
image_view.cpp:21
Image::width
KDCoordinate width() const
Definition:
image.h:10
image_view.h
KDRect
Definition:
rect.h:26
ImageView::ImageView
ImageView()
Definition:
image_view.cpp:6
View
Definition:
view.h:23
Image::pixels
const KDColor * pixels() const
Definition:
image.h:12
Image::height
KDCoordinate height() const
Definition:
image.h:11
View::bounds
KDRect bounds() const
Definition:
view.cpp:157
ImageView::drawRect
void drawRect(KDContext *ctx, KDRect rect) const override
Definition:
image_view.cpp:12
epsilon
escher
src
image_view.cpp
Generated by
1.8.14