| 23 | #include <cmath> |
| 24 | |
| 25 | LCDWidget::LCDWidget(QWidget *parent) : QWidget{parent} { |
| 26 | installEventFilter(keypadBridge); |
| 27 | m_mutex.lock(); |
| 28 | m_renderedFrame = QImage(LCD_WIDTH, LCD_HEIGHT, QImage::Format_RGB32); |
| 29 | m_blendedFrame = QImage(LCD_WIDTH, LCD_HEIGHT, QImage::Format_RGB32); |
| 30 | m_currFrame = &m_renderedFrame; |
| 31 | m_mutex.unlock(); |
| 32 | m_interlaceAlpha = QImage(LCD_WIDTH, LCD_HEIGHT, QImage::Format_Alpha8); |
| 33 | uint8_t* interlacePixels = reinterpret_cast<uint8_t*>(m_interlaceAlpha.bits()); |
| 34 | for (size_t index = 0; index < LCD_WIDTH * LCD_HEIGHT; index += 2) { |
| 35 | interlacePixels[index] = 255 * 4 / 10; |
| 36 | interlacePixels[index + 1] = 255 * 6 / 10; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | void LCDWidget::paintEvent(QPaintEvent*) { |
| 41 | if (!guiEmuValid) { |
nothing calls this directly
no outgoing calls
no test coverage detected