├── .clang-format ├── .gitignore ├── .travis.yml ├── classes ├── action-handlers │ ├── actionedithandlers.cpp │ ├── actionedithandlers.h │ ├── actionfilehandlers.cpp │ ├── actionfilehandlers.h │ ├── actionfonthandlers.cpp │ ├── actionfonthandlers.h │ ├── actionhandlersbase.cpp │ ├── actionhandlersbase.h │ ├── actionhelphandlers.cpp │ ├── actionhelphandlers.h │ ├── actionimagehandlers.cpp │ ├── actionimagehandlers.h │ ├── actionsetuphandlers.cpp │ └── actionsetuphandlers.h ├── cmdline │ ├── cmdline.cpp │ ├── cmdline.h │ ├── modeconvertfont.cpp │ ├── modeconvertfont.h │ ├── modeconvertimage.cpp │ ├── modeconvertimage.h │ ├── modehex2bin.cpp │ ├── modehex2bin.h │ ├── modeparserbase.cpp │ └── modeparserbase.h ├── compression │ ├── rlecompressor.cpp │ ├── rlecompressor.h │ ├── rlesequence.cpp │ └── rlesequence.h ├── data │ ├── alignmodes.h │ ├── alignmodinfo.cpp │ ├── alignmodinfo.h │ ├── alignmodproxy.cpp │ ├── alignmodproxy.h │ ├── canvasmodinfo.cpp │ ├── canvasmodinfo.h │ ├── canvasmodproxy.cpp │ ├── canvasmodproxy.h │ ├── datacontainer.cpp │ ├── datacontainer.h │ ├── fontdocument.cpp │ ├── fontdocument.h │ ├── fontparameters.h │ ├── fontsizeunits.h │ ├── historykeeper.cpp │ ├── historykeeper.h │ ├── historyrecord.cpp │ ├── historyrecord.h │ ├── imagedocument.cpp │ ├── imagedocument.h │ ├── imagesmodel.cpp │ ├── imagesmodel.h │ ├── imagesscaledproxy.cpp │ ├── imagesscaledproxy.h │ ├── revisioninfo.cpp │ ├── revisioninfo.h │ ├── transposeproxy.cpp │ └── transposeproxy.h ├── imageeditor │ ├── editor.cpp │ ├── editor.h │ ├── iimageeditor.h │ ├── iimageeditorparams.h │ ├── iimageeditortool.h │ ├── iimageselection.h │ ├── toolcolor.cpp │ ├── toolcolor.h │ ├── toolfill.cpp │ ├── toolfill.h │ ├── toolline.cpp │ ├── toolline.h │ ├── toolmove.cpp │ ├── toolmove.h │ ├── toolpen.cpp │ ├── toolpen.h │ ├── toolrect.cpp │ ├── toolrect.h │ ├── toolselect.cpp │ ├── toolselect.h │ ├── toolsmanager.cpp │ ├── toolsmanager.h │ ├── toolzoom.cpp │ └── toolzoom.h ├── operations │ ├── documentoperator.cpp │ ├── documentoperator.h │ ├── fontresize.cpp │ ├── fontresize.h │ ├── imagealign.cpp │ ├── imagealign.h │ ├── imageeditinexternaltool.cpp │ ├── imageeditinexternaltool.h │ ├── imageexport.cpp │ ├── imageexport.h │ ├── imageflip.cpp │ ├── imageflip.h │ ├── imagegrayscale.cpp │ ├── imagegrayscale.h │ ├── imageimport.cpp │ ├── imageimport.h │ ├── imageinverse.cpp │ ├── imageinverse.h │ ├── imageresize.cpp │ ├── imageresize.h │ ├── imagerotate.cpp │ ├── imagerotate.h │ ├── imageshift.cpp │ ├── imageshift.h │ └── ioperation.h ├── parser │ ├── convert │ │ ├── bitmaphelper.cpp │ │ ├── bitmaphelper.h │ │ ├── bitstream.cpp │ │ ├── bitstream.h │ │ ├── conversion_options.h │ │ ├── converterhelper.cpp │ │ ├── converterhelper.h │ │ ├── convimagepixels.cpp │ │ ├── convimagepixels.h │ │ ├── convimagescan.cpp │ │ ├── convimagescan.h │ │ ├── fonthelper.cpp │ │ └── fonthelper.h │ ├── parsedimagedata.cpp │ ├── parsedimagedata.h │ ├── parser.cpp │ ├── parser.h │ ├── tagslist.cpp │ └── tagslist.h ├── settings │ ├── alignsettings.cpp │ ├── alignsettings.h │ ├── appsettings.cpp │ ├── appsettings.h │ ├── conversionpreviewoptions.cpp │ ├── conversionpreviewoptions.h │ ├── externaltooloptions.cpp │ ├── externaltooloptions.h │ ├── filedialogoptions.cpp │ ├── filedialogoptions.h │ ├── fonteditoroptions.cpp │ ├── fonteditoroptions.h │ ├── imageeditoroptions.cpp │ ├── imageeditoroptions.h │ ├── languageoptions.cpp │ ├── languageoptions.h │ ├── presets │ │ ├── fontoptions.cpp │ │ ├── fontoptions.h │ │ ├── imageoptions.cpp │ │ ├── imageoptions.h │ │ ├── ipresetsoptionspart.h │ │ ├── matrixoptions.cpp │ │ ├── matrixoptions.h │ │ ├── prepareoptions.cpp │ │ ├── prepareoptions.h │ │ ├── preset.cpp │ │ ├── preset.h │ │ ├── reorderingoptions.cpp │ │ ├── reorderingoptions.h │ │ ├── templateoptions.cpp │ │ └── templateoptions.h │ ├── recentlist.cpp │ ├── recentlist.h │ ├── resizesettings.cpp │ ├── resizesettings.h │ ├── setupdialogoptions.cpp │ └── setupdialogoptions.h └── status │ ├── statusdata.cpp │ ├── statusdata.h │ ├── statusmanager.cpp │ └── statusmanager.h ├── controls ├── about │ ├── dialogabout.cpp │ ├── dialogabout.h │ └── dialogabout.ui ├── align │ ├── dialogalign.cpp │ ├── dialogalign.h │ └── dialogalign.ui ├── fonts │ ├── font-changed │ │ ├── dialogfontchanged.cpp │ │ ├── dialogfontchanged.h │ │ └── dialogfontchanged.ui │ ├── font-editor │ │ ├── editortabfont.cpp │ │ ├── editortabfont.h │ │ └── editortabfont.ui │ ├── font-new │ │ ├── charactersmodel.cpp │ │ ├── charactersmodel.h │ │ ├── dialogfontselect.cpp │ │ ├── dialogfontselect.h │ │ ├── dialogfontselect.ui │ │ ├── dialogfontselectdata.cpp │ │ ├── dialogfontselectdata.h │ │ ├── unicodeblocksfiltermodel.cpp │ │ ├── unicodeblocksfiltermodel.h │ │ ├── unicodeblocksmodel.cpp │ │ └── unicodeblocksmodel.h │ ├── font-preview │ │ ├── dialogfontpreview.cpp │ │ ├── dialogfontpreview.h │ │ └── dialogfontpreview.ui │ └── font-range │ │ ├── dialogfontrange.cpp │ │ ├── dialogfontrange.h │ │ └── dialogfontrange.ui ├── imageeditor │ ├── windoweditor.cpp │ ├── windoweditor.h │ └── windoweditor.ui ├── images │ ├── editortabimage.cpp │ ├── editortabimage.h │ ├── editortabimage.ui │ ├── widgetbitmapeditor.cpp │ ├── widgetbitmapeditor.h │ └── widgetbitmapeditor.ui ├── main │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── mainwindow.ui │ ├── revisionlabel.cpp │ └── revisionlabel.h ├── resize │ ├── columnsreorderproxy.cpp │ ├── columnsreorderproxy.h │ ├── dialogcanvasresize.cpp │ ├── dialogcanvasresize.h │ ├── dialogcanvasresize.ui │ ├── imagesfilterproxy.cpp │ └── imagesfilterproxy.h ├── save-changes │ ├── dialogsavechanges.cpp │ └── dialogsavechanges.h ├── setup │ ├── dialogexternaleditor.cpp │ ├── dialogexternaleditor.h │ ├── dialogexternaleditor.ui │ ├── dialogoptions.cpp │ ├── dialogoptions.h │ ├── dialogoptions.ui │ ├── dialogpreview.cpp │ ├── dialogpreview.h │ ├── dialogpreview.ui │ └── parts │ │ ├── font │ │ ├── setuptabfont.cpp │ │ ├── setuptabfont.h │ │ └── setuptabfont.ui │ │ ├── image │ │ ├── setuptabimage.cpp │ │ ├── setuptabimage.h │ │ └── setuptabimage.ui │ │ ├── matrix │ │ ├── matrixitemdelegate.cpp │ │ ├── matrixitemdelegate.h │ │ ├── matrixpreviewmodel.cpp │ │ ├── matrixpreviewmodel.h │ │ ├── setuptabmatrix.cpp │ │ ├── setuptabmatrix.h │ │ └── setuptabmatrix.ui │ │ ├── prepare │ │ ├── demogenerator.cpp │ │ ├── demogenerator.h │ │ ├── preprocessing │ │ │ ├── setuptabpreparepreprocessing.cpp │ │ │ ├── setuptabpreparepreprocessing.h │ │ │ └── setuptabpreparepreprocessing.ui │ │ ├── scanning │ │ │ ├── setuptabpreparescanning.cpp │ │ │ ├── setuptabpreparescanning.h │ │ │ └── setuptabpreparescanning.ui │ │ ├── setuptabprepare.cpp │ │ ├── setuptabprepare.h │ │ └── setuptabprepare.ui │ │ ├── reordering │ │ ├── reorderingitemdelegate.cpp │ │ ├── reorderingitemdelegate.h │ │ ├── reorderingpreviewmodel.cpp │ │ ├── reorderingpreviewmodel.h │ │ ├── setuptabreordering.cpp │ │ ├── setuptabreordering.h │ │ └── setuptabreordering.ui │ │ └── templates │ │ ├── setuptabtemplates.cpp │ │ ├── setuptabtemplates.h │ │ └── setuptabtemplates.ui ├── start │ ├── starttab.cpp │ ├── starttab.h │ └── starttab.ui └── updates │ ├── dialogupdates.cpp │ ├── dialogupdates.h │ └── dialogupdates.ui ├── interfaces ├── idocument.h ├── ieditor.h └── imainwindow.h ├── lcd-image-converter.pro ├── license ├── main.cpp ├── qt-version-check.h ├── readme.md ├── resources ├── demos │ ├── scanning_background.png │ └── scanning_background.svg ├── font.tmpl ├── gpl-3.0-standalone.html ├── history.css ├── history.xml ├── history.xsl ├── icons │ ├── lcd-image-converter-64.png │ ├── lcd-image-converter-96.png │ ├── lcd-image-converter.ico │ ├── source │ │ ├── icon.icpr │ │ └── logo.svg │ └── tools │ │ ├── tool_color.svg │ │ ├── tool_color_swap.svg │ │ ├── tool_fill.svg │ │ ├── tool_line.svg │ │ ├── tool_move_circular.svg │ │ ├── tool_move_copy.svg │ │ ├── tool_move_cut.svg │ │ ├── tool_pen.svg │ │ ├── tool_rect.svg │ │ ├── tool_rect_filled.svg │ │ ├── tool_rect_filled_outline.svg │ │ ├── tool_rect_outline.svg │ │ ├── tool_select.svg │ │ ├── tool_select_edit.svg │ │ ├── tool_select_move.svg │ │ └── tool_zoom.svg ├── image.tmpl ├── lcd-image-converter-ru.ts ├── resources.qrc ├── scan_scripts │ ├── pixels_example.js │ ├── pixels_template.js │ ├── scan_bottom2top_backward.js │ ├── scan_bottom2top_backward_band.js │ ├── scan_bottom2top_forward.js │ ├── scan_bottom2top_forward_band.js │ ├── scan_left2right_backward.js │ ├── scan_left2right_backward_band.js │ ├── scan_left2right_forward.js │ ├── scan_left2right_forward_band.js │ ├── scan_right2left_backward.js │ ├── scan_right2left_backward_band.js │ ├── scan_right2left_forward.js │ ├── scan_right2left_forward_band.js │ ├── scan_template.js │ ├── scan_top2bottom_backward.js │ ├── scan_top2bottom_backward_band.js │ ├── scan_top2bottom_forward.js │ └── scan_top2bottom_forward_band.js ├── template.png └── unicode_blocks.txt ├── tests ├── maintest.cpp ├── parts │ ├── testbitmaphelper.cpp │ ├── testbitmaphelper.h │ ├── testbitstream.cpp │ ├── testbitstream.h │ ├── testconverterhelper.cpp │ ├── testconverterhelper.h │ ├── testfontoptions.cpp │ ├── testfontoptions.h │ ├── testimageoptions.cpp │ ├── testimageoptions.h │ ├── testmatrixoptions.cpp │ ├── testmatrixoptions.h │ ├── testprepareoptions.cpp │ ├── testprepareoptions.h │ ├── testpresets.cpp │ ├── testpresets.h │ ├── testreorderingoptions.cpp │ ├── testreorderingoptions.h │ ├── testrle.cpp │ ├── testrle.h │ ├── testsettings.cpp │ ├── testsettings.h │ ├── testtemplateoptions.cpp │ └── testtemplateoptions.h ├── resources │ └── samples │ │ ├── flip │ │ ├── flip-horizontal.png │ │ ├── flip-vertical.png │ │ └── flip.png │ │ ├── rotate │ │ ├── rotate0.png │ │ ├── rotate180.png │ │ ├── rotate270.png │ │ └── rotate90.png │ │ ├── settings │ │ └── settings.xml │ │ └── shift │ │ ├── -1_-1.png │ │ ├── -1_0.png │ │ ├── -1_1.png │ │ ├── 0_-1.png │ │ ├── 0_1.png │ │ ├── 1_-1.png │ │ ├── 1_0.png │ │ ├── 1_1.png │ │ ├── 2_4.png │ │ ├── original.png │ │ └── sample.xcf ├── samples.qrc └── test.pro ├── update-revision-info.bat ├── update-revision-info.sh └── win-res.rc /.clang-format: -------------------------------------------------------------------------------- 1 | # clang-format version 19.1.6 2 | --- 3 | BasedOnStyle: LLVM 4 | IndentWidth: 2 5 | --- 6 | Language: Cpp 7 | InsertBraces: true 8 | IndentCaseLabels: true 9 | BreakBeforeBraces: Linux 10 | PointerAlignment: Left 11 | ColumnLimit: 120 12 | IncludeBlocks: Regroup 13 | # lowest priority first 14 | IncludeCategories: 15 | - Regex: '^' 19 | Priority: 20 20 | - Regex: '"[[:alnum:].]+"' 21 | Priority: 30 22 | - Regex: '.*' 23 | Priority: 1 24 | SortPriority: 0 25 | ... 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _linux/ 2 | _windows/ 3 | .moc/ 4 | .uic/ 5 | .obj/ 6 | Makefile.* 7 | Makefile 8 | *.user 9 | qrc_* 10 | moc_* 11 | .user/ 12 | *.Debug 13 | *.Release 14 | *.sh 15 | *.qm 16 | version-included.txt 17 | revision.h 18 | **/build 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: gcc 3 | 4 | dist: focal 5 | sudo: required 6 | 7 | env: 8 | global: 9 | - MAKEFLAGS="-j4" 10 | matrix: 11 | - QT_BASE=5_15 12 | 13 | before_install: 14 | - if [ "$QT_BASE" = "5_15" ]; then sudo add-apt-repository --yes ppa:beineri/opt-qt-5.15.2-focal; fi 15 | - sudo apt-get update -qq 16 | 17 | install: 18 | - if [ "$QT_BASE" = "5_15" ]; then sudo apt-get install -y --force-yes qt515base qt515xmlpatterns qt515svg qt515declarative qt515tools; fi 19 | - sudo apt-get install -y --force-yes build-essential libglu1-mesa-dev 20 | 21 | before_script: 22 | - if [ "$QT_BASE" = "5_15" ]; then source /opt/qt515/bin/qt515-env.sh; fi 23 | 24 | 25 | script: 26 | - if [ "$QT_BASE" = "5_15" ]; then /opt/qt515/bin/qmake lcd-image-converter.pro; fi 27 | - make 28 | -------------------------------------------------------------------------------- /classes/action-handlers/actionedithandlers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "actionhandlersbase.h" 26 | 27 | namespace AppUI 28 | { 29 | namespace MenuHandlers 30 | { 31 | 32 | class ActionEditHandlers : public ActionHandlersBase 33 | { 34 | Q_OBJECT 35 | public: 36 | explicit ActionEditHandlers(QObject* parent = 0); 37 | virtual ~ActionEditHandlers() {} 38 | 39 | public slots: 40 | void undo_triggered(); 41 | void redo_triggered(); 42 | void copy_triggered(); 43 | void paste_triggered(); 44 | }; 45 | 46 | } // namespace MenuHandlers 47 | } // namespace AppUI 48 | 49 | #endif // ACTIONEDITHANDLERS_H 50 | -------------------------------------------------------------------------------- /classes/action-handlers/actionfonthandlers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "actionhandlersbase.h" 26 | 27 | namespace AppUI 28 | { 29 | namespace MenuHandlers 30 | { 31 | 32 | class ActionFontHandlers : public ActionHandlersBase 33 | { 34 | Q_OBJECT 35 | public: 36 | explicit ActionFontHandlers(QObject* parent = 0); 37 | virtual ~ActionFontHandlers() {} 38 | 39 | signals: 40 | void imageCreated(QImage* image, const QString& documentName); 41 | 42 | public slots: 43 | void fontChange_triggered(); 44 | void fontInverse_triggered(); 45 | void fontResize_triggered(); 46 | void fontAlign_triggered(); 47 | void fontPreview_triggered(); 48 | void fontToImage_triggered(); 49 | }; 50 | 51 | } // namespace MenuHandlers 52 | } // namespace AppUI 53 | 54 | #endif // ACTIONFONTHANDLERS_H 55 | -------------------------------------------------------------------------------- /classes/action-handlers/actionhandlersbase.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see mMainWindow = qobject_cast(parent); 33 | } 34 | 35 | IEditor* ActionHandlersBase::editor() 36 | { 37 | IEditor* editor = this->mMainWindow->currentEditor(); 38 | return editor; 39 | } 40 | 41 | } // namespace MenuHandlers 42 | } // namespace AppUI 43 | -------------------------------------------------------------------------------- /classes/action-handlers/actionhandlersbase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace AppUI 26 | { 27 | class IEditor; 28 | class IMainWindow; 29 | 30 | namespace MenuHandlers 31 | { 32 | 33 | class ActionHandlersBase : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit ActionHandlersBase(QObject* parent = 0); 38 | virtual ~ActionHandlersBase() {} 39 | 40 | protected: 41 | IMainWindow* mMainWindow; 42 | IEditor* editor(); 43 | 44 | signals: 45 | 46 | public slots: 47 | }; 48 | 49 | } // namespace MenuHandlers 50 | } // namespace AppUI 51 | 52 | #endif // ACTIONHANDLERSBASE_H 53 | -------------------------------------------------------------------------------- /classes/action-handlers/actionhelphandlers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | #include 24 | #include 25 | 26 | #include "dialogabout.h" 27 | #include "dialogupdates.h" 28 | #include "imainwindow.h" 29 | 30 | namespace AppUI 31 | { 32 | namespace MenuHandlers 33 | { 34 | 35 | ActionHelpHandlers::ActionHelpHandlers(QObject* parent) : ActionHandlersBase(parent) {} 36 | 37 | void ActionHelpHandlers::about_application_triggered() 38 | { 39 | About::DialogAbout dialog(this->mMainWindow->parentWidget()); 40 | dialog.exec(); 41 | } 42 | 43 | void ActionHelpHandlers::about_qt_triggered() { QMessageBox::aboutQt(this->mMainWindow->parentWidget()); } 44 | 45 | void ActionHelpHandlers::updates_triggered() 46 | { 47 | AppUI::Updates::DialogUpdates dialog(this->mMainWindow->parentWidget()); 48 | dialog.exec(); 49 | } 50 | 51 | void ActionHelpHandlers::homepage_triggered() 52 | { 53 | QDesktopServices::openUrl(QUrl("http://www.riuson.com/lcd-image-converter", QUrl::TolerantMode)); 54 | } 55 | 56 | } // namespace MenuHandlers 57 | } // namespace AppUI 58 | -------------------------------------------------------------------------------- /classes/action-handlers/actionhelphandlers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "actionhandlersbase.h" 26 | 27 | namespace AppUI 28 | { 29 | namespace MenuHandlers 30 | { 31 | 32 | class ActionHelpHandlers : public ActionHandlersBase 33 | { 34 | Q_OBJECT 35 | public: 36 | explicit ActionHelpHandlers(QObject* parent = 0); 37 | virtual ~ActionHelpHandlers() {} 38 | 39 | signals: 40 | 41 | public slots: 42 | void about_application_triggered(); 43 | void about_qt_triggered(); 44 | void updates_triggered(); 45 | void homepage_triggered(); 46 | }; 47 | 48 | } // namespace MenuHandlers 49 | } // namespace AppUI 50 | 51 | #endif // ACTIONHELPHANDLERS_H 52 | -------------------------------------------------------------------------------- /classes/action-handlers/actionimagehandlers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | #include "actionhandlersbase.h" 27 | 28 | namespace AppUI 29 | { 30 | namespace MenuHandlers 31 | { 32 | 33 | class ActionImageHandlers : public ActionHandlersBase 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit ActionImageHandlers(QObject* parent = 0); 38 | virtual ~ActionImageHandlers() {} 39 | 40 | private: 41 | bool mRunningError; 42 | 43 | signals: 44 | 45 | public slots: 46 | void flipHorizontal_triggered(); 47 | void flipVertical_triggered(); 48 | void rotate_90_Clockwise_triggered(); 49 | void rotate_180_triggered(); 50 | void rotate_90_Counter_Clockwise_triggered(); 51 | void shift_left_triggered(); 52 | void shift_right_triggered(); 53 | void shift_up_triggered(); 54 | void shift_down_triggered(); 55 | void inverse_triggered(); 56 | void resize_triggered(); 57 | void align_triggered(); 58 | void grayscale_triggered(); 59 | void import_triggered(); 60 | void export_triggered(); 61 | void edit_in_external_tool_triggered(); 62 | }; 63 | 64 | } // namespace MenuHandlers 65 | } // namespace AppUI 66 | 67 | #endif // ACTIONIMAGEHANDLERS_H 68 | -------------------------------------------------------------------------------- /classes/action-handlers/actionsetuphandlers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see editor() != nullptr) { 41 | data = this->editor()->document()->dataContainer(); 42 | } 43 | 44 | AppUI::Setup::DialogOptions dialog(data, this->mMainWindow->parentWidget()); 45 | dialog.exec(); 46 | } 47 | 48 | void ActionSetupHandlers::external_editor_triggered() 49 | { 50 | AppUI::Setup::DialogExternalEditor dialog(this->mMainWindow->parentWidget()); 51 | dialog.exec(); 52 | } 53 | 54 | } // namespace MenuHandlers 55 | } // namespace AppUI 56 | -------------------------------------------------------------------------------- /classes/action-handlers/actionsetuphandlers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "actionhandlersbase.h" 26 | 27 | namespace AppUI 28 | { 29 | namespace MenuHandlers 30 | { 31 | 32 | class ActionSetupHandlers : public ActionHandlersBase 33 | { 34 | Q_OBJECT 35 | public: 36 | explicit ActionSetupHandlers(QObject* parent = 0); 37 | virtual ~ActionSetupHandlers() {} 38 | 39 | signals: 40 | 41 | public slots: 42 | void conversion_triggered(); 43 | void external_editor_triggered(); 44 | }; 45 | 46 | } // namespace MenuHandlers 47 | } // namespace AppUI 48 | 49 | #endif // ACTIONSETUPHANDLERS_H 50 | -------------------------------------------------------------------------------- /classes/cmdline/cmdline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2014 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | #include 27 | 28 | namespace CommandLine 29 | { 30 | 31 | class ModeParserBase; 32 | 33 | class CmdLine : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | enum class ProcessResult { None, Success, Failed }; 38 | 39 | explicit CmdLine(const QStringList& arguments, QObject* parent = 0); 40 | virtual ~CmdLine() {} 41 | 42 | bool needProcess() const; 43 | ProcessResult process(); 44 | 45 | private: 46 | QCommandLineParser mParser; 47 | const QStringList mArguments; 48 | 49 | CommandLine::ModeParserBase* createMode(const QString& name, QCommandLineParser& parser); 50 | void addApplicationOptions(); 51 | void processApplicationOptions(); 52 | }; 53 | 54 | } // namespace CommandLine 55 | 56 | #endif // CMDLINE_H 57 | -------------------------------------------------------------------------------- /classes/cmdline/modeconvertimage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2014 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "modeparserbase.h" 26 | 27 | namespace CommandLine 28 | { 29 | 30 | class ModeConvertImage : public ModeParserBase 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit ModeConvertImage(QCommandLineParser& parser, QObject* parent = 0); 35 | virtual ~ModeConvertImage() {} 36 | 37 | static QString modeName(); 38 | 39 | void fillParser() const Q_DECL_OVERRIDE; 40 | bool collectArguments() Q_DECL_OVERRIDE; 41 | int process() Q_DECL_OVERRIDE; 42 | 43 | private: 44 | QString mInputFilename; 45 | QString mOutputFilename; 46 | QString mTemplateFilename; 47 | QString mDocumentName; 48 | QString mPresetName; 49 | }; 50 | 51 | } // namespace CommandLine 52 | 53 | #endif // CONVERTIMAGEARGUMENTS_H 54 | -------------------------------------------------------------------------------- /classes/cmdline/modehex2bin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2014 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "modeparserbase.h" 26 | 27 | namespace CommandLine 28 | { 29 | 30 | class ModeHex2Bin : public ModeParserBase 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit ModeHex2Bin(QCommandLineParser& parser, QObject* parent = 0); 35 | virtual ~ModeHex2Bin() {} 36 | 37 | static QString modeName(); 38 | 39 | void fillParser() const Q_DECL_OVERRIDE; 40 | bool collectArguments() Q_DECL_OVERRIDE; 41 | int process() Q_DECL_OVERRIDE; 42 | 43 | private: 44 | QString mInputFilename; 45 | QString mOuputFilename; 46 | 47 | QByteArray hex2bin(QString& hexString); 48 | void appendDataLE(QByteArray& array, int size, quint32 value); 49 | void appendDataBE(QByteArray& array, int size, quint32 value); 50 | }; 51 | 52 | } // namespace CommandLine 53 | 54 | #endif // MODEHEX2BIN_H 55 | -------------------------------------------------------------------------------- /classes/cmdline/modeparserbase.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2014 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace CommandLine 27 | { 28 | 29 | class ModeParserBase : public QObject 30 | { 31 | Q_OBJECT 32 | public: 33 | explicit ModeParserBase(QCommandLineParser& parser, QObject* parent = 0); 34 | virtual ~ModeParserBase() {} 35 | 36 | virtual void fillParser() const = 0; 37 | virtual bool collectArguments() = 0; 38 | virtual int process() = 0; 39 | 40 | protected: 41 | QCommandLineParser& mParser; 42 | }; 43 | 44 | } // namespace CommandLine 45 | 46 | #endif // MODEPARSERBASE_H 47 | -------------------------------------------------------------------------------- /classes/compression/rlesequence.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2014 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | 24 | namespace Utils 25 | { 26 | namespace Compression 27 | { 28 | 29 | RleSequence::RleSequence() { this->mData = new QVector(); } 30 | 31 | RleSequence::RleSequence(const RleSequence* other) { this->mData = new QVector(*other->mData); } 32 | 33 | RleSequence::~RleSequence() { delete this->mData; } 34 | 35 | void RleSequence::append(quint32 value) { this->mData->append(value); } 36 | 37 | void RleSequence::append(const RleSequence* sequence) 38 | { 39 | for (quint32 i = 0; i < sequence->size(); i++) { 40 | this->mData->append(sequence->at(i)); 41 | } 42 | } 43 | 44 | quint32 RleSequence::at(quint32 index) const { return this->mData->at(index); } 45 | 46 | quint32 RleSequence::last() const { return this->mData->last(); } 47 | 48 | quint32 RleSequence::size() const { return this->mData->size(); } 49 | 50 | bool RleSequence::allEquals() const 51 | { 52 | bool result = true; 53 | quint32 first = this->mData->at(0); 54 | 55 | for (int i = 1; i < this->mData->size(); i++) { 56 | if (this->mData->at(i) != first) { 57 | result = false; 58 | break; 59 | } 60 | } 61 | 62 | return result; 63 | } 64 | 65 | } // namespace Compression 66 | } // namespace Utils 67 | -------------------------------------------------------------------------------- /classes/compression/rlesequence.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2014 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | template class QVector; 26 | 27 | namespace Utils 28 | { 29 | namespace Compression 30 | { 31 | 32 | class RleSequence 33 | { 34 | public: 35 | RleSequence(); 36 | RleSequence(const RleSequence* other); 37 | virtual ~RleSequence(); 38 | 39 | void append(quint32 value); 40 | void append(const RleSequence* sequence); 41 | quint32 at(quint32 index) const; 42 | quint32 last() const; 43 | quint32 size() const; 44 | 45 | bool allEquals() const; 46 | 47 | private: 48 | QVector* mData; 49 | }; 50 | 51 | } // namespace Compression 52 | } // namespace Utils 53 | 54 | #endif // RLESEQUENCE_H 55 | -------------------------------------------------------------------------------- /classes/data/alignmodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2022 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see horizontalMode = Data::HorizontalAlignMode::None; 30 | this->verticalMode = Data::VerticalAlignMode::None; 31 | this->horizontalOffset = 0; 32 | this->verticalOffset = 0; 33 | } 34 | 35 | AlignModInfo::AlignModInfo() { this->mState.reset(); } 36 | 37 | const AlignModInfo::Mods& AlignModInfo::summary() const { return this->mState; } 38 | 39 | void AlignModInfo::modify(Data::HorizontalAlignMode horizontalMode, int horizontalOffset, 40 | Data::VerticalAlignMode verticalMode, int verticalOffset) 41 | { 42 | this->mState.horizontalMode = horizontalMode; 43 | this->mState.verticalMode = verticalMode; 44 | this->mState.horizontalOffset = horizontalOffset; 45 | this->mState.verticalOffset = verticalOffset; 46 | } 47 | 48 | void AlignModInfo::reset() { this->mState.reset(); } 49 | 50 | const QString AlignModInfo::toString() const 51 | { 52 | return QString("H:%1(%2),V:%3(%4)") 53 | .arg((int)this->mState.horizontalMode) 54 | .arg(this->mState.horizontalOffset) 55 | .arg((int)this->mState.verticalMode) 56 | .arg(this->mState.verticalOffset); 57 | } 58 | 59 | } // namespace Data 60 | -------------------------------------------------------------------------------- /classes/data/alignmodinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2022 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Data 26 | { 27 | enum class HorizontalAlignMode; 28 | enum class VerticalAlignMode; 29 | } // namespace Data 30 | 31 | namespace Data 32 | { 33 | 34 | class AlignModInfo 35 | { 36 | public: 37 | struct Mods { 38 | Data::HorizontalAlignMode horizontalMode; 39 | Data::VerticalAlignMode verticalMode; 40 | int horizontalOffset; 41 | int verticalOffset; 42 | 43 | void reset(); 44 | }; 45 | 46 | AlignModInfo(); 47 | 48 | const Mods& summary() const; 49 | 50 | void modify(HorizontalAlignMode horizontalMode, int horizontalOffset, VerticalAlignMode verticalMode, 51 | int verticalOffset); 52 | void reset(); 53 | 54 | const QString toString() const; 55 | 56 | private: 57 | Mods mState; 58 | }; 59 | 60 | } // namespace Data 61 | 62 | #endif // ALIGNMODINFO_H 63 | -------------------------------------------------------------------------------- /classes/data/canvasmodinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2019 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Data 26 | { 27 | 28 | class CanvasModInfo 29 | { 30 | public: 31 | struct Mods { 32 | int left; 33 | int top; 34 | int right; 35 | int bottom; 36 | 37 | void reset(); 38 | }; 39 | 40 | CanvasModInfo(); 41 | 42 | const Mods summary() const; 43 | 44 | void modify(int left, int top, int right, int bottom); 45 | void commit(); 46 | void reset(); 47 | 48 | const QString toString() const; 49 | 50 | private: 51 | Mods mCommited; 52 | Mods mModified; 53 | }; 54 | 55 | } // namespace Data 56 | 57 | #endif // CANVASMODINFO_H 58 | -------------------------------------------------------------------------------- /classes/data/fontparameters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2015 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "fontsizeunits.h" 26 | 27 | namespace Data 28 | { 29 | namespace Containers 30 | { 31 | 32 | struct FontParameters { 33 | QString family; 34 | QString style; 35 | int size; 36 | FontSizeUnits sizeUnits; 37 | bool monospaced; 38 | bool antiAliasing; 39 | int ascent; 40 | int descent; 41 | QColor foreground; 42 | QColor background; 43 | int multiplicityWidth; 44 | int multiplicityHeight; 45 | }; 46 | 47 | } // namespace Containers 48 | } // namespace Data 49 | 50 | #endif // TFONTPARAMETERS 51 | -------------------------------------------------------------------------------- /classes/data/fontsizeunits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2022 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace Data 31 | { 32 | namespace History 33 | { 34 | 35 | class HistoryRecord : public QObject 36 | { 37 | Q_OBJECT 38 | public: 39 | explicit HistoryRecord(const QStringList* _keys, const QMap* _images, 40 | const QMap* _info, QObject* parent = 0); 41 | virtual ~HistoryRecord(); 42 | 43 | const QStringList* keys() const; 44 | const QMap* images() const; 45 | const QMap* info() const; 46 | 47 | private: 48 | QStringList mKeys; 49 | QMap mImageMap; 50 | QMap mInfoMap; 51 | 52 | signals: 53 | 54 | public slots: 55 | }; 56 | 57 | } // namespace History 58 | } // namespace Data 59 | 60 | #endif // HISTORYRECORD_H 61 | -------------------------------------------------------------------------------- /classes/data/imagesscaledproxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Data 26 | { 27 | namespace Models 28 | { 29 | 30 | class ImagesScaledProxy : public QSortFilterProxyModel 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit ImagesScaledProxy(QObject* parent = 0); 36 | virtual ~ImagesScaledProxy(); 37 | 38 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; 39 | 40 | int scale() const; 41 | 42 | public slots: 43 | void setScale(int value); 44 | 45 | private: 46 | int mScale; 47 | 48 | signals: 49 | void scaleChanged(int value); 50 | }; 51 | 52 | } // namespace Models 53 | } // namespace Data 54 | 55 | #endif // IMAGESSCALEDPROXY_H 56 | -------------------------------------------------------------------------------- /classes/data/revisioninfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace VersionControl 26 | { 27 | 28 | class RevisionInfo 29 | { 30 | public: 31 | static const QString& hash(); 32 | static const QString& hash_abbr(); 33 | static const QString& date(); 34 | static const QString& version(); 35 | }; 36 | 37 | } // namespace VersionControl 38 | 39 | #endif // REVISIONINFO_H 40 | -------------------------------------------------------------------------------- /classes/data/transposeproxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Data 26 | { 27 | namespace Models 28 | { 29 | 30 | class TransposeProxy : public QSortFilterProxyModel 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit TransposeProxy(QObject* parent = 0); 36 | virtual ~TransposeProxy() {} 37 | 38 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; 39 | QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; 40 | QModelIndex parent(const QModelIndex& index) const Q_DECL_OVERRIDE; 41 | 42 | int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; 43 | int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; 44 | 45 | QModelIndex mapFromSource(const QModelIndex& sourceIndex) const Q_DECL_OVERRIDE; 46 | QModelIndex mapToSource(const QModelIndex& proxyIndex) const Q_DECL_OVERRIDE; 47 | 48 | private: 49 | }; 50 | 51 | } // namespace Models 52 | } // namespace Data 53 | 54 | #endif // TRANSPOSEPROXY_H 55 | -------------------------------------------------------------------------------- /classes/imageeditor/editor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2015 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | #include "iimageeditor.h" 27 | 28 | namespace AppUI 29 | { 30 | namespace Images 31 | { 32 | class WindowEditor; 33 | } 34 | } // namespace AppUI 35 | 36 | namespace ImageEditor 37 | { 38 | 39 | class Editor : public QObject, public IImageEditor 40 | { 41 | Q_OBJECT 42 | Q_INTERFACES(ImageEditor::IImageEditor) 43 | 44 | public: 45 | explicit Editor(QObject* parent = 0); 46 | virtual ~Editor(); 47 | 48 | QWidget* widget() const Q_DECL_OVERRIDE; 49 | 50 | const QImage* image() const Q_DECL_OVERRIDE; 51 | void setImage(const QImage* value) Q_DECL_OVERRIDE; 52 | 53 | int scale() const Q_DECL_OVERRIDE; 54 | 55 | signals: 56 | void imageChanged(const QImage* value) Q_DECL_OVERRIDE; 57 | void scaleChanged(int value) Q_DECL_OVERRIDE; 58 | void mouseMoved(const QPoint* value) Q_DECL_OVERRIDE; 59 | 60 | signals: 61 | 62 | public slots: 63 | 64 | private: 65 | AppUI::Images::WindowEditor* mWidget; 66 | 67 | private slots: 68 | void on_imageChanged(); 69 | void on_mouseMove(const QPoint* point); 70 | void on_scaleChanged(int value); 71 | }; 72 | } // namespace ImageEditor 73 | 74 | #endif // EDITOR_H 75 | -------------------------------------------------------------------------------- /classes/imageeditor/iimageeditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2015 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | 27 | namespace ImageEditor 28 | { 29 | class IImageEditor 30 | { 31 | public: 32 | virtual ~IImageEditor() {} 33 | 34 | virtual QWidget* widget() const = 0; 35 | 36 | virtual const QImage* image() const = 0; 37 | virtual void setImage(const QImage* _value) = 0; 38 | 39 | virtual int scale() const = 0; 40 | 41 | signals: 42 | virtual void imageChanged(const QImage* _image) = 0; 43 | virtual void scaleChanged(int _scale) = 0; 44 | virtual void mouseMoved(const QPoint* _point) = 0; 45 | }; 46 | } // namespace ImageEditor 47 | 48 | Q_DECLARE_INTERFACE(ImageEditor::IImageEditor, "riuson.lcd-image-converter/1.0") 49 | 50 | #endif // IIMAGEEDITOR_H 51 | -------------------------------------------------------------------------------- /classes/imageeditor/iimageeditorparams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2015 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | 27 | namespace ImageEditor 28 | { 29 | class IImageEditorParams 30 | { 31 | public: 32 | virtual ~IImageEditorParams() {} 33 | 34 | virtual int scale() const = 0; 35 | virtual const QColor foreColor() const = 0; 36 | virtual const QColor backColor() const = 0; 37 | virtual QWidget* parentWidget() const = 0; 38 | virtual const QPainterPath& selectedPath() const = 0; 39 | }; 40 | } // namespace ImageEditor 41 | 42 | Q_DECLARE_INTERFACE(ImageEditor::IImageEditorParams, "riuson.lcd-image-converter/1.0") 43 | 44 | #endif // IIMAGEEDITORPARAMS_H 45 | -------------------------------------------------------------------------------- /classes/imageeditor/iimageeditortool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2015 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | template class QList; 30 | 31 | namespace ImageEditor 32 | { 33 | namespace Tools 34 | { 35 | 36 | class IImageEditorTool 37 | { 38 | public: 39 | virtual ~IImageEditorTool() {} 40 | 41 | virtual const QString title() const = 0; 42 | virtual const QString tooltip() const = 0; 43 | virtual const QIcon* icon() const = 0; 44 | virtual const QList* actions() const = 0; 45 | virtual const QList* widgets() const = 0; 46 | 47 | public slots: 48 | virtual bool processMouse(QMouseEvent* event, const QImage* imageOriginal, bool inRect) = 0; 49 | 50 | signals: 51 | virtual void started(const QImage* value) = 0; 52 | virtual void processing(const QImage* value) = 0; 53 | virtual void completed(const QImage* value, bool changed) = 0; 54 | }; 55 | 56 | } // namespace Tools 57 | } // namespace ImageEditor 58 | 59 | Q_DECLARE_INTERFACE(ImageEditor::Tools::IImageEditorTool, "riuson.lcd-image-converter/1.0") 60 | 61 | #endif // IIMAGEEDITORTOOL_H 62 | -------------------------------------------------------------------------------- /classes/imageeditor/iimageselection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace ImageEditor 26 | { 27 | 28 | class IImageSelection 29 | { 30 | public: 31 | virtual ~IImageSelection() {} 32 | 33 | virtual const QPainterPath& selectedPath() const = 0; 34 | 35 | signals: 36 | virtual void selectionChanged(const QPainterPath& value) = 0; 37 | }; 38 | 39 | } // namespace ImageEditor 40 | 41 | Q_DECLARE_INTERFACE(ImageEditor::IImageSelection, "riuson.lcd-image-converter/1.0") 42 | 43 | #endif // IIMAGESELECTION_H 44 | -------------------------------------------------------------------------------- /classes/operations/documentoperator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see mSelectedKeys = keys; } 32 | 33 | void DocumentOperator::apply(Data::Containers::IDocument* doc, IOperation& operation) 34 | { 35 | QStringList keys = this->mSelectedKeys.length() == 0 ? doc->dataContainer()->keys() : this->mSelectedKeys; 36 | 37 | if (operation.prepare(doc, keys)) { 38 | doc->beginChanges(); 39 | 40 | operation.applyDocument(doc, keys); 41 | 42 | QListIterator it(keys); 43 | it.toFront(); 44 | 45 | while (it.hasNext()) { 46 | QString key = it.next(); 47 | operation.applyItem(doc, key); 48 | } 49 | 50 | doc->endChanges(false); 51 | } 52 | } 53 | 54 | } // namespace Operations 55 | -------------------------------------------------------------------------------- /classes/operations/documentoperator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace Data 27 | { 28 | namespace Containers 29 | { 30 | class IDocument; 31 | } 32 | } // namespace Data 33 | 34 | namespace Operations 35 | { 36 | class IOperation; 37 | 38 | class DocumentOperator : public QObject 39 | { 40 | Q_OBJECT 41 | public: 42 | explicit DocumentOperator(QObject* parent = 0); 43 | virtual ~DocumentOperator() {} 44 | 45 | void setKeys(const QStringList keys); 46 | void apply(Data::Containers::IDocument* doc, IOperation& operation); 47 | 48 | private: 49 | QStringList mSelectedKeys; 50 | }; 51 | 52 | } // namespace Operations 53 | 54 | #endif // DOCUMENTOPERATOR_H 55 | -------------------------------------------------------------------------------- /classes/operations/fontresize.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see dataContainer()->commonInfo("ascent").toInt(&ok); 36 | 37 | if (ok) { 38 | int descent = doc->dataContainer()->commonInfo("descent").toInt(&ok); 39 | 40 | if (ok) { 41 | if (this->mMap.size() > 0) { 42 | Data::CanvasModInfo::Mods mods = this->mMap.first(); 43 | ascent += mods.top; 44 | descent += mods.bottom; 45 | 46 | doc->dataContainer()->setCommonInfo("ascent", ascent); 47 | doc->dataContainer()->setCommonInfo("descent", descent); 48 | } 49 | } 50 | } 51 | } 52 | 53 | } // namespace Operations 54 | -------------------------------------------------------------------------------- /classes/operations/fontresize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | #include "alignmodinfo.h" 27 | #include "ioperation.h" 28 | 29 | namespace Operations 30 | { 31 | 32 | class ImageAlign : public QObject, public IOperation 33 | { 34 | Q_OBJECT 35 | Q_INTERFACES(Operations::IOperation) 36 | 37 | public: 38 | explicit ImageAlign(QWidget* parentWidget = 0, QObject* parent = 0); 39 | virtual ~ImageAlign() {} 40 | 41 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 42 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 43 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 44 | 45 | protected: 46 | QWidget* mParentWidget; 47 | Data::AlignModInfo::Mods mMods; 48 | }; 49 | 50 | } // namespace Operations 51 | 52 | #endif // IMAGEALIGN_H 53 | -------------------------------------------------------------------------------- /classes/operations/imageeditinexternaltool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | #include "ioperation.h" 27 | 28 | namespace Operations 29 | { 30 | 31 | class ImageEditInExternalTool : public QObject, public IOperation 32 | { 33 | Q_OBJECT 34 | Q_INTERFACES(Operations::IOperation) 35 | 36 | public: 37 | explicit ImageEditInExternalTool(QWidget* parentWidget = 0, QObject* parent = 0); 38 | virtual ~ImageEditInExternalTool() {} 39 | 40 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 41 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 42 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 43 | 44 | private: 45 | QWidget* mParentWidget; 46 | bool mRunningError; 47 | 48 | private slots: 49 | void processError(QProcess::ProcessError error); 50 | }; 51 | 52 | } // namespace Operations 53 | 54 | #endif // IMAGEEDITINEXTERNALTOOL_H 55 | -------------------------------------------------------------------------------- /classes/operations/imageexport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | #include "ioperation.h" 27 | 28 | namespace Operations 29 | { 30 | 31 | class ImageExport : public QObject, public IOperation 32 | { 33 | Q_OBJECT 34 | Q_INTERFACES(Operations::IOperation) 35 | 36 | public: 37 | explicit ImageExport(QWidget* parentWidget = 0, QObject* parent = 0); 38 | virtual ~ImageExport() {} 39 | 40 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 41 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 42 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 43 | 44 | private: 45 | QWidget* mParentWidget; 46 | QStringList mExportFilenames; 47 | int mExportIndex; 48 | 49 | void prepareFilenames(const QStringList& keys, const QString& filename, const QString& ext); 50 | }; 51 | 52 | } // namespace Operations 53 | 54 | #endif // IMAGEEXPORT_H 55 | -------------------------------------------------------------------------------- /classes/operations/imageflip.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "ioperation.h" 26 | 27 | namespace Operations 28 | { 29 | 30 | class ImageFlip : public QObject, public IOperation 31 | { 32 | Q_OBJECT 33 | Q_INTERFACES(Operations::IOperation) 34 | 35 | public: 36 | explicit ImageFlip(QObject* parent = 0); 37 | virtual ~ImageFlip() {} 38 | 39 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 40 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 41 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 42 | 43 | void setOrientation(bool flipHorizontal, bool flipVertical); 44 | 45 | private: 46 | bool mFlipHorizontal; 47 | bool mFlipVertical; 48 | }; 49 | 50 | } // namespace Operations 51 | 52 | #endif // IMAGEFLIP_H 53 | -------------------------------------------------------------------------------- /classes/operations/imagegrayscale.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | 24 | #include "converterhelper.h" 25 | #include "datacontainer.h" 26 | #include "idocument.h" 27 | 28 | namespace Operations 29 | { 30 | 31 | ImageGrayscale::ImageGrayscale(QObject* parent) : QObject(parent) {} 32 | 33 | bool ImageGrayscale::prepare(const Data::Containers::IDocument* doc, const QStringList& keys) 34 | { 35 | Q_UNUSED(doc) 36 | Q_UNUSED(keys) 37 | 38 | return true; 39 | } 40 | 41 | void ImageGrayscale::applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) 42 | { 43 | Q_UNUSED(doc) 44 | Q_UNUSED(keys) 45 | } 46 | 47 | void ImageGrayscale::applyItem(Data::Containers::IDocument* doc, const QString& itemKey) 48 | { 49 | const QImage* original = doc->dataContainer()->image(itemKey); 50 | QImage result(*original); 51 | Parsing::Conversion::ConverterHelper::makeGrayscale(result); 52 | doc->dataContainer()->setImage(itemKey, &result); 53 | } 54 | 55 | } // namespace Operations 56 | -------------------------------------------------------------------------------- /classes/operations/imagegrayscale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "ioperation.h" 26 | 27 | namespace Operations 28 | { 29 | 30 | class ImageGrayscale : public QObject, public IOperation 31 | { 32 | Q_OBJECT 33 | Q_INTERFACES(Operations::IOperation) 34 | 35 | public: 36 | explicit ImageGrayscale(QObject* parent = 0); 37 | virtual ~ImageGrayscale() {} 38 | 39 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 40 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 41 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 42 | }; 43 | 44 | } // namespace Operations 45 | 46 | #endif // IMAGEGRAYSCALE_H 47 | -------------------------------------------------------------------------------- /classes/operations/imageimport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | #include "ioperation.h" 27 | 28 | namespace Operations 29 | { 30 | 31 | class ImageImport : public QObject, public IOperation 32 | { 33 | Q_OBJECT 34 | Q_INTERFACES(Operations::IOperation) 35 | 36 | public: 37 | explicit ImageImport(QWidget* parentWidget = 0, QObject* parent = 0); 38 | virtual ~ImageImport() {} 39 | 40 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 41 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 42 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 43 | 44 | private: 45 | QWidget* mParentWidget; 46 | QStringList mSelectedFiles; 47 | int mImportIndex; 48 | }; 49 | 50 | } // namespace Operations 51 | 52 | #endif // IMAGEIMPORT_H 53 | -------------------------------------------------------------------------------- /classes/operations/imageinverse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | 24 | #include "datacontainer.h" 25 | #include "idocument.h" 26 | 27 | namespace Operations 28 | { 29 | 30 | ImageInverse::ImageInverse(QObject* parent) : QObject(parent) {} 31 | 32 | bool ImageInverse::prepare(const Data::Containers::IDocument* doc, const QStringList& keys) 33 | { 34 | Q_UNUSED(doc) 35 | Q_UNUSED(keys) 36 | 37 | return true; 38 | } 39 | 40 | void ImageInverse::applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) 41 | { 42 | Q_UNUSED(doc) 43 | Q_UNUSED(keys) 44 | } 45 | 46 | void ImageInverse::applyItem(Data::Containers::IDocument* doc, const QString& itemKey) 47 | { 48 | const QImage* original = doc->dataContainer()->image(itemKey); 49 | QImage result(*original); 50 | result.invertPixels(); 51 | doc->dataContainer()->setImage(itemKey, &result); 52 | } 53 | 54 | } // namespace Operations 55 | -------------------------------------------------------------------------------- /classes/operations/imageinverse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "ioperation.h" 26 | 27 | namespace Operations 28 | { 29 | 30 | class ImageInverse : public QObject, public IOperation 31 | { 32 | Q_OBJECT 33 | Q_INTERFACES(Operations::IOperation) 34 | 35 | public: 36 | explicit ImageInverse(QObject* parent = 0); 37 | virtual ~ImageInverse() {} 38 | 39 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 40 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 41 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 42 | }; 43 | 44 | } // namespace Operations 45 | 46 | #endif // IMAGEINVERSE_H 47 | -------------------------------------------------------------------------------- /classes/operations/imageresize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | #include "canvasmodinfo.h" 27 | #include "ioperation.h" 28 | 29 | namespace Operations 30 | { 31 | 32 | class ImageResize : public QObject, public IOperation 33 | { 34 | Q_OBJECT 35 | Q_INTERFACES(Operations::IOperation) 36 | 37 | public: 38 | explicit ImageResize(QWidget* parentWidget = 0, QObject* parent = 0); 39 | virtual ~ImageResize() {} 40 | 41 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 42 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 43 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 44 | 45 | protected: 46 | QWidget* mParentWidget; 47 | QMap mMap; 48 | }; 49 | 50 | } // namespace Operations 51 | 52 | #endif // IMAGERESIZE_H 53 | -------------------------------------------------------------------------------- /classes/operations/imagerotate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "ioperation.h" 26 | 27 | namespace Operations 28 | { 29 | 30 | class ImageRotate : public QObject, public IOperation 31 | { 32 | Q_OBJECT 33 | Q_INTERFACES(Operations::IOperation) 34 | 35 | public: 36 | enum class Angle { None, A90, A180, A270 }; 37 | 38 | explicit ImageRotate(QObject* parent = 0); 39 | virtual ~ImageRotate() {} 40 | 41 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 42 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 43 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 44 | 45 | void setAngle(Angle angle); 46 | 47 | private: 48 | Angle mAngle; 49 | }; 50 | 51 | } // namespace Operations 52 | 53 | #endif // IMAGEROTATE_H 54 | -------------------------------------------------------------------------------- /classes/operations/imageshift.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | #include "ioperation.h" 26 | 27 | namespace Operations 28 | { 29 | 30 | class ImageShift : public QObject, public IOperation 31 | { 32 | Q_OBJECT 33 | Q_INTERFACES(Operations::IOperation) 34 | 35 | public: 36 | enum class Direction { None, Left, Right, Up, Down }; 37 | 38 | explicit ImageShift(QObject* parent = 0); 39 | virtual ~ImageShift() {} 40 | 41 | bool prepare(const Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 42 | void applyDocument(Data::Containers::IDocument* doc, const QStringList& keys) Q_DECL_OVERRIDE; 43 | void applyItem(Data::Containers::IDocument* doc, const QString& itemKey) Q_DECL_OVERRIDE; 44 | 45 | void setDirection(Direction direction); 46 | 47 | private: 48 | Direction mDirection; 49 | }; 50 | 51 | } // namespace Operations 52 | 53 | #endif // IMAGESHIFT_H 54 | -------------------------------------------------------------------------------- /classes/operations/ioperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | template class QVector; 26 | 27 | namespace Settings 28 | { 29 | namespace Presets 30 | { 31 | class Preset; 32 | } 33 | } // namespace Settings 34 | 35 | namespace Parsing 36 | { 37 | namespace Conversion 38 | { 39 | 40 | class BitStream 41 | { 42 | public: 43 | BitStream(Settings::Presets::Preset* preset, QVector* data, int start, int count); 44 | virtual ~BitStream() {} 45 | 46 | void init(); 47 | bool eof() const; 48 | quint32 next(); 49 | 50 | private: 51 | Settings::Presets::Preset* mPreset; 52 | QVector* mData; 53 | int mStart; 54 | int mCount; 55 | int mBlockSize; 56 | bool mSetOnesByDefault; 57 | 58 | int mCurrentPixel; 59 | int mMaskSource; 60 | int mMaskCurrent; 61 | int mBitsReaded; 62 | 63 | bool nextBit(); 64 | // remaining bit count from one pixel 65 | int remain() const; 66 | }; 67 | 68 | } // namespace Conversion 69 | } // namespace Parsing 70 | 71 | #endif // BITSTREAM_H 72 | -------------------------------------------------------------------------------- /classes/parser/convert/conversion_options.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Parsing 26 | { 27 | namespace Conversion 28 | { 29 | namespace Options 30 | { 31 | 32 | enum class ConversionType { Monochrome = 0, Grayscale = 1, Color = 2, Custom = 3 }; 33 | 34 | enum class MonochromeType { Edge = 0, DiffuseDither = 1, OrderedDither = 2, ThresholdDither = 3 }; 35 | 36 | enum class BytesOrder { LittleEndian = 0, BigEndian = 1 }; 37 | 38 | enum class DataBlockSize { Data8 = 0, Data16 = 1, Data24 = 2, Data32 = 3 }; 39 | 40 | enum class DataNumeralSystem { Binary = 2, Octal = 8, Decimal = 10, Hexadecimal = 16 }; 41 | 42 | enum class Rotate { None = 0, Rotate90 = 1, Rotate180 = 2, Rotate270 = 3 }; 43 | 44 | enum class ScanMainDirection { TopToBottom = 0, BottomToTop = 1, LeftToRight = 2, RightToLeft = 3 }; 45 | 46 | enum class ScanSubDirection { Forward = 0, Backward = 1 }; 47 | 48 | enum class CharactersSortOrder { None = 0, Ascending = 1, Descending = 2 }; 49 | 50 | } // namespace Options 51 | } // namespace Conversion 52 | } // namespace Parsing 53 | 54 | #endif // CONVERSION_OPTIONS_H 55 | -------------------------------------------------------------------------------- /classes/parser/convert/convimagepixels.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2017 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace Parsing 27 | { 28 | namespace Conversion 29 | { 30 | 31 | class ConvImagePixels : public QObject 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit ConvImagePixels(const QVector* data, QObject* parent = 0); 36 | virtual ~ConvImagePixels(); 37 | 38 | Q_PROPERTY(int count READ count) 39 | Q_PROPERTY(bool processTerminated READ processTerminated WRITE setProcessTerminated) 40 | 41 | Q_INVOKABLE quint32 pixel(int index); 42 | Q_INVOKABLE void setPixel(int index, quint32 value); 43 | 44 | bool processTerminated() const; 45 | void setProcessTerminated(bool value); 46 | 47 | void getResults(QVector* result) const; 48 | 49 | private: 50 | QVector mPixels; 51 | bool mProcessTerminated; 52 | 53 | int count() const; 54 | }; 55 | 56 | } // namespace Conversion 57 | } // namespace Parsing 58 | 59 | #endif // CONVIMAGEPIXELS_H 60 | -------------------------------------------------------------------------------- /classes/parser/convert/fonthelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | 27 | namespace Data 28 | { 29 | namespace Containers 30 | { 31 | class DataContainer; 32 | } 33 | } // namespace Data 34 | 35 | namespace Parsing 36 | { 37 | namespace Conversion 38 | { 39 | 40 | class FontHelper 41 | { 42 | public: 43 | static QImage drawString(const Data::Containers::DataContainer* data, const QString& value); 44 | static QString escapeControlChars(const QString& value); 45 | static QString unescapeControlChars(const QString& value); 46 | static QSize getCharacterSize(const QFontMetrics& metrics, QChar value); 47 | static QSize getGlyphSize(const QFontMetrics& metrics, QChar value); 48 | static QImage drawCharacter(const QChar value, const QFont& font, const QColor& foreground, const QColor& background, 49 | const int width, const int height, const bool antialiasing, const int multiplicityHeight, 50 | const int multiplicityWidth); 51 | static int roundUp(int original, int multiplicity); 52 | signals: 53 | 54 | public slots: 55 | }; 56 | 57 | } // namespace Conversion 58 | } // namespace Parsing 59 | 60 | #endif // FONTHELPER_H 61 | -------------------------------------------------------------------------------- /classes/parser/parsedimagedata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace Settings 27 | { 28 | namespace Presets 29 | { 30 | class Preset; 31 | } 32 | } // namespace Settings 33 | 34 | namespace Parsing 35 | { 36 | class TagsList; 37 | 38 | class ParsedImageData : public QObject 39 | { 40 | Q_OBJECT 41 | public: 42 | explicit ParsedImageData(Settings::Presets::Preset* preset, const QImage* image, const TagsList& tags, 43 | QObject* parent = 0); 44 | virtual ~ParsedImageData(); 45 | 46 | TagsList* tags() const; 47 | uint hash() const; 48 | 49 | const QString outputImageDataWithEOL(const TagsList& tags) const; 50 | const QString outputImagePreviewWithEOL(const TagsList& tags) const; 51 | 52 | private: 53 | TagsList* mTags; 54 | uint mHash; 55 | QString mPreparedOutputImageData; 56 | QString mPreparedOutputImagePreview; 57 | }; 58 | 59 | } // namespace Parsing 60 | 61 | #endif // PARSEDIMAGEDATA_H 62 | -------------------------------------------------------------------------------- /classes/settings/alignsettings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2022 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | 24 | #include "appsettings.h" 25 | 26 | namespace Settings 27 | { 28 | 29 | int AlignSettings::scale() 30 | { 31 | AppSettings appsett; 32 | QSettings& sett = appsett.get(); 33 | sett.beginGroup("align-preview"); 34 | bool ok; 35 | int result = sett.value("scale", QVariant(1)).toInt(&ok); 36 | sett.endGroup(); 37 | 38 | if (ok) { 39 | return result; 40 | } 41 | 42 | return 1; 43 | } 44 | 45 | void AlignSettings::setScale(int value) 46 | { 47 | AppSettings appsett; 48 | QSettings& sett = appsett.get(); 49 | sett.beginGroup("align-preview"); 50 | sett.setValue("scale", QVariant(value)); 51 | sett.endGroup(); 52 | } 53 | 54 | } // namespace Settings 55 | -------------------------------------------------------------------------------- /classes/settings/alignsettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2022 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Settings 26 | { 27 | 28 | class ConversionPreviewOptions 29 | { 30 | public: 31 | static int scale(); 32 | static void setScale(int value); 33 | 34 | private: 35 | static const QString GroupName; 36 | }; 37 | 38 | } // namespace Settings 39 | 40 | #endif // CONVERSIONPREVIEWOPTIONS_H 41 | -------------------------------------------------------------------------------- /classes/settings/externaltooloptions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Settings 26 | { 27 | 28 | class ExternalToolOptions 29 | { 30 | public: 31 | static const QString imageEditor(); 32 | static void setImageEditor(const QString& value); 33 | }; 34 | 35 | } // namespace Settings 36 | 37 | #endif // EXTERNALTOOLOPTIONS_H 38 | -------------------------------------------------------------------------------- /classes/settings/filedialogoptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2016 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Settings 26 | { 27 | 28 | class FileDialogOptions 29 | { 30 | public: 31 | enum class Dialogs { 32 | None = 0, 33 | 34 | OpenDocument, 35 | SaveDocument, 36 | ConvertDocument, 37 | 38 | ImportImage, 39 | ExportImage, 40 | 41 | ImportPreset, 42 | ExportPreset, 43 | 44 | TemplateImage, 45 | TemplateFont 46 | }; 47 | 48 | static int filterIndex(Dialogs dialog); 49 | static void setFilterIndex(Dialogs dialog, int value); 50 | static const QString directory(Dialogs dialog); 51 | static void setDirectory(Dialogs dialog, const QString& value); 52 | 53 | private: 54 | static bool itemName(Dialogs item, QString* name); 55 | static int getInteger(const QString& name); 56 | static void setInteger(const QString& name, int value); 57 | static const QString getString(const QString& name); 58 | static void setString(const QString& name, const QString& value); 59 | }; 60 | 61 | } // namespace Settings 62 | 63 | #endif // FILEDIALOGOPTIONS_H 64 | -------------------------------------------------------------------------------- /classes/settings/fonteditoroptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Settings 26 | { 27 | 28 | class FontEditorOptions 29 | { 30 | public: 31 | static int scale(); 32 | static void setScale(int value); 33 | 34 | static QColor foreColor(); 35 | static QColor backColor(); 36 | static void setForeColor(const QColor& value); 37 | static void setBackColor(const QColor& value); 38 | }; 39 | 40 | } // namespace Settings 41 | 42 | #endif // FONTEDITOROPTIONS_H 43 | -------------------------------------------------------------------------------- /classes/settings/imageeditoroptions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2015 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | 24 | #include "appsettings.h" 25 | 26 | namespace Settings 27 | { 28 | 29 | QByteArray ImageEditorOptions::toolbarsState() 30 | { 31 | AppSettings appsett; 32 | QSettings& sett = appsett.get(); 33 | sett.beginGroup("window-image-editor"); 34 | sett.beginGroup("toolbar-options"); 35 | 36 | QByteArray result = sett.value("state", QByteArray()).toByteArray(); 37 | 38 | sett.endGroup(); 39 | sett.endGroup(); 40 | 41 | return result; 42 | } 43 | 44 | void ImageEditorOptions::setToolbarsState(const QByteArray& value) 45 | { 46 | AppSettings appsett; 47 | QSettings& sett = appsett.get(); 48 | sett.beginGroup("window-image-editor"); 49 | sett.beginGroup("toolbar-options"); 50 | 51 | sett.setValue("state", value); 52 | 53 | sett.endGroup(); 54 | sett.endGroup(); 55 | } 56 | 57 | } // namespace Settings 58 | -------------------------------------------------------------------------------- /classes/settings/imageeditoroptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2015 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | 27 | namespace Settings 28 | { 29 | 30 | class ImageEditorOptions 31 | { 32 | public: 33 | static QByteArray toolbarsState(void); 34 | static void setToolbarsState(const QByteArray& value); 35 | }; 36 | 37 | } // namespace Settings 38 | 39 | #endif // IMAGEEDITOROPTIONS_H 40 | -------------------------------------------------------------------------------- /classes/settings/languageoptions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | 24 | #include "appsettings.h" 25 | 26 | namespace Settings 27 | { 28 | 29 | const QString LanguageOptions::locale() 30 | { 31 | AppSettings appsett; 32 | QSettings& sett = appsett.get(); 33 | sett.beginGroup("language"); 34 | QString result = sett.value("selected", QVariant("")).toString(); 35 | sett.endGroup(); 36 | 37 | return result; 38 | } 39 | 40 | bool LanguageOptions::setLocale(const QString& value) 41 | { 42 | bool isSuccessfully = false; 43 | 44 | AppSettings appsett; 45 | QSettings& sett = appsett.get(); 46 | sett.beginGroup("language"); 47 | QFile file(":/translations/" + value); 48 | 49 | if (file.exists()) { 50 | sett.setValue("selected", QVariant(value)); 51 | isSuccessfully = true; 52 | } else { 53 | sett.setValue("selected", QVariant("")); 54 | } 55 | 56 | sett.endGroup(); 57 | 58 | return isSuccessfully; 59 | } 60 | 61 | } // namespace Settings 62 | -------------------------------------------------------------------------------- /classes/settings/languageoptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Settings 26 | { 27 | 28 | class LanguageOptions 29 | { 30 | public: 31 | static const QString locale(); 32 | static bool setLocale(const QString& value); 33 | }; 34 | 35 | } // namespace Settings 36 | 37 | #endif // LANGUAGEOPTIONS_H 38 | -------------------------------------------------------------------------------- /classes/settings/presets/ipresetsoptionspart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2018 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | 27 | namespace Settings 28 | { 29 | namespace Presets 30 | { 31 | 32 | class IPresetOptionsPart 33 | { 34 | public: 35 | virtual ~IPresetOptionsPart() {} 36 | 37 | virtual bool load(QSettings* settings) = 0; 38 | virtual bool loadXmlElement(QDomElement element) = 0; 39 | virtual void save(QSettings* settings) = 0; 40 | virtual void saveXmlElement(QDomElement element) = 0; 41 | 42 | virtual QString groupName() const = 0; 43 | }; 44 | 45 | } // namespace Presets 46 | } // namespace Settings 47 | 48 | Q_DECLARE_INTERFACE(Settings::Presets::IPresetOptionsPart, "riuson.lcd-image-converter/1.0") 49 | 50 | #endif // IPRESETSOPTIONSPART_H 51 | -------------------------------------------------------------------------------- /classes/settings/recentlist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | // class QStringList; 26 | // class QStringListIterator; 27 | 28 | namespace Settings 29 | { 30 | 31 | class RecentList : public QObject 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit RecentList(QObject* parent = 0); 36 | virtual ~RecentList(); 37 | 38 | void add(const QString& filename); 39 | enum { MaxRecentFiles = 10 }; 40 | const QStringList* files() const; 41 | 42 | private: 43 | QStringList* mFiles; 44 | signals: 45 | void listChanged(); 46 | public slots: 47 | }; 48 | 49 | } // namespace Settings 50 | 51 | #endif // RECENTLIST_H 52 | -------------------------------------------------------------------------------- /classes/settings/resizesettings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | 24 | #include "appsettings.h" 25 | 26 | namespace Settings 27 | { 28 | 29 | int ResizeSettings::scale() 30 | { 31 | AppSettings appsett; 32 | QSettings& sett = appsett.get(); 33 | sett.beginGroup("crop-preview"); 34 | bool ok; 35 | int result = sett.value("scale", QVariant(1)).toInt(&ok); 36 | sett.endGroup(); 37 | 38 | if (ok) { 39 | return result; 40 | } 41 | 42 | return 1; 43 | } 44 | 45 | void ResizeSettings::setScale(int value) 46 | { 47 | AppSettings appsett; 48 | QSettings& sett = appsett.get(); 49 | sett.beginGroup("crop-preview"); 50 | sett.setValue("scale", QVariant(value)); 51 | sett.endGroup(); 52 | } 53 | 54 | } // namespace Settings 55 | -------------------------------------------------------------------------------- /classes/settings/resizesettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see StatusData::keys() const { return this->mData.keys(); } 30 | 31 | const QVariant StatusData::data(const StatusType key) const { return this->mData.value(key, QString()); } 32 | 33 | void StatusData::setData(const StatusType key, const QVariant& value) 34 | { 35 | this->mData.insert(key, value); 36 | emit this->changed(); 37 | } 38 | 39 | void StatusData::removeData(const StatusData::StatusType key) 40 | { 41 | this->mData.remove(key); 42 | emit this->changed(); 43 | } 44 | 45 | } // namespace Status 46 | } // namespace AppUI 47 | -------------------------------------------------------------------------------- /classes/status/statusdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | #include 27 | 28 | namespace AppUI 29 | { 30 | namespace Status 31 | { 32 | 33 | class StatusData : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | enum StatusType { ImageIndex, ImagesCount, ImageSize, MouseCoordinates, Scale }; 38 | 39 | explicit StatusData(QObject* parent = 0); 40 | virtual ~StatusData() {} 41 | 42 | const QList keys() const; 43 | const QVariant data(const StatusType key) const; 44 | void setData(const StatusType key, const QVariant& value); 45 | void removeData(const StatusType key); 46 | 47 | private: 48 | QMap mData; 49 | 50 | signals: 51 | void changed(); 52 | }; 53 | 54 | } // namespace Status 55 | } // namespace AppUI 56 | 57 | #endif // STATUSDATA_H 58 | -------------------------------------------------------------------------------- /classes/status/statusmanager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | #include 27 | 28 | #include "statusdata.h" 29 | 30 | namespace AppUI 31 | { 32 | namespace Status 33 | { 34 | 35 | class StatusManager : public QObject 36 | { 37 | Q_OBJECT 38 | public: 39 | explicit StatusManager(QStatusBar* statusBar, QObject* parent = 0); 40 | virtual ~StatusManager(); 41 | 42 | void updateData(const StatusData* statuses); 43 | void hideAll(); 44 | 45 | private: 46 | QStatusBar* mBar; 47 | QMap mList; 48 | 49 | void updateItem(StatusData::StatusType key, const StatusData* statuses); 50 | void addItem(StatusData::StatusType key); 51 | void hideItem(StatusData::StatusType key); 52 | 53 | signals: 54 | 55 | public slots: 56 | }; 57 | 58 | } // namespace Status 59 | } // namespace AppUI 60 | 61 | #endif // STATUSMANAGER_H 62 | -------------------------------------------------------------------------------- /controls/about/dialogabout.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2010 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Ui 26 | { 27 | class DialogAbout; 28 | } 29 | 30 | namespace AppUI 31 | { 32 | namespace About 33 | { 34 | 35 | class DialogAbout : public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit DialogAbout(QWidget* parent = 0); 41 | virtual ~DialogAbout(); 42 | 43 | private: 44 | Ui::DialogAbout* ui; 45 | 46 | void showLicense(); 47 | }; 48 | 49 | } // namespace About 50 | } // namespace AppUI 51 | 52 | #endif // DIALOGABOUT_H 53 | -------------------------------------------------------------------------------- /controls/fonts/font-changed/dialogfontchanged.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see setupUi(this); 32 | 33 | this->mRegenerateAll = false; 34 | } 35 | 36 | DialogFontChanged::~DialogFontChanged() { delete ui; } 37 | 38 | bool DialogFontChanged::regenerateAll() const { return this->mRegenerateAll; } 39 | 40 | void DialogFontChanged::on_buttonRegenerateAll_clicked() 41 | { 42 | this->mRegenerateAll = true; 43 | // this->setResult(QDialog::Accepted); 44 | // this->close(); 45 | this->accept(); 46 | } 47 | 48 | void DialogFontChanged::on_buttonGenerateNewOnly_clicked() 49 | { 50 | this->mRegenerateAll = false; 51 | // this->setResult(QDialog::Accepted); 52 | // this->close(); 53 | this->accept(); 54 | } 55 | 56 | void DialogFontChanged::on_buttonCancel_clicked() 57 | { 58 | // this->setResult(QDialog::Rejected); 59 | // this->close(); 60 | this->reject(); 61 | } 62 | 63 | } // namespace Fonts 64 | } // namespace AppUI 65 | -------------------------------------------------------------------------------- /controls/fonts/font-changed/dialogfontchanged.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Ui 26 | { 27 | class DialogFontChanged; 28 | } 29 | 30 | namespace AppUI 31 | { 32 | namespace Fonts 33 | { 34 | 35 | class DialogFontChanged : public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit DialogFontChanged(QWidget* parent = 0); 41 | virtual ~DialogFontChanged(); 42 | 43 | bool regenerateAll() const; 44 | 45 | private: 46 | Ui::DialogFontChanged* ui; 47 | 48 | bool mRegenerateAll; 49 | 50 | private slots: 51 | void on_buttonRegenerateAll_clicked(); 52 | void on_buttonGenerateNewOnly_clicked(); 53 | void on_buttonCancel_clicked(); 54 | }; 55 | 56 | } // namespace Fonts 57 | } // namespace AppUI 58 | 59 | #endif // DIALOGFONTCHANGED_H 60 | -------------------------------------------------------------------------------- /controls/fonts/font-changed/dialogfontchanged.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogFontChanged 4 | 5 | 6 | 7 | 0 8 | 0 9 | 334 10 | 234 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | Font changed 21 | 22 | 23 | 24 | 25 | 26 | Update all characters 27 | 28 | 29 | Save new font parameters and regenerate all characters 30 | 31 | 32 | 33 | 34 | 35 | 36 | Add/remove only 37 | 38 | 39 | Add new characters with new parameters or remove existing 40 | 41 | 42 | 43 | 44 | 45 | 46 | Cancel 47 | 48 | 49 | true 50 | 51 | 52 | Don't change anything 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /controls/fonts/font-editor/editortabfont.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | EditorTabFont 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /controls/fonts/font-new/charactersmodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2010 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace AppUI 27 | { 28 | namespace Fonts 29 | { 30 | 31 | class CharactersModel : public QAbstractItemModel 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit CharactersModel(QObject* parent = 0); 36 | virtual ~CharactersModel() {} 37 | 38 | int rowCount(const QModelIndex& parent) const; 39 | int columnCount(const QModelIndex& parent) const; 40 | QVariant headerData(int section, Qt::Orientation orientation, int role) const; 41 | QVariant data(const QModelIndex& index, int role) const; 42 | QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; 43 | QModelIndex parent(const QModelIndex& index) const; 44 | 45 | void setCodesRange(quint32 first, quint32 last); 46 | 47 | private: 48 | quint32 mDesiredCode1; 49 | quint32 mDesiredCode2; 50 | quint32 mResultCode1; 51 | quint32 mResultCode2; 52 | 53 | signals: 54 | 55 | public slots: 56 | }; 57 | 58 | } // namespace Fonts 59 | } // namespace AppUI 60 | 61 | #endif // CHARACTERSMODEL_H 62 | -------------------------------------------------------------------------------- /controls/fonts/font-new/unicodeblocksfiltermodel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see mName = QString(); 30 | } 31 | 32 | bool UnicodeBlocksFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const 33 | { 34 | if (this->mName.isEmpty()) { 35 | return true; 36 | } 37 | 38 | QModelIndex index = this->sourceModel()->index(source_row, 0, source_parent); 39 | QString name = this->sourceModel()->data(index).toString(); 40 | 41 | return (name.contains(this->mName, Qt::CaseInsensitive)); 42 | } 43 | 44 | void UnicodeBlocksFilterModel::setNameFilter(const QString& name) 45 | { 46 | this->beginResetModel(); 47 | 48 | this->mName = name; 49 | 50 | this->endResetModel(); 51 | } 52 | 53 | } // namespace Fonts 54 | } // namespace AppUI 55 | -------------------------------------------------------------------------------- /controls/fonts/font-new/unicodeblocksfiltermodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace AppUI 26 | { 27 | namespace Fonts 28 | { 29 | 30 | class UnicodeBlocksFilterModel : public QSortFilterProxyModel 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit UnicodeBlocksFilterModel(QObject* parent = 0); 35 | virtual ~UnicodeBlocksFilterModel() {} 36 | 37 | bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const Q_DECL_OVERRIDE; 38 | 39 | void setNameFilter(const QString& name); 40 | 41 | private: 42 | QString mName; 43 | 44 | signals: 45 | 46 | public slots: 47 | }; 48 | 49 | } // namespace Fonts 50 | } // namespace AppUI 51 | 52 | #endif // UNICODEBLOCKSFILTERMODEL_H 53 | -------------------------------------------------------------------------------- /controls/fonts/font-new/unicodeblocksmodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace AppUI 27 | { 28 | namespace Fonts 29 | { 30 | 31 | class UnicodeBlock 32 | { 33 | public: 34 | UnicodeBlock(const QString& name, quint32 firstCode, quint32 lastCode); 35 | const QString& name() const; 36 | quint32 firstCode() const; 37 | quint32 lastCode() const; 38 | 39 | private: 40 | QString mName; 41 | quint32 mFirstCode; 42 | quint32 mLastCode; 43 | }; 44 | 45 | class UnicodeBlocksModel : public QAbstractListModel 46 | { 47 | Q_OBJECT 48 | public: 49 | explicit UnicodeBlocksModel(QObject* parent = 0); 50 | virtual ~UnicodeBlocksModel() {} 51 | 52 | enum UnicodeBlocksModelRole { FirstCodeRole = Qt::UserRole + 1, LastCodeRole = Qt::UserRole + 2 }; 53 | 54 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; 55 | int rowCount(const QModelIndex& parent) const Q_DECL_OVERRIDE; 56 | 57 | private: 58 | QList mList; 59 | 60 | signals: 61 | 62 | public slots: 63 | }; 64 | 65 | } // namespace Fonts 66 | } // namespace AppUI 67 | 68 | #endif // QUNICODEBLOCKSMODEL_H 69 | -------------------------------------------------------------------------------- /controls/fonts/font-preview/dialogfontpreview.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | 27 | #include "idocument.h" 28 | 29 | namespace Ui 30 | { 31 | class DialogFontPreview; 32 | } 33 | 34 | namespace AppUI 35 | { 36 | namespace Fonts 37 | { 38 | 39 | class DialogFontPreview : public QDialog 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit DialogFontPreview(QWidget* parent = 0); 45 | virtual ~DialogFontPreview(); 46 | 47 | void setDocument(Data::Containers::IDocument* document); 48 | 49 | private: 50 | Ui::DialogFontPreview* ui; 51 | Data::Containers::IDocument* mDocument; 52 | QImage mOriginalImage; 53 | QImage mScaledImage; 54 | 55 | private slots: 56 | void on_lineEditText_textChanged(const QString& text); 57 | void on_spinBoxScale_valueChanged(int i); 58 | }; 59 | 60 | } // namespace Fonts 61 | } // namespace AppUI 62 | 63 | #endif // DIALOGFONTPREVIEW_H 64 | -------------------------------------------------------------------------------- /controls/fonts/font-range/dialogfontrange.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2014 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace Ui 27 | { 28 | class DialogFontRange; 29 | } 30 | 31 | namespace AppUI 32 | { 33 | namespace Fonts 34 | { 35 | 36 | class DialogFontRange : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | explicit DialogFontRange(QWidget* parent = 0); 42 | virtual ~DialogFontRange(); 43 | 44 | const QString& resultString() const; 45 | 46 | private: 47 | Ui::DialogFontRange* ui; 48 | QString mResultString; 49 | QCompleter* mEncodingCompleter; 50 | 51 | private slots: 52 | void updatePreview(); 53 | void updatePreview(const QString& encoding, int from, int to, bool bigEndian); 54 | void on_plainTextEditPreview_textChanged(); 55 | }; 56 | 57 | } // namespace Fonts 58 | } // namespace AppUI 59 | 60 | #endif // DIALOGFONTRANGE_H 61 | -------------------------------------------------------------------------------- /controls/images/editortabimage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | EditorTabImage 6 | 7 | 8 | 9 | 0 10 | 0 11 | 400 12 | 300 13 | 14 | 15 | 16 | Form 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /controls/main/revisionlabel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see setText(VersionControl::RevisionInfo::hash_abbr()); 32 | 33 | this->setForegroundRole(QPalette::Midlight); 34 | } 35 | 36 | } // namespace Revision 37 | } // namespace AppUI 38 | -------------------------------------------------------------------------------- /controls/main/revisionlabel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace AppUI 26 | { 27 | namespace Revision 28 | { 29 | 30 | class RevisionLabel : public QLabel 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit RevisionLabel(QWidget* parent = 0); 35 | virtual ~RevisionLabel() {} 36 | 37 | signals: 38 | 39 | public slots: 40 | }; 41 | 42 | } // namespace Revision 43 | } // namespace AppUI 44 | 45 | #endif // REVISIONLABEL_H 46 | -------------------------------------------------------------------------------- /controls/resize/imagesfilterproxy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 23 | 24 | namespace Data 25 | { 26 | namespace Models 27 | { 28 | 29 | ImagesFilterProxy::ImagesFilterProxy(QObject* parent) : QSortFilterProxyModel(parent) 30 | { 31 | this->mKeys = new QStringList(); 32 | } 33 | 34 | ImagesFilterProxy::~ImagesFilterProxy() { delete this->mKeys; } 35 | 36 | bool ImagesFilterProxy::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const 37 | { 38 | QModelIndex index = this->sourceModel()->index(source_row, 0, source_parent); 39 | QString name = this->sourceModel()->data(index).toString(); 40 | 41 | return (this->mKeys->contains(name, Qt::CaseSensitive)); 42 | } 43 | 44 | void ImagesFilterProxy::setFilter(const QStringList& keys) 45 | { 46 | emit this->beginResetModel(); 47 | 48 | this->mKeys->clear(); 49 | this->mKeys->append(keys); 50 | 51 | emit this->endResetModel(); 52 | } 53 | 54 | } // namespace Models 55 | } // namespace Data 56 | -------------------------------------------------------------------------------- /controls/resize/imagesfilterproxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace Data 27 | { 28 | namespace Models 29 | { 30 | 31 | class ImagesFilterProxy : public QSortFilterProxyModel 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit ImagesFilterProxy(QObject* parent = 0); 36 | virtual ~ImagesFilterProxy(); 37 | 38 | bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const Q_DECL_OVERRIDE; 39 | 40 | void setFilter(const QStringList& keys); 41 | 42 | private: 43 | QStringList* mKeys; 44 | }; 45 | 46 | } // namespace Models 47 | } // namespace Data 48 | 49 | #endif // IMAGESFILTERPROXY_H 50 | -------------------------------------------------------------------------------- /controls/save-changes/dialogsavechanges.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2010 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace AppUI 27 | { 28 | namespace CommonDialogs 29 | { 30 | 31 | class DialogSaveChanges : public QObject 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit DialogSaveChanges(const QString& documentName, QWidget* parent = 0); 37 | virtual ~DialogSaveChanges(); 38 | 39 | enum SaveChangesResultCode { Save = 1, SaveAs = 2, DontSave = 3, Cancel = 0 }; 40 | int answer(); 41 | int exec(); 42 | 43 | private: 44 | SaveChangesResultCode mAnswer; 45 | QMessageBox* mBox; 46 | 47 | private slots: 48 | void on_messageBox_finished(int result); 49 | }; 50 | 51 | } // namespace CommonDialogs 52 | } // namespace AppUI 53 | 54 | #endif // DIALOGSAVECHANGES_H 55 | -------------------------------------------------------------------------------- /controls/setup/dialogexternaleditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Ui 26 | { 27 | class DialogExternalEditor; 28 | } 29 | 30 | namespace AppUI 31 | { 32 | namespace Setup 33 | { 34 | 35 | class DialogExternalEditor : public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit DialogExternalEditor(QWidget* parent = 0); 41 | virtual ~DialogExternalEditor(); 42 | 43 | private: 44 | Ui::DialogExternalEditor* ui; 45 | 46 | private slots: 47 | void on_pushButtonBrowse_clicked(); 48 | 49 | protected: 50 | void done(int result) Q_DECL_OVERRIDE; 51 | }; 52 | 53 | } // namespace Setup 54 | } // namespace AppUI 55 | 56 | #endif // DIALOGEXTERNALEDITOR_H 57 | -------------------------------------------------------------------------------- /controls/setup/parts/matrix/matrixitemdelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2010 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace AppUI 27 | { 28 | namespace Setup 29 | { 30 | namespace Parts 31 | { 32 | namespace Matrix 33 | { 34 | 35 | class MatrixItemDelegate : public QItemDelegate 36 | { 37 | public: 38 | MatrixItemDelegate(QObject* pobj = 0); 39 | virtual ~MatrixItemDelegate() {} 40 | 41 | void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const Q_DECL_OVERRIDE; 42 | 43 | public: 44 | QColor color() const; 45 | void setColor(const QColor& value); 46 | 47 | private: 48 | QColor mColor; 49 | }; 50 | 51 | } // namespace Matrix 52 | } // namespace Parts 53 | } // namespace Setup 54 | } // namespace AppUI 55 | 56 | #endif // MATRIXITEMDELEGATE_H 57 | -------------------------------------------------------------------------------- /controls/setup/parts/matrix/setuptabmatrix.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SetupTabMatrix 4 | 5 | 6 | 7 | 0 8 | 0 9 | 611 10 | 267 11 | 12 | 13 | 14 | Matrix 15 | 16 | 17 | 18 | 19 | 20 | 21 | 0 22 | 0 23 | 24 | 25 | 26 | Qt::CustomContextMenu 27 | 28 | 29 | true 30 | 31 | 32 | 10 33 | 34 | 35 | 10 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /controls/setup/parts/prepare/preprocessing/setuptabpreparepreprocessing.h: -------------------------------------------------------------------------------- 1 | #ifndef SETUPTABPREPAREPREPROCESSING_H 2 | #define SETUPTABPREPAREPREPROCESSING_H 3 | 4 | #include "conversion_options.h" 5 | 6 | #include 7 | 8 | namespace Ui 9 | { 10 | class SetupTabPreparePreprocessing; 11 | } 12 | 13 | namespace Settings 14 | { 15 | namespace Presets 16 | { 17 | class Preset; 18 | } 19 | } // namespace Settings 20 | 21 | namespace AppUI 22 | { 23 | namespace Setup 24 | { 25 | namespace Parts 26 | { 27 | namespace Prepare 28 | { 29 | 30 | class SetupTabPreparePreprocessing : public QWidget 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit SetupTabPreparePreprocessing(Settings::Presets::Preset* preset, QWidget* parent = 0); 36 | virtual ~SetupTabPreparePreprocessing(); 37 | 38 | public slots: 39 | void matrixChanged(); 40 | 41 | private: 42 | Ui::SetupTabPreparePreprocessing* ui; 43 | Settings::Presets::Preset* mPreset; 44 | QPixmap mPixmapScanning; 45 | QPixmap mPixmapScanPreview; 46 | 47 | private slots: 48 | void on_comboBoxConversionType_currentIndexChanged(int index); 49 | void on_comboBoxMonochromeType_currentIndexChanged(int index); 50 | void on_checkBoxInverse_toggled(bool value); 51 | void on_horizontalScrollBarEdge_valueChanged(int value); 52 | void on_plainTextEditCustomScript_textChanged(); 53 | void on_lineEditDemoInput_textChanged(); 54 | void updateState(); 55 | void updateScript(); 56 | }; 57 | 58 | } // namespace Prepare 59 | } // namespace Parts 60 | } // namespace Setup 61 | } // namespace AppUI 62 | 63 | #endif // SETUPTABPREPAREPREPROCESSING_H 64 | -------------------------------------------------------------------------------- /controls/setup/parts/prepare/scanning/setuptabpreparescanning.h: -------------------------------------------------------------------------------- 1 | #ifndef SETUPTABPREPARESCANNING_H 2 | #define SETUPTABPREPARESCANNING_H 3 | 4 | #include "conversion_options.h" 5 | 6 | #include 7 | 8 | namespace Ui 9 | { 10 | class SetupTabPrepareScanning; 11 | } 12 | 13 | namespace Settings 14 | { 15 | namespace Presets 16 | { 17 | class Preset; 18 | } 19 | } // namespace Settings 20 | 21 | namespace AppUI 22 | { 23 | namespace Setup 24 | { 25 | namespace Parts 26 | { 27 | namespace Prepare 28 | { 29 | class DemoGenerator; 30 | 31 | class SetupTabPrepareScanning : public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit SetupTabPrepareScanning(Settings::Presets::Preset* preset, QWidget* parent = 0); 37 | virtual ~SetupTabPrepareScanning(); 38 | 39 | public slots: 40 | void matrixChanged(); 41 | 42 | private: 43 | Ui::SetupTabPrepareScanning* ui; 44 | Settings::Presets::Preset* mPreset; 45 | QPixmap mPixmapScanning; 46 | QPixmap mPixmapScanPreview; 47 | DemoGenerator* mDemoGen; 48 | 49 | private slots: 50 | void on_comboBoxScanMain_currentIndexChanged(int index); 51 | void on_comboBoxScanSub_currentIndexChanged(int index); 52 | void on_checkBoxBands_toggled(bool value); 53 | void on_spinBoxBandWidth_valueChanged(int value); 54 | void on_checkBoxUseCustomScript_toggled(bool value); 55 | void on_plainTextEditCustomScript_textChanged(); 56 | void updateState(); 57 | void updateScript(); 58 | void demoPixmapChanged(const QPixmap& pixmap); 59 | void demoScriptError(const QString& value); 60 | void on_spinBoxAnimationTime_valueChanged(int value); 61 | void on_spinBoxAnimationInterval_valueChanged(int value); 62 | }; 63 | 64 | } // namespace Prepare 65 | } // namespace Parts 66 | } // namespace Setup 67 | } // namespace AppUI 68 | 69 | #endif // SETUPTABPREPARESCANNING_H 70 | -------------------------------------------------------------------------------- /controls/setup/parts/prepare/setuptabprepare.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 26 | 27 | namespace Ui 28 | { 29 | class SetupTabPrepare; 30 | } 31 | 32 | namespace Settings 33 | { 34 | namespace Presets 35 | { 36 | class Preset; 37 | } 38 | } // namespace Settings 39 | 40 | namespace AppUI 41 | { 42 | namespace Setup 43 | { 44 | namespace Parts 45 | { 46 | namespace Prepare 47 | { 48 | class SetupTabPrepareScanning; 49 | class SetupTabPreparePreprocessing; 50 | 51 | class SetupTabPrepare : public QWidget 52 | { 53 | Q_OBJECT 54 | 55 | public: 56 | explicit SetupTabPrepare(Settings::Presets::Preset* preset, QWidget* parent = 0); 57 | virtual ~SetupTabPrepare(); 58 | 59 | public slots: 60 | void matrixChanged(); 61 | 62 | private: 63 | Ui::SetupTabPrepare* ui; 64 | Settings::Presets::Preset* mPreset; 65 | SetupTabPreparePreprocessing* mTabPreprocessing; 66 | SetupTabPrepareScanning* mTabScanning; 67 | 68 | private slots: 69 | }; 70 | 71 | } // namespace Prepare 72 | } // namespace Parts 73 | } // namespace Setup 74 | } // namespace AppUI 75 | 76 | #endif // SETUPTABPREPARE_H 77 | -------------------------------------------------------------------------------- /controls/setup/parts/prepare/setuptabprepare.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SetupTabPrepare 4 | 5 | 6 | 7 | 0 8 | 0 9 | 682 10 | 411 11 | 12 | 13 | 14 | Prepare 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /controls/setup/parts/reordering/reorderingitemdelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | 26 | namespace AppUI 27 | { 28 | namespace Setup 29 | { 30 | namespace Parts 31 | { 32 | namespace Reordering 33 | { 34 | 35 | class ReorderingItemDelegate : public QItemDelegate 36 | { 37 | Q_OBJECT 38 | public: 39 | explicit ReorderingItemDelegate(QObject* parent = 0); 40 | virtual ~ReorderingItemDelegate() {} 41 | 42 | void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const Q_DECL_OVERRIDE; 43 | 44 | public: 45 | QColor color() const; 46 | void setColor(const QColor& value); 47 | 48 | private: 49 | QColor mColor; 50 | }; 51 | 52 | } // namespace Reordering 53 | } // namespace Parts 54 | } // namespace Setup 55 | } // namespace AppUI 56 | 57 | #endif // REORDERINGITEMDELEGATE_H 58 | -------------------------------------------------------------------------------- /controls/setup/parts/reordering/setuptabreordering.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SetupTabReordering 4 | 5 | 6 | 7 | 0 8 | 0 9 | 611 10 | 267 11 | 12 | 13 | 14 | Reordering 15 | 16 | 17 | 18 | 19 | 20 | 21 | 0 22 | 0 23 | 24 | 25 | 26 | Qt::CustomContextMenu 27 | 28 | 29 | true 30 | 31 | 32 | 10 33 | 34 | 35 | 10 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /controls/setup/parts/templates/setuptabtemplates.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Ui 26 | { 27 | class SetupTabTemplates; 28 | } 29 | 30 | namespace Settings 31 | { 32 | namespace Presets 33 | { 34 | class Preset; 35 | } 36 | } // namespace Settings 37 | 38 | namespace AppUI 39 | { 40 | namespace Setup 41 | { 42 | namespace Parts 43 | { 44 | namespace Templates 45 | { 46 | 47 | class SetupTabTemplates : public QWidget 48 | { 49 | Q_OBJECT 50 | 51 | public: 52 | explicit SetupTabTemplates(Settings::Presets::Preset* preset, QWidget* parent = 0); 53 | virtual ~SetupTabTemplates(); 54 | 55 | private: 56 | Ui::SetupTabTemplates* ui; 57 | Settings::Presets::Preset* mPreset; 58 | 59 | private slots: 60 | void matrixChanged(); 61 | void on_pushButtonBrowseImage_clicked(); 62 | void on_pushButtonBrowseFont_clicked(); 63 | void on_lineEditImage_editingFinished(); 64 | void on_lineEditFont_editingFinished(); 65 | }; 66 | 67 | } // namespace Templates 68 | } // namespace Parts 69 | } // namespace Setup 70 | } // namespace AppUI 71 | 72 | #endif // SETUPTABTEMPLATES_H 73 | -------------------------------------------------------------------------------- /controls/setup/parts/templates/setuptabtemplates.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SetupTabTemplates 4 | 5 | 6 | 7 | 0 8 | 0 9 | 401 10 | 250 11 | 12 | 13 | 14 | Templates 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ... 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ... 34 | 35 | 36 | 37 | 38 | 39 | 40 | Image: 41 | 42 | 43 | 44 | 45 | 46 | 47 | Font: 48 | 49 | 50 | 51 | 52 | 53 | 54 | Qt::Vertical 55 | 56 | 57 | 58 | 20 59 | 40 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /controls/start/starttab.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2012 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Ui 26 | { 27 | class StartTab; 28 | } 29 | 30 | #include 31 | 32 | namespace AppUI 33 | { 34 | namespace Start 35 | { 36 | 37 | class StartTab : public QWidget 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | explicit StartTab(QWidget* parent = 0); 43 | virtual ~StartTab(); 44 | 45 | void setRecentFiles(const QStringList* list); 46 | const QString tabName() const; 47 | 48 | protected: 49 | void changeEvent(QEvent* e) Q_DECL_OVERRIDE; 50 | 51 | private: 52 | Ui::StartTab* ui; 53 | const QStringList* mRecentFilesList; 54 | 55 | signals: 56 | void openRecent(const QString& filename); 57 | void createNewImage(); 58 | void createNewFont(); 59 | }; 60 | 61 | } // namespace Start 62 | } // namespace AppUI 63 | 64 | #endif // STARTTAB_H 65 | -------------------------------------------------------------------------------- /controls/updates/dialogupdates.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Ui 26 | { 27 | class DialogUpdates; 28 | } 29 | 30 | #include 31 | 32 | namespace AppUI 33 | { 34 | namespace Updates 35 | { 36 | 37 | class DialogUpdates : public QDialog 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | explicit DialogUpdates(QWidget* parent = 0); 43 | virtual ~DialogUpdates(); 44 | 45 | private: 46 | Ui::DialogUpdates* ui; 47 | 48 | void showHistory(); 49 | void showUpdates(); 50 | void showUpdates(const QString& xml); 51 | void showError(const QString& message); 52 | bool transformHistory(const QString& xml, const QString& xsl, QString* html); 53 | bool isLocalVersionOutdated(const QString& xml); 54 | 55 | private slots: 56 | void networkReply(QNetworkReply* reply); 57 | }; 58 | 59 | } // namespace Updates 60 | } // namespace AppUI 61 | 62 | #endif // DIALOGUPDATES_H 63 | -------------------------------------------------------------------------------- /interfaces/ieditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2013 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | 25 | namespace Data 26 | { 27 | namespace Containers 28 | { 29 | class DataContainer; 30 | class IDocument; 31 | } // namespace Containers 32 | } // namespace Data 33 | 34 | namespace AppUI 35 | { 36 | namespace Status 37 | { 38 | class StatusData; 39 | } 40 | 41 | class IEditor 42 | { 43 | public: 44 | enum EditorType { EditorImage, EditorFont }; 45 | 46 | virtual Data::Containers::IDocument* document() const = 0; 47 | virtual QStringList selectedKeys() const = 0; 48 | virtual AppUI::Status::StatusData* statusData() const = 0; 49 | virtual EditorType type() const = 0; 50 | }; 51 | } // namespace AppUI 52 | 53 | Q_DECLARE_INTERFACE(AppUI::IEditor, "riuson.lcd-image-converter/1.0") 54 | 55 | #endif // IEDITOR_H 56 | -------------------------------------------------------------------------------- /interfaces/imainwindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2010 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 24 | #include 25 | #include 26 | 27 | template class QList; 28 | 29 | namespace AppUI 30 | { 31 | class IEditor; 32 | 33 | class IMainWindow 34 | { 35 | public: 36 | virtual IEditor* currentEditor() = 0; 37 | virtual QWidget* currentTab() = 0; 38 | virtual void tabsList(QList* list) = 0; 39 | virtual QWidget* parentWidget() = 0; 40 | virtual QString findAvailableName(const QString& prefix) = 0; 41 | }; 42 | } // namespace AppUI 43 | 44 | Q_DECLARE_INTERFACE(AppUI::IMainWindow, "riuson.lcd-image-converter/1.0") 45 | 46 | #endif // IDOCUMENT_H 47 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2010 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 21 | 22 | #include "cmdline.h" 23 | #include "mainwindow.h" 24 | #include "revisioninfo.h" 25 | 26 | void setupApplication(QApplication* app) 27 | { 28 | QString version = 29 | QString("rev.%1 from %2").arg(VersionControl::RevisionInfo::hash(), VersionControl::RevisionInfo::date()); 30 | QCoreApplication::setApplicationVersion(version); 31 | 32 | app->addLibraryPath(QApplication::applicationDirPath()); 33 | app->addLibraryPath(QApplication::applicationDirPath() + "/plugins"); 34 | } 35 | 36 | int main(int argc, char* argv[]) 37 | { 38 | QApplication a(argc, argv); 39 | setupApplication(&a); 40 | 41 | QStringList arguments = a.arguments(); 42 | CommandLine::CmdLine cmd(arguments); 43 | 44 | if (cmd.needProcess()) { // if console mode 45 | switch (cmd.process()) { 46 | case CommandLine::CmdLine::ProcessResult::Failed: { 47 | return 1; 48 | } 49 | 50 | case CommandLine::CmdLine::ProcessResult::Success: { 51 | return 0; 52 | } 53 | 54 | case CommandLine::CmdLine::ProcessResult::None: 55 | default: { 56 | break; 57 | } 58 | } 59 | } 60 | 61 | // gui mode 62 | AppUI::MainWindow w; 63 | w.show(); 64 | return a.exec(); 65 | } 66 | -------------------------------------------------------------------------------- /qt-version-check.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCD Image Converter. Converts images and fonts for embedded applications. 3 | * Copyright (C) 2014 riuson 4 | * mailto: riuson@gmail.com 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see 2 | 3 | 4 | 18 | 20 | 42 | 44 | 45 | 47 | image/svg+xml 48 | 50 | 51 | 52 | 53 | 54 | 59 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /resources/image.tmpl: -------------------------------------------------------------------------------- 1 | $(start_block_header) 2 | /******************************************************************************* 3 | * generated by lcd-image-converter rev.$(app_rev) from $(app_date) 4 | * $(doc_data_type) 5 | * filename: $(doc_filename) 6 | * name: $(doc_name) 7 | * 8 | * preset name: $(out_preset_name) 9 | * data block size: $(img_data_block_size) bit(s), uint$(img_data_block_size)_t 10 | * RLE compression enabled: $(img_rle) 11 | * conversion type: $(pre_conv_type), $(pre_mono_type) $(pre_mono_edge) 12 | * split to rows: $(img_split_to_rows) 13 | * bits per pixel: $(out_bpp) 14 | * 15 | * preprocess: 16 | * main scan direction: $(pre_scan_main) 17 | * line scan direction: $(pre_scan_sub) 18 | * inverse: $(pre_inverse) 19 | *******************************************************************************/ 20 | 21 | /* 22 | typedef struct { 23 | const uint$(img_data_block_size)_t *data; 24 | uint16_t width; 25 | uint16_t height; 26 | uint8_t dataSize; 27 | } tImage; 28 | */ 29 | #include 30 | $(end_block_header) 31 | 32 | $(start_block_images_table) 33 | static const uint$(img_data_block_size)_t image_data_$(doc_name_ws)[$(out_blocks_count)] = { 34 | $(out_image_preview) 35 | $(out_image_data) 36 | }; 37 | const tImage $(doc_name_ws) = { image_data_$(doc_name_ws), $(out_image_width), $(out_image_height), 38 | $(img_data_block_size) }; 39 | $(end_block_images_table) 40 | -------------------------------------------------------------------------------- /resources/scan_scripts/pixels_example.js: -------------------------------------------------------------------------------- 1 | // 'argb' - pixel's data of type uint32 2 | 3 | var a = (argb >> 24) & 0xff; 4 | var r = (argb >> 16) & 0xff; 5 | var g = (argb >> 8) & 0xff; 6 | var b = (argb >> 0) & 0xff; 7 | 8 | // place modified value back to variable 'argb' 9 | argb = (a << 24) | (r << 16) | (g << 8) | b; 10 | -------------------------------------------------------------------------------- /resources/scan_scripts/pixels_template.js: -------------------------------------------------------------------------------- 1 | var __internal_points_count = data.count; 2 | 3 | for (var __internal_point_index = 0; __internal_point_index < __internal_points_count; __internal_point_index++) { 4 | var argb = data.pixel(__internal_point_index); 5 | { 6 | %1 7 | } 8 | data.setPixel(__internal_point_index, argb); 9 | } 10 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_bottom2top_backward.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bottom to top 3 | * backward 4 | */ 5 | 6 | for (var y = image.height - 1; y >= 0; y--) { 7 | for (var x = image.width - 1; x >= 0; x--) { 8 | image.addPoint(x, y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_bottom2top_backward_band.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bottom to top 3 | * backward 4 | * bands 5 | */ 6 | 7 | var bandX = image.width - 1; 8 | 9 | do { 10 | for (var y = image.height - 1; y >= 0; y--) { 11 | for (var x = 0; x < image.bandSize; x++) { 12 | image.addPoint(bandX - x, y); 13 | } 14 | } 15 | bandX -= image.bandSize; 16 | } while (bandX >= 0); 17 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_bottom2top_forward.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bottom to top 3 | * forward 4 | */ 5 | 6 | for (var y = image.height - 1; y >= 0; y--) { 7 | for (var x = 0; x < image.width; x++) { 8 | image.addPoint(x, y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_bottom2top_forward_band.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bottom to top 3 | * forward 4 | * bands 5 | */ 6 | 7 | var bandX = 0; 8 | 9 | do { 10 | for (var y = image.height - 1; y >= 0; y--) { 11 | for (var x = 0; x < image.bandSize; x++) { 12 | image.addPoint(bandX + x, y); 13 | } 14 | } 15 | bandX += image.bandSize; 16 | } while (bandX < image.width); 17 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_left2right_backward.js: -------------------------------------------------------------------------------- 1 | /* 2 | * left to right 3 | * backward 4 | */ 5 | 6 | for (var x = 0; x < image.width; x++) { 7 | for (var y = image.height - 1; y >= 0; y--) { 8 | image.addPoint(x, y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_left2right_backward_band.js: -------------------------------------------------------------------------------- 1 | /* 2 | * left to right 3 | * backward 4 | * bands 5 | */ 6 | 7 | var bandY = image.height - 1; 8 | 9 | do { 10 | for (var x = 0; x < image.width; x++) { 11 | for (var y = 0; y < image.bandSize; y++) { 12 | image.addPoint(x, bandY - y); 13 | } 14 | } 15 | bandY -= image.bandSize; 16 | } while (bandY >= 0); 17 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_left2right_forward.js: -------------------------------------------------------------------------------- 1 | /* 2 | * left to right 3 | * forward 4 | */ 5 | 6 | for (var x = 0; x < image.width; x++) { 7 | for (var y = 0; y < image.height; y++) { 8 | image.addPoint(x, y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_left2right_forward_band.js: -------------------------------------------------------------------------------- 1 | /* 2 | * left to right 3 | * forward 4 | * bands 5 | */ 6 | 7 | var bandY = 0; 8 | 9 | do { 10 | for (var x = 0; x < image.width; x++) { 11 | for (var y = 0; y < image.bandSize; y++) { 12 | image.addPoint(x, bandY + y); 13 | } 14 | } 15 | bandY += image.bandSize; 16 | } while (bandY < image.height); 17 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_right2left_backward.js: -------------------------------------------------------------------------------- 1 | /* 2 | * right to left 3 | * backward 4 | */ 5 | 6 | for (var x = image.width - 1; x >= 0; x--) { 7 | for (var y = image.height - 1; y >= 0; y--) { 8 | image.addPoint(x, y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_right2left_backward_band.js: -------------------------------------------------------------------------------- 1 | /* 2 | * right to left 3 | * backward 4 | * bands 5 | */ 6 | 7 | var bandY = image.height - 1; 8 | 9 | do { 10 | for (var x = image.width - 1; x >= 0; x--) { 11 | for (var y = 0; y < image.bandSize; y++) { 12 | image.addPoint(x, bandY - y); 13 | } 14 | } 15 | bandY -= image.bandSize; 16 | } while (bandY >= 0); 17 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_right2left_forward.js: -------------------------------------------------------------------------------- 1 | /* 2 | * right to left 3 | * forward 4 | */ 5 | 6 | for (var x = image.width - 1; x >= 0; x--) { 7 | for (var y = 0; y < image.height; y++) { 8 | image.addPoint(x, y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_right2left_forward_band.js: -------------------------------------------------------------------------------- 1 | /* 2 | * right to left 3 | * forward 4 | * bands 5 | */ 6 | 7 | var bandY = 0; 8 | 9 | do { 10 | for (var x = image.width - 1; x >= 0; x--) { 11 | for (var y = 0; y < image.bandSize; y++) { 12 | image.addPoint(x, bandY + y); 13 | } 14 | } 15 | bandY += image.bandSize; 16 | } while (bandY < image.height); 17 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_template.js: -------------------------------------------------------------------------------- 1 | var __internal_points_counter = 0; 2 | var __internal_image_width = image.width; 3 | var __internal_image_height = image.height; 4 | var __internal_points_max_count = (__internal_image_width * __internal_image_height * 120) / 100; 5 | 6 | if (__internal_points_max_count < 100000) { 7 | __internal_points_max_count = 100000; 8 | } 9 | 10 | %1 11 | 12 | function checkProcessState() 13 | { 14 | if (__internal_points_counter > __internal_points_max_count) 15 | { 16 | image.scanTerminated = true; 17 | throw "scan break requested"; 18 | } 19 | } 20 | 21 | function addImagePoint(pointX, pointY) 22 | { 23 | __internal_points_counter++; 24 | checkProcessState(); 25 | return image.addPoint(pointX, pointY); 26 | } 27 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_top2bottom_backward.js: -------------------------------------------------------------------------------- 1 | /* 2 | * top to bottom 3 | * backward 4 | */ 5 | 6 | for (var y = 0; y < image.height; y++) { 7 | for (var x = image.width - 1; x >= 0; x--) { 8 | image.addPoint(x, y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_top2bottom_backward_band.js: -------------------------------------------------------------------------------- 1 | /* 2 | * top to bottom 3 | * backward 4 | * bands 5 | */ 6 | 7 | var bandX = image.width - 1; 8 | 9 | do { 10 | for (var y = 0; y < image.height; y++) { 11 | for (var x = 0; x < image.bandSize; x++) { 12 | image.addPoint(bandX - x, y); 13 | } 14 | } 15 | bandX -= image.bandSize; 16 | } while (bandX >= 0); 17 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_top2bottom_forward.js: -------------------------------------------------------------------------------- 1 | /* 2 | * top to bottom 3 | * forward 4 | */ 5 | 6 | for (var y = 0; y < image.height; y++) { 7 | for (var x = 0; x < image.width; x++) { 8 | image.addPoint(x, y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/scan_scripts/scan_top2bottom_forward_band.js: -------------------------------------------------------------------------------- 1 | /* 2 | * top to bottom 3 | * forward 4 | * bands 5 | */ 6 | 7 | var bandX = 0; 8 | 9 | do { 10 | for (var y = 0; y < image.height; y++) { 11 | for (var x = 0; x < image.bandSize; x++) { 12 | image.addPoint(bandX + x, y); 13 | } 14 | } 15 | bandX += image.bandSize; 16 | } while (bandX < image.width); 17 | -------------------------------------------------------------------------------- /resources/template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/resources/template.png -------------------------------------------------------------------------------- /tests/maintest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "testbitmaphelper.h" 4 | #include "testbitstream.h" 5 | #include "testconverterhelper.h" 6 | #include "testfontoptions.h" 7 | #include "testimageoptions.h" 8 | #include "testmatrixoptions.h" 9 | #include "testprepareoptions.h" 10 | #include "testpresets.h" 11 | #include "testreorderingoptions.h" 12 | #include "testrle.h" 13 | #include "testsettings.h" 14 | #include "testtemplateoptions.h" 15 | 16 | int main(void) 17 | { 18 | TestBitmapHelper tbh; 19 | QTest::qExec(&tbh); 20 | 21 | TestConverterHelper tch; 22 | QTest::qExec(&tch); 23 | 24 | TestBitStream tbs; 25 | QTest::qExec(&tbs); 26 | 27 | TestPrepareOptions tpo; 28 | QTest::qExec(&tpo); 29 | 30 | TestMatrixOptions tmo; 31 | QTest::qExec(&tmo); 32 | 33 | TestReorderingOptions tro; 34 | QTest::qExec(&tro); 35 | 36 | TestImageOptions tio; 37 | QTest::qExec(&tio); 38 | 39 | TestFontOptions tfo; 40 | QTest::qExec(&tfo); 41 | 42 | TestTemplateOptions tto; 43 | QTest::qExec(&tto); 44 | 45 | TestPresets tp; 46 | QTest::qExec(&tp); 47 | 48 | TestRle tr; 49 | QTest::qExec(&tr); 50 | 51 | TestSettings ts; 52 | QTest::qExec(&ts); 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /tests/parts/testbitmaphelper.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTBITMAPHELPER_H 2 | #define TESTBITMAPHELPER_H 3 | 4 | #include 5 | #include 6 | 7 | #include "bitmaphelper.h" 8 | 9 | class TestBitmapHelper : public QObject 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit TestBitmapHelper(QObject* parent = 0); 14 | virtual ~TestBitmapHelper() {} 15 | 16 | private: 17 | void compareSizeAndPixels(const QImage* actual, const QImage* expected) const; 18 | 19 | private slots: 20 | void initTestCase(); 21 | void rotate90(); 22 | void rotate180(); 23 | void rotate270(); 24 | void shiftUp(); 25 | void shiftRight(); 26 | void shiftDown(); 27 | void shiftLeft(); 28 | void shiftLeftDown(); 29 | void shiftLeftUp(); 30 | void shiftRightDown(); 31 | void shiftRightUp(); 32 | void shiftMore(); 33 | void flipHorizontal(); 34 | void flipVertical(); 35 | void cleanupTestCase(); 36 | }; 37 | 38 | #endif // TESTBITMAPHELPER_H 39 | -------------------------------------------------------------------------------- /tests/parts/testbitstream.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTBITSTREAM_H 2 | #define TESTBITSTREAM_H 3 | 4 | #include 5 | #include 6 | 7 | #include "bitstream.h" 8 | 9 | class TestBitStream : public QObject 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit TestBitStream(QObject* parent = 0); 14 | virtual ~TestBitStream() {} 15 | 16 | private: 17 | Settings::Presets::Preset* mPreset; 18 | void preparePackData(quint32 maskUsed, quint32 maskFill, QVector* source, QVector* packed); 19 | 20 | private slots: 21 | void initTestCase(); 22 | void streaming(); 23 | void cleanupTestCase(); 24 | }; 25 | 26 | #endif // TESTBITSTREAM_H 27 | -------------------------------------------------------------------------------- /tests/parts/testconverterhelper.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTCONVERTERHELPER_H 2 | #define TESTCONVERTERHELPER_H 3 | 4 | #include "conversion_options.h" 5 | 6 | #include 7 | #include 8 | 9 | #include "convimagescan.h" 10 | 11 | namespace Settings 12 | { 13 | namespace Presets 14 | { 15 | class Preset; 16 | } 17 | } // namespace Settings 18 | 19 | class TestConverterHelper : public QObject 20 | { 21 | Q_OBJECT 22 | public: 23 | explicit TestConverterHelper(QObject* parent = 0); 24 | virtual ~TestConverterHelper() {} 25 | 26 | private: 27 | Settings::Presets::Preset* mPreset; 28 | void preparePackData(quint32 maskUsed, quint32 maskFill, QVector* source, int width, int height, 29 | bool splitToRows, QVector* packed); 30 | void prepareStringData(QVector* source, int width, int height, int blockPerLine, 31 | Parsing::Conversion::Options::DataBlockSize size, QString* string); 32 | void compareStrings(const QString& actual, const QString& expected); 33 | 34 | private slots: 35 | void initTestCase(); 36 | void processPixels(); 37 | void packData(); 38 | void dataToString(); 39 | void uint2hex(); 40 | void uint2octal(); 41 | void uint2binary(); 42 | void uint2string(); 43 | void jsengineSetProperty(); 44 | void breakInfiniteScript(); 45 | void cleanupTestCase(); 46 | }; 47 | 48 | class TestConvImage : public Parsing::Conversion::ConvImageScan 49 | { 50 | Q_OBJECT 51 | public: 52 | enum Condition { CanBeDeleted, CannotBeDeleted }; 53 | 54 | explicit TestConvImage(const QImage* image, QObject* parent = 0); 55 | virtual ~TestConvImage(); 56 | 57 | void setCondition(Condition value); 58 | 59 | private: 60 | Condition mCondition; 61 | }; 62 | 63 | #endif // TESTCONVERTERHELPER_H 64 | -------------------------------------------------------------------------------- /tests/parts/testfontoptions.cpp: -------------------------------------------------------------------------------- 1 | #include "testfontoptions.h" 2 | 3 | #include 4 | 5 | #include "fontoptions.h" 6 | 7 | TestFontOptions::TestFontOptions(QObject* parent) : QObject(parent) {} 8 | 9 | void TestFontOptions::initTestCase() { this->mOptions = new Settings::Presets::FontOptions(this); } 10 | 11 | void TestFontOptions::bom() 12 | { 13 | // 1 14 | this->mOptions->setBom(false); 15 | QCOMPARE(this->mOptions->bom(), false); 16 | 17 | // 2 18 | this->mOptions->setBom(true); 19 | QCOMPARE(this->mOptions->bom(), true); 20 | } 21 | 22 | void TestFontOptions::encoding() 23 | { 24 | QStringList list = Settings::Presets::FontOptions::encodings(); 25 | 26 | for (int i = 0; i < list.length(); i++) { 27 | this->mOptions->setEncoding(list.at(i)); 28 | QCOMPARE(this->mOptions->encoding(), list.at(i)); 29 | } 30 | 31 | this->mOptions->setEncoding("other"); 32 | QVERIFY(this->mOptions->encoding() != "other"); 33 | } 34 | 35 | void TestFontOptions::cleanupTestCase() { delete this->mOptions; } 36 | -------------------------------------------------------------------------------- /tests/parts/testfontoptions.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTFONTOPTIONS_H 2 | #define TESTFONTOPTIONS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Settings 8 | { 9 | namespace Presets 10 | { 11 | class FontOptions; 12 | } 13 | } // namespace Settings 14 | 15 | class TestFontOptions : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit TestFontOptions(QObject* parent = 0); 20 | virtual ~TestFontOptions() {} 21 | 22 | private: 23 | Settings::Presets::FontOptions* mOptions; 24 | 25 | private slots: 26 | void initTestCase(); 27 | 28 | void bom(); 29 | void encoding(); 30 | 31 | void cleanupTestCase(); 32 | }; 33 | 34 | #endif // TESTFONTOPTIONS_H 35 | -------------------------------------------------------------------------------- /tests/parts/testimageoptions.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTIMAGEOPTIONS_H 2 | #define TESTIMAGEOPTIONS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Settings 8 | { 9 | namespace Presets 10 | { 11 | class ImageOptions; 12 | } 13 | } // namespace Settings 14 | 15 | class TestImageOptions : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit TestImageOptions(QObject* parent = 0); 20 | virtual ~TestImageOptions() {} 21 | 22 | private: 23 | Settings::Presets::ImageOptions* mOptions; 24 | 25 | private slots: 26 | void initTestCase(); 27 | 28 | void bytesOrder(); 29 | void blockSize(); 30 | void blockDefaultOnes(); 31 | void splitToRows(); 32 | void compressionRle(); 33 | void blockPrefix(); 34 | void blockSuffix(); 35 | void blockDelimiter(); 36 | 37 | void cleanupTestCase(); 38 | }; 39 | 40 | #endif // TESTIMAGEOPTIONS_H 41 | -------------------------------------------------------------------------------- /tests/parts/testmatrixoptions.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTMATRIXOPTIONS_H 2 | #define TESTMATRIXOPTIONS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Settings 8 | { 9 | namespace Presets 10 | { 11 | class MatrixOptions; 12 | } 13 | } // namespace Settings 14 | 15 | class TestMatrixOptions : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit TestMatrixOptions(QObject* parent = 0); 20 | virtual ~TestMatrixOptions() {} 21 | 22 | private: 23 | Settings::Presets::MatrixOptions* mOptions; 24 | 25 | private slots: 26 | void initTestCase(); 27 | 28 | void mask(); 29 | void operationsCount(); 30 | void operation(); 31 | void operationAdd(); 32 | void operationRemove(); 33 | void operationRemoveAll(); 34 | void operationReplace(); 35 | 36 | void cleanupTestCase(); 37 | }; 38 | 39 | #endif // TESTMATRIXOPTIONS_H 40 | -------------------------------------------------------------------------------- /tests/parts/testprepareoptions.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTPREPAREOPTIONS_H 2 | #define TESTPREPAREOPTIONS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Settings 8 | { 9 | namespace Presets 10 | { 11 | class PrepareOptions; 12 | } 13 | } // namespace Settings 14 | 15 | class TestPrepareOptions : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit TestPrepareOptions(QObject* parent = 0); 20 | virtual ~TestPrepareOptions() {} 21 | 22 | private: 23 | Settings::Presets::PrepareOptions* mOptions; 24 | 25 | private slots: 26 | void initTestCase(); 27 | 28 | void convType(); 29 | void monoType(); 30 | void edge(); 31 | void scanMain(); 32 | void scanSub(); 33 | void inverse(); 34 | void bandScanning(); 35 | void bandWidth(); 36 | 37 | void cleanupTestCase(); 38 | }; 39 | 40 | #endif // TESTPREPAREOPTIONS_H 41 | -------------------------------------------------------------------------------- /tests/parts/testpresets.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTPRESETS_H 2 | #define TESTPRESETS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Settings 8 | { 9 | namespace Presets 10 | { 11 | class Preset; 12 | } 13 | } // namespace Settings 14 | 15 | class TestPresets : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit TestPresets(QObject* parent = 0); 20 | virtual ~TestPresets() {} 21 | 22 | private: 23 | Settings::Presets::Preset* mOptions; 24 | 25 | private slots: 26 | void initTestCase(); 27 | 28 | void loadSave(); 29 | 30 | void cleanupTestCase(); 31 | }; 32 | 33 | #endif // TESTPRESETS_H 34 | -------------------------------------------------------------------------------- /tests/parts/testreorderingoptions.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTREORDERINGOPTIONS_H 2 | #define TESTREORDERINGOPTIONS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Settings 8 | { 9 | namespace Presets 10 | { 11 | class ReorderingOptions; 12 | } 13 | } // namespace Settings 14 | 15 | class TestReorderingOptions : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit TestReorderingOptions(QObject* parent = 0); 20 | virtual ~TestReorderingOptions() {} 21 | 22 | private: 23 | Settings::Presets::ReorderingOptions* mOptions; 24 | 25 | private slots: 26 | void initTestCase(); 27 | 28 | void operationsCount(); 29 | void operation(); 30 | void operationAdd(); 31 | void operationRemove(); 32 | void operationRemoveAll(); 33 | void operationReplace(); 34 | 35 | void cleanupTestCase(); 36 | }; 37 | 38 | #endif // TESTREORDERINGOPTIONS_H 39 | -------------------------------------------------------------------------------- /tests/parts/testrle.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTRLE_H 2 | #define TESTRLE_H 3 | 4 | #include 5 | #include 6 | 7 | template class QVector; 8 | 9 | class TestRle : public QObject 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit TestRle(QObject* parent = 0); 14 | virtual ~TestRle() {} 15 | 16 | private: 17 | private slots: 18 | void initTestCase(); 19 | 20 | void compress1(); 21 | void compress2(); 22 | void compress5(); 23 | 24 | void cleanupTestCase(); 25 | }; 26 | 27 | #endif // TESTRLE_H 28 | -------------------------------------------------------------------------------- /tests/parts/testsettings.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTSETTINGS_H 2 | #define TESTSETTINGS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "appsettings.h" 9 | template class QVector; 10 | 11 | class AppSettingsExt : public Settings::AppSettings 12 | { 13 | public: 14 | using AppSettings::escape; 15 | using AppSettings::isNameCharValid; 16 | using AppSettings::isNameStartCharValid; 17 | using AppSettings::unescape; 18 | }; 19 | 20 | class TestSettings : public QObject 21 | { 22 | Q_OBJECT 23 | public: 24 | explicit TestSettings(QObject* parent = 0); 25 | virtual ~TestSettings() {} 26 | 27 | private: 28 | const QString getFilename(const QTemporaryDir& dir) const; 29 | private slots: 30 | void initTestCase(); 31 | 32 | void save(); 33 | void load(); 34 | void save_load(); 35 | void isNameStartCharValid(); 36 | void escape(); 37 | 38 | void cleanupTestCase(); 39 | }; 40 | 41 | #endif // TESTSETTINGS_H 42 | -------------------------------------------------------------------------------- /tests/parts/testtemplateoptions.cpp: -------------------------------------------------------------------------------- 1 | #include "testtemplateoptions.h" 2 | 3 | #include "templateoptions.h" 4 | 5 | TestTemplateOptions::TestTemplateOptions(QObject* parent) : QObject(parent) {} 6 | 7 | void TestTemplateOptions::initTestCase() { this->mOptions = new Settings::Presets::TemplateOptions(this); } 8 | 9 | void TestTemplateOptions::image() 10 | { 11 | // 1 12 | this->mOptions->setImage("test1"); 13 | QCOMPARE(this->mOptions->image(), QString("test1")); 14 | 15 | // 2 16 | this->mOptions->setImage("test2"); 17 | QCOMPARE(this->mOptions->image(), QString("test2")); 18 | } 19 | 20 | void TestTemplateOptions::font() 21 | { 22 | // 1 23 | this->mOptions->setFont("test3"); 24 | QCOMPARE(this->mOptions->font(), QString("test3")); 25 | 26 | // 2 27 | this->mOptions->setFont("test4"); 28 | QCOMPARE(this->mOptions->font(), QString("test4")); 29 | } 30 | 31 | void TestTemplateOptions::cleanupTestCase() { delete this->mOptions; } 32 | -------------------------------------------------------------------------------- /tests/parts/testtemplateoptions.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTTEMPLATEOPTIONS_H 2 | #define TESTTEMPLATEOPTIONS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Settings 8 | { 9 | namespace Presets 10 | { 11 | class TemplateOptions; 12 | } 13 | } // namespace Settings 14 | 15 | class TestTemplateOptions : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit TestTemplateOptions(QObject* parent = 0); 20 | virtual ~TestTemplateOptions() {} 21 | 22 | private: 23 | Settings::Presets::TemplateOptions* mOptions; 24 | 25 | private slots: 26 | void initTestCase(); 27 | 28 | void image(); 29 | void font(); 30 | 31 | void cleanupTestCase(); 32 | }; 33 | 34 | #endif // TESTTEMPLATEOPTIONS_H 35 | -------------------------------------------------------------------------------- /tests/resources/samples/flip/flip-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/flip/flip-horizontal.png -------------------------------------------------------------------------------- /tests/resources/samples/flip/flip-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/flip/flip-vertical.png -------------------------------------------------------------------------------- /tests/resources/samples/flip/flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/flip/flip.png -------------------------------------------------------------------------------- /tests/resources/samples/rotate/rotate0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/rotate/rotate0.png -------------------------------------------------------------------------------- /tests/resources/samples/rotate/rotate180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/rotate/rotate180.png -------------------------------------------------------------------------------- /tests/resources/samples/rotate/rotate270.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/rotate/rotate270.png -------------------------------------------------------------------------------- /tests/resources/samples/rotate/rotate90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/rotate/rotate90.png -------------------------------------------------------------------------------- /tests/resources/samples/settings/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | value1 6 | value2 7 | value2 8 | value1 9 | 10 | 11 | 12 | 13 | value21 14 | value10 15 | value21 16 | value10 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/resources/samples/shift/-1_-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/-1_-1.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/-1_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/-1_0.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/-1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/-1_1.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/0_-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/0_-1.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/0_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/0_1.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/1_-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/1_-1.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/1_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/1_0.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/1_1.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/2_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/2_4.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/original.png -------------------------------------------------------------------------------- /tests/resources/samples/shift/sample.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/tests/resources/samples/shift/sample.xcf -------------------------------------------------------------------------------- /tests/samples.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/samples/rotate/rotate0.png 4 | resources/samples/rotate/rotate90.png 5 | resources/samples/rotate/rotate180.png 6 | resources/samples/rotate/rotate270.png 7 | 8 | 9 | resources/samples/flip/flip.png 10 | resources/samples/flip/flip-horizontal.png 11 | resources/samples/flip/flip-vertical.png 12 | 13 | 14 | resources/samples/shift/original.png 15 | resources/samples/shift/0_1.png 16 | resources/samples/shift/0_-1.png 17 | resources/samples/shift/1_0.png 18 | resources/samples/shift/-1_0.png 19 | resources/samples/shift/1_1.png 20 | resources/samples/shift/1_-1.png 21 | resources/samples/shift/-1_1.png 22 | resources/samples/shift/-1_-1.png 23 | resources/samples/shift/2_4.png 24 | 25 | 26 | ../resources/scan_scripts/scan_template.js 27 | ../resources/scan_scripts/pixels_template.js 28 | ../resources/scan_scripts/pixels_example.js 29 | 30 | 31 | resources/samples/settings/settings.xml 32 | 33 | 34 | -------------------------------------------------------------------------------- /update-revision-info.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | git --git-dir %1/.git log --pretty=format:"#define GIT_REVISION \"%%H\" %%n#define GIT_REVISION_ABBR \"%%h\" %%n#define GIT_COMMIT_ADATE \"%%ai\" %%n#define GIT_COMMIT_AT %%at" -1 > %1/resources/revision.h 3 | -------------------------------------------------------------------------------- /update-revision-info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | git --git-dir $1/.git log --pretty=format:"#define GIT_REVISION \"%H\\0\" %n#define GIT_REVISION_ABBR \"%h\\0\" %n#define GIT_COMMIT_ADATE \"%ai\\0\" %n#define GIT_COMMIT_AT %at" -1 > $1/resources/revision.h 3 | -------------------------------------------------------------------------------- /win-res.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riuson/lcd-image-converter/e3ba1ed9e922bc37f78ff7615c6f7b203755740a/win-res.rc --------------------------------------------------------------------------------