MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / drawFullImage

Method drawFullImage

examples/pframe/ImageManager.cpp:38–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 */
37
38bool ImageManager::drawFullImage() {
39
40 uint32_t blockIndex,i;
41 uint16_t blocks[512];
42
43 // get the first block. There are two blocks per scan line.
44
45 blockIndex=_bmManager.getFirstBlockIndex(_currentImage);
46
47 // get the display device
48
49 LcdManager::LcdAccess& lcd=_lcdManager.getLcd();
50
51 lcd.moveTo(lcd.getFullScreenRectangle());
52 lcd.beginWriting();
53
54 for(i=blockIndex;i<blockIndex+640;i+=2) {
55
56 // read the 2 blocks (one scan)
57
58 if(!_blockDevice.readBlocks(blocks,i,2))
59 return false;
60
61 // write to the device
62
63 lcd.rawTransfer(blocks,120); // 120 pixels are here (480 bytes in one 512b sector)
64 lcd.rawTransfer(&blocks[256],120); // and the next 120 are here
65 }
66
67 return true;
68}
69
70
71/*

Callers

nothing calls this directly

Calls 5

getFirstBlockIndexMethod · 0.80
moveToMethod · 0.45
beginWritingMethod · 0.45
readBlocksMethod · 0.45
rawTransferMethod · 0.45

Tested by

no test coverage detected