+
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+ initializeConverterList();
+ initializeUi();
+ initializeMenu();
+ loadSettings();
+}
+
+
+MainWindow::~MainWindow()
+{
+}
+
+
+void MainWindow::initializeConverterList()
+{
+ _converterList.append(new ConverterFramebufMonoVLSB());
+ _converterList.append(new ConverterFramebufMonoHMSB());
+ _converterList.append(new ConverterFramebufMonoHLSB());
+}
+
+
+void MainWindow::initializeUi()
+{
+ setMinimumSize(800, 600);
+ setWindowTitle(tr("Micropython Bitmap Tool by Lucky Resistor"));
+
+ auto centralWidget = new QWidget();
+ centralWidget->setObjectName("CentralWidget");
+ setCentralWidget(centralWidget);
+
+ auto mainLayout = new QHBoxLayout(centralWidget);
+ mainLayout->setContentsMargins(0, 0, 0, 0);
+
+ auto settingsPanel = new QFrame();
+ settingsPanel->setObjectName("SettingsPanel");
+ mainLayout->addWidget(settingsPanel);
+
+ auto settingsLayout = new QVBoxLayout(settingsPanel);
+ settingsLayout->setSpacing(4);
+
+ auto logo = new QLabel();
+ logo->setFixedSize(300, 250);
+ logo->setPixmap(QPixmap(":/images/AppLogo.png"));
+ settingsLayout->addWidget(logo);
+ auto versionLabel = new QLabel(tr("Version %1").arg(qApp->applicationVersion()));
+ versionLabel->setAlignment(Qt::AlignCenter);
+ settingsLayout->addWidget(versionLabel);
+ settingsLayout->addSpacing(16);
+
+ settingsLayout->addWidget(new QLabel(tr("Generated Format:")));
+ _formatSelector = new QComboBox();
+ for (auto converter : _converterList) {
+ _formatSelector->addItem(converter->displayName());
+ }
+ _formatSelector->setCurrentIndex(0);
+ settingsLayout->addWidget(_formatSelector);
+
+ settingsLayout->addStretch();
+
+ settingsLayout->addWidget(new QLabel(tr("Loaded Bitmap Info:")));
+ _bitmapInfo = new QLabel(tr("No Bitmap Loaded"));
+ _bitmapInfo->setObjectName("BitmapInfo");
+ _bitmapInfo->setMinimumHeight(200);
+ _bitmapInfo->setAlignment(Qt::AlignTop|Qt::AlignLeft);
+ settingsLayout->addWidget(_bitmapInfo);
+
+ auto loadButton = new QPushButton();
+ loadButton->setText(tr("Load Bitmap"));
+ settingsLayout->addWidget(loadButton);
+ connect(loadButton, &QPushButton::clicked, this, &MainWindow::onLoadBitmap);
+
+ auto previewSplittter = new QSplitter(Qt::Vertical);
+ previewSplittter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ previewSplittter->setChildrenCollapsible(false);
+ mainLayout->addWidget(previewSplittter);
+
+ _bitmapPanel = new BitmapPanel();
+ previewSplittter->addWidget(_bitmapPanel);
+
+ auto codePanel = new QWidget();
+ codePanel->setMinimumHeight(200);
+ auto codeLayout = new QVBoxLayout(codePanel);
+ codeLayout->setContentsMargins(16, 4, 16, 16);
+ codeLayout->setSpacing(4);
+ codeLayout->addWidget(new QLabel(tr("Generated Code:")));
+ _codePreview = new QPlainTextEdit();
+ _codePreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ _codePreview->setReadOnly(true);
+ _codePreview->setWordWrapMode(QTextOption::NoWrap);
+ codeLayout->addWidget(_codePreview);
+
+#ifdef Q_OS_WIN32
+ _codePreview->setFont(QFont("Consolas", 12));
+#else
+#ifdef Q_OS_MAC
+ _codePreview->setFont(QFont("Menlo", 12));
+#else
+ _codePreview->setFont(QFont("Lucida Console", 12));
+#endif
+#endif
+
+ auto codeActions = new QFrame();
+ auto codeActionsLayout = new QHBoxLayout(codeActions);
+ codeActionsLayout->setContentsMargins(0, 0, 0, 0);
+ codeActionsLayout->setSpacing(4);
+ codeActionsLayout->addStretch();
+
+ auto copyCodeButton = new QPushButton();
+ copyCodeButton->setText(tr("Copy Code"));
+ codeActionsLayout->addWidget(copyCodeButton);
+ connect(copyCodeButton, &QPushButton::clicked, [=]{
+ qApp->clipboard()->setText(_codePreview->toPlainText());
+ });
+ codeLayout->addWidget(codeActions);
+
+ previewSplittter->addWidget(codePanel);
+ previewSplittter->setStretchFactor(0, 4);
+ previewSplittter->setStretchFactor(1, 1);
+
+ connect(_formatSelector, &QComboBox::currentIndexChanged, [=]{
+ _bitmapPanel->setConverter(selectedConverter());
+ updateBitmapInfo();
+ updateCode();
+ });
+}
+
+
+void MainWindow::initializeMenu()
+{
+ auto menuFile = menuBar()->addMenu(tr("File"));
+ auto actionLoadBitmap = menuFile->addAction(tr("Load Bitmap..."));
+ actionLoadBitmap->setShortcut(QKeySequence("Ctrl+O"));
+ connect(actionLoadBitmap, &QAction::triggered, this, &MainWindow::onLoadBitmap);
+ auto actionQuit = menuFile->addAction(tr("Quit"));
+ connect(actionQuit, &QAction::triggered, [=]{
+ qApp->quit();
+ });
+
+ auto menuHelp = menuBar()->addMenu(tr("Help"));
+ auto actionAbout = menuHelp->addAction(tr("About..."));
+ connect(actionAbout, &QAction::triggered, [=]{
+ QMessageBox::about(this, tr("Micropython Bitmap Tool by Lucky Resistor"),
+ tr("Micropython Bitmap Tool
(c)2021 by Lucky Resistor
"
+ "Version %1
").arg(qApp->applicationVersion()));
+ });
+ auto actionAboutQt = menuHelp->addAction(tr("Information About Qt..."));
+ connect(actionAboutQt, &QAction::triggered, [=]{
+ QMessageBox::aboutQt(this);
+ });
+}
+
+
+void MainWindow::loadSettings()
+{
+ QSettings settings;
+ restoreGeometry(settings.value("mainWindow.geometry").toByteArray());
+ restoreState(settings.value("mainWindow.state").toByteArray());
+ _formatSelector->setCurrentIndex(settings.value("format.index").toInt(0));
+}
+
+
+void MainWindow::saveSettings()
+{
+ QSettings settings;
+ settings.setValue("mainWindow.geometry", saveGeometry());
+ settings.setValue("mainWindow.state", saveState());
+ settings.setValue("format.index", _formatSelector->currentIndex());
+}
+
+
+Converter *MainWindow::selectedConverter() const
+{
+ auto converter = _converterList.value(_formatSelector->currentIndex());
+ if (converter == nullptr) {
+ converter = _converterList.first();
+ }
+ return converter;
+}
+
+
+void MainWindow::updateBitmapInfo()
+{
+ QString text;
+ QTextStream ts(&text);
+ ts << "";
+ ts << "Bitmap Size: " << _currentImage.width() << "x" << _currentImage.height() << "
";
+ ts << "Bit Depth: " << _currentImage.depth() << "
";
+ ts << "Color Format: ";
+ switch (_currentImage.pixelFormat().colorModel()) {
+ case QPixelFormat::RGB: ts << "RGB"; break;
+ case QPixelFormat::BGR: ts << "BGR"; break;
+ case QPixelFormat::Indexed: ts << "Indexed"; break;
+ case QPixelFormat::Grayscale: ts << "Grayscale"; break;
+ case QPixelFormat::CMYK: ts << "CMYK"; break;
+ case QPixelFormat::HSL: ts << "HSL"; break;
+ case QPixelFormat::HSV: ts << "HSV"; break;
+ case QPixelFormat::YUV: ts << "YUV"; break;
+ case QPixelFormat::Alpha: ts << "Alpha"; break;
+ }
+ ts << "
";
+ const auto gs = selectedConverter()->generatedSize(_currentImage.size());
+ ts << "Generated Size: " << gs.width() << "x" << gs.height() << "
";
+ _bitmapInfo->setText(text);
+}
+
+
+void MainWindow::updateCode()
+{
+ QString code;
+ if (!_currentImage.isNull()) {
+ code = selectedConverter()->generateCode(_currentImage, QVariantMap());
+ }
+ _codePreview->setPlainText(code);
+}
+
+
+void MainWindow::onLoadBitmap()
+{
+ QSettings settings;
+ auto lastDir = settings.value("bitmap.lastDir").toString();
+ auto fileName = QFileDialog::getOpenFileName(
+ this,
+ tr("Open Bitmap"),
+ lastDir,
+ tr("Images (*.png *.jpg *.jpeg *.gif *.pbm *.pgm *.ppm *.xbm *.xpm *.bpm)"));
+ if (fileName.isEmpty()) {
+ return;
+ }
+ QFileInfo fileInfo(fileName);
+ settings.setValue("bitmap.lastDir", fileInfo.absoluteDir().path());
+ QImage newImage;
+ if (!newImage.load(fileName)) {
+ QMessageBox::warning(this, tr("Loading Image Failed"),
+ tr("Failed to load the image
"
+ "Could not load the specified image file. "
+ "Make sure the image is in a supported format.
"));
+ return;
+ }
+ if (newImage.width() > 0x100 || newImage.height() > 0x100) {
+ QMessageBox::warning(this, tr("Image is Too Large"),
+ tr("Image is Too Large
"
+ "One dimension of the loaded image is larger than "
+ "256 pixel. This software is designed for small bitmaps.
"));
+ return;
+ }
+
+ _currentImage = newImage;
+ _bitmapPanel->setImage(newImage);
+ _bitmapPanel->setConverter(selectedConverter());
+ updateBitmapInfo();
+ updateCode();
+}
+
+
+void MainWindow::closeEvent(QCloseEvent *event)
+{
+ saveSettings();
+ QMainWindow::closeEvent(event);
+}
+
diff --git a/MainWindow.hpp b/MainWindow.hpp
new file mode 100644
index 0000000..4107239
--- /dev/null
+++ b/MainWindow.hpp
@@ -0,0 +1,89 @@
+//
+// (c)2021 by Lucky Resistor. https://luckyresistor.me/
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+#pragma once
+
+
+#include
+
+
+class Converter;
+class QPlainTextEdit;
+class QComboBox;
+class QLabel;
+class BitmapPanel;
+
+
+/// The main widnow
+///
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = nullptr);
+ ~MainWindow() override;
+
+private:
+ /// Initialize the converter list
+ ///
+ void initializeConverterList();
+
+ /// Initialize the user interface.
+ ///
+ void initializeUi();
+
+ /// Initialize the menu
+ ///
+ void initializeMenu();
+
+ /// Load all settings
+ ///
+ void loadSettings();
+
+ /// Save all settings.
+ ///
+ void saveSettings();
+
+ /// The current converter.
+ ///
+ Converter* selectedConverter() const;
+
+ /// Update the bitmap info.
+ ///
+ void updateBitmapInfo();
+
+ /// Update the code.
+ ///
+ void updateCode();
+
+private Q_SLOTS:
+ /// Load a bitmap.
+ ///
+ void onLoadBitmap();
+
+protected: // Implement QWidget
+ void closeEvent(QCloseEvent *event) override;
+
+private:
+ QComboBox *_formatSelector; ///< The format selector.
+ QPlainTextEdit *_codePreview; ///< The generated code.
+ BitmapPanel *_bitmapPanel; ///< The bitmap panel.
+ QImage _currentImage; ///< The current loaded image
+ QLabel *_bitmapInfo; ///< The label with the image info.
+ QList _converterList; ///< A list of available converters.
+};
+
diff --git a/MicropythonBitmapTool.pro b/MicropythonBitmapTool.pro
new file mode 100644
index 0000000..c736f35
--- /dev/null
+++ b/MicropythonBitmapTool.pro
@@ -0,0 +1,55 @@
+QT += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+CONFIG += c++17
+
+TARGET = "MicroPython Bitmap Tool"
+
+# You can make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+ BitmapPanel.cpp \
+ BitmapPreview.cpp \
+ Converter.cpp \
+ ConverterFramebuf.cpp \
+ ConverterFramebufMono.cpp \
+ ConverterFramebufMonoHLSB.cpp \
+ ConverterFramebufMonoHMSB.cpp \
+ ConverterFramebufMonoVLSB.cpp \
+ LegendData.cpp \
+ LegendEntry.cpp \
+ OverlayPainter.cpp \
+ main.cpp \
+ MainWindow.cpp
+
+HEADERS += \
+ BitmapPanel.hpp \
+ BitmapPreview.hpp \
+ Converter.hpp \
+ ConverterFramebuf.hpp \
+ ConverterFramebufMono.hpp \
+ ConverterFramebufMonoHLSB.hpp \
+ ConverterFramebufMonoHMSB.hpp \
+ ConverterFramebufMonoVLSB.hpp \
+ LegendData.hpp \
+ LegendEntry.hpp \
+ MainWindow.hpp \
+ OverlayMode.hpp \
+ OverlayPainter.hpp
+
+RESOURCES += \
+ data/data.qrc
+
+macos:ICON = data/AppIcon.icns
+win32:RC_ICONS = data/AppIcon.ico
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+DISTFILES += \
+ data/application.css
diff --git a/OverlayMode.hpp b/OverlayMode.hpp
new file mode 100644
index 0000000..22eecd3
--- /dev/null
+++ b/OverlayMode.hpp
@@ -0,0 +1,25 @@
+//
+// (c)2021 by Lucky Resistor. https://luckyresistor.me/
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+#pragma once
+
+
+enum class OverlayMode : int {
+ None = 0,
+ BitAssigments = 1,
+ PixelInterpretation = 2
+};
+
diff --git a/OverlayPainter.cpp b/OverlayPainter.cpp
new file mode 100644
index 0000000..338cfad
--- /dev/null
+++ b/OverlayPainter.cpp
@@ -0,0 +1,71 @@
+//
+// (c)2021 by Lucky Resistor. https://luckyresistor.me/
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+#include "OverlayPainter.hpp"
+
+
+OverlayPainter::OverlayPainter(
+ QPainter *painter,
+ const QRect &updateRect,
+ int displayFactor,
+ const QSize &imageSize,
+ const QSize &generatedSize)
+:
+ _p(painter),
+ _updateRect(updateRect),
+ _displayFactor(displayFactor),
+ _imageSize(imageSize),
+ _generatedSize(generatedSize)
+{
+#ifdef Q_OS_WIN32
+ _pixelFont = QFont("Consolas");
+#else
+#ifdef Q_OS_MAC
+ _pixelFont = QFont("Menlo");
+#else
+ _pixelFont = QFont("Lucida Console");
+#endif
+#endif
+ _pixelFont.setPixelSize(displayFactor - 1);
+ _p->setFont(_pixelFont);
+}
+
+
+void OverlayPainter::drawPixelOutline(const QRect &rect, const QColor &outlineColor, int outlineWidth, int offset)
+{
+ _p->setBrush(QBrush());
+ _p->setPen(QPen(outlineColor, outlineWidth, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin));
+ const qreal offset1 = static_cast(outlineWidth)/2 - static_cast(offset);
+ const qreal offset2 = -static_cast(outlineWidth)/2 + static_cast(offset);
+ const auto rectToDraw = pixelRectF(rect).adjusted(offset1, offset1, offset2, offset2);
+ _p->drawRect(rectToDraw);
+}
+
+
+void OverlayPainter::drawPixelText(const QRect &rect, const QColor &textColor, const QString &text)
+{
+ _p->setBrush(QBrush());
+ _p->setPen(QPen(textColor));
+ _p->drawText(pixelRectF(rect), Qt::AlignCenter, text);
+}
+
+
+bool OverlayPainter::arePixelUpdated(const QRect &rect) const
+{
+ const auto rectToDraw = pixelRectF(rect).adjusted(-64, -64, 64, 64);
+ return rectToDraw.intersects(_updateRect);
+}
+
diff --git a/OverlayPainter.hpp b/OverlayPainter.hpp
new file mode 100644
index 0000000..e8f2d2d
--- /dev/null
+++ b/OverlayPainter.hpp
@@ -0,0 +1,106 @@
+//
+// (c)2021 by Lucky Resistor. https://luckyresistor.me/
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+#pragma once
+
+
+#include
+
+
+/// The overlay painter.
+///
+class OverlayPainter
+{
+public:
+ /// ctor
+ ///
+ OverlayPainter(
+ QPainter *painter,
+ const QRect &updateRect,
+ int displayFactor,
+ const QSize &imageSize,
+ const QSize &generatedSize);
+
+public:
+ /// Access the painter.
+ ///
+ inline QPainter *painter() const { return _p; };
+
+ /// Access the display factor.
+ ///
+ inline int displayFactor() const { return _displayFactor; };
+
+ /// Access the image size.
+ ///
+ inline const QSize& imageSize() const { return _imageSize; }
+
+ /// Access the generated size.
+ ///
+ inline const QSize& generatedSize() const { return _generatedSize; }
+
+ /// Access the image rect.
+ ///
+ inline const QRect imageRect() const { return QRect(QPoint(0, 0), imageSize()); }
+
+ /// Access the generated rect
+ ///
+ inline const QRect generatedRect() const { return QRect(QPoint(0, 0), generatedSize()); }
+
+ /// Get a rectangle for a pixal area.
+ ///
+ inline QRectF pixelRectF(int x, int y, int width, int height) const {
+ return QRectF(x * _displayFactor, y * _displayFactor, width * _displayFactor, height * _displayFactor);
+ }
+
+ /// Get a rectangle for a pixel rect.
+ ///
+ inline QRectF pixelRectF(const QRect &rect) const {
+ return pixelRectF(rect.x(), rect.y(), rect.width(), rect.height());
+ }
+
+ /// Draw a outline around a pixel area.
+ ///
+ /// @param rect The rect for the pixel area.
+ /// @param outlineColor The color of the outline.
+ /// @param outlineWidth THe width of the outline in pixels.
+ /// @param offset The offset of the outline. +1 = around the area, 0 in the area.
+ ///
+ void drawPixelOutline(
+ const QRect &rect,
+ const QColor &outlineColor,
+ int outlineWidth = 1,
+ int offset = 0);
+
+ /// Write text into a pixel area
+ ///
+ void drawPixelText(
+ const QRect &rect,
+ const QColor &textColor,
+ const QString &text);
+
+ /// Check if a pixel region ready for repaint.
+ ///
+ bool arePixelUpdated(const QRect &rect) const;
+
+private:
+ QPainter *_p; ///< The painter used.
+ QRect _updateRect; ///< The update rect.
+ int _displayFactor; ///< The display factor.
+ QSize _imageSize; ///< The size of the image.
+ QSize _generatedSize; ///< The generated size.
+ QFont _pixelFont; ///< The font used to draw into the pixels.
+};
+
diff --git a/README.md b/README.md
index 57800ca..d80d86d 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,5 @@
-# MicroPythonBitmapTool
\ No newline at end of file
+# MicroPython Bitmap Tool
+
+https://luckyresistor.me/applications/micropython-bitmap-tool/
+
+
diff --git a/data/AppIcon.icns b/data/AppIcon.icns
new file mode 100644
index 0000000..6c01a0f
Binary files /dev/null and b/data/AppIcon.icns differ
diff --git a/data/AppIcon.ico b/data/AppIcon.ico
new file mode 100644
index 0000000..5c182ed
Binary files /dev/null and b/data/AppIcon.ico differ
diff --git a/data/AppLogo.png b/data/AppLogo.png
new file mode 100644
index 0000000..159a917
Binary files /dev/null and b/data/AppLogo.png differ
diff --git a/data/AppLogo@2x.png b/data/AppLogo@2x.png
new file mode 100644
index 0000000..a26784f
Binary files /dev/null and b/data/AppLogo@2x.png differ
diff --git a/data/AppLogo@3x.png b/data/AppLogo@3x.png
new file mode 100644
index 0000000..3c1a363
Binary files /dev/null and b/data/AppLogo@3x.png differ
diff --git a/data/application.css b/data/application.css
new file mode 100644
index 0000000..eb2e3bb
--- /dev/null
+++ b/data/application.css
@@ -0,0 +1,16 @@
+
+#CentralWidget, QMainWindow {
+ margin: 0;
+ padding: 0;
+}
+
+#SettingsPanel {
+ background-color: #616875;
+ padding: 16px;
+}
+
+#BitmapInfo {
+ border: 1px solid rgba(0,0,0,0.25);
+ padding: 8px;
+ margin: 0px 0px 16px 0px;
+}
diff --git a/data/data.qrc b/data/data.qrc
new file mode 100644
index 0000000..eed1e07
--- /dev/null
+++ b/data/data.qrc
@@ -0,0 +1,10 @@
+
+
+ AppLogo.png
+ AppLogo@2x.png
+ AppLogo@3x.png
+
+
+ application.css
+
+
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..eae2dc7
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,38 @@
+//
+// (c)2021 by Lucky Resistor. https://luckyresistor.me/
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+#include "MainWindow.hpp"
+
+#include
+#include
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ a.setApplicationName("MicroPython Bitmap Tool");
+ a.setApplicationVersion("1.0");
+ a.setApplicationDisplayName("MicroPython Bitmap Tool");
+ a.setOrganizationDomain("luckyresistor.me");
+ a.setOrganizationName("Lucky Resistoor");
+ QFile styleSheet(":/stylesheet/application.css");
+ styleSheet.open(QIODevice::ReadOnly);
+ a.setStyleSheet(QString::fromUtf8(styleSheet.readAll()));
+ styleSheet.close();
+
+ MainWindow w;
+ w.show();
+ return a.exec();
+}