MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuImageDraw

Function PiuImageDraw

modules/piu/MC/colorcell/piuImage.c:94–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void PiuImageDraw(void* it, PiuView* view, PiuRectangle area)
95{
96 PiuImage* self = it;
97 PiuContentDraw(it, view, area);
98 if ((*self)->data) {
99 PiuRectangleRecord bounds;
100 PiuRectangleSet(&bounds, 0, 0, (*self)->bounds.width, (*self)->bounds.height);
101 PiuViewPushClip(view, 0, 0, bounds.width, bounds.height);
102#ifdef piuGPU
103 {
104 PocoBitmapRecord bm;
105 if ((*self)->frameChanged) {
106 (*self)->frameChanged = 0;
107 PocoBitmapChanged((*view)->poco, (*self)->frameID, PiuViewReceiver, view);
108 }
109 bm.width = (*self)->dataWidth;
110 bm.height = (*self)->dataHeight;
111 bm.format = (*self)->frameFormat;
112 bm.pixels = (PocoPixel*)((*self)->data + sizeof(uint16_t) + (*self)->frameOffset);
113 bm.id = (*self)->frameID;
114 bm.byteLength = (bm.format == (kCommodettoBitmapRGB565LE | kCommodettoBitmapPacked)) ? 0 : (*self)->frameSize;
115 PocoDrawImage((*view)->poco, &bm, 255, (*view)->poco->xOrigin, (*view)->poco->yOrigin, bounds.width, bounds.height, 0, 0, (*self)->dataWidth, (*self)->dataHeight);
116 }
117#else
118 PiuViewDrawContent(view, PiuImageDrawAux, it, 0, 0, (*self)->dataWidth, (*self)->dataHeight);
119#endif
120 PiuViewPopClip(view);
121 }
122}
123
124void PiuImageDrawAux(void* it, PiuView* view, PiuCoordinate x, PiuCoordinate y, PiuDimension sw, PiuDimension sh)
125{

Callers

nothing calls this directly

Calls 5

PiuContentDrawFunction · 0.85
PiuRectangleSetFunction · 0.85
PiuViewPushClipFunction · 0.50
PiuViewDrawContentFunction · 0.50
PiuViewPopClipFunction · 0.50

Tested by

no test coverage detected