{"id":16740485,"url":"https://github.com/flopp/qtasciimage","last_synced_at":"2025-07-04T06:39:13.469Z","repository":{"id":29949077,"uuid":"33495615","full_name":"flopp/QtAsciimage","owner":"flopp","description":"QtAsciimage - Asciimage for Qt Applications","archived":false,"fork":false,"pushed_at":"2015-04-07T17:15:39.000Z","size":164,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T13:44:37.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flopp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-06T17:40:10.000Z","updated_at":"2016-09-19T01:19:07.000Z","dependencies_parsed_at":"2022-09-07T08:40:50.755Z","dependency_job_id":null,"html_url":"https://github.com/flopp/QtAsciimage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flopp/QtAsciimage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2FQtAsciimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2FQtAsciimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2FQtAsciimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2FQtAsciimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flopp","download_url":"https://codeload.github.com/flopp/QtAsciimage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2FQtAsciimage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263463887,"owners_count":23470448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T00:58:49.172Z","updated_at":"2025-07-04T06:39:13.440Z","avatar_url":"https://github.com/flopp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QtAsciimage\nQtAsciimage - Asciimage for Qt Applications\n\nThis is a C++/Qt version of [Charles Parnot](https://twitter.com/cparnot)'s [ASCIImage](http://asciimage.org/) format. ASCIImage let's you specify simple images directly in your source code using 'ASCII art'.\n\n## Format Extension\nQtAsciimage uses an extended format allowing for a direct styling of the individual ASCIImage shapes. The styling rules are appended to the ASCIImage, separated by a line containing three dashes `---` only:\n\n    . . . . 5 . . . .\n    . . . . # . . . .\n    . . . . # . . . .\n    . . . . # . . . .\n    . . 1 . # . 3 . .\n    . . . # 5 # . . .\n    6 . . . 2 . . . 9\n    # . . . . . . . #\n    7 # # # # # # # 8\n    ---\n    1 open color=#FF0000\n    5 color=#FF0000\n    6 open \n\nA styling rule contains of a shape identifier (the character that is used in the ASCIImage to start the corresponding shape) and a set of styling options:\n    \n    ID [color=#RRGGBB] [open] [empty] [cutting]\n\n*   `ID`\nShape identifier. The character that is used to start the curresponding shape. E.g. in the above example the polyline made from the consecutive characters `6`, `7`, `8`, `9` is identified by the shaped first character `6`. \n\n*   `color=#RRGGBB`\nApplicable to all shape types.\nThe shape is drawn in the given hex-color instead of the default color (black).\n\n*   `open`\nApplicable to polygons.\nThe shape is not automatically closed, and thus drawn as a polyline instead of a polygon. \n\n*   `empty`\nApplicable to ellipses and polygons.\nThe shape is not filled; only the edge is drawn.\n\n*   `cutting`\nApplicable to all shape types.\nInstead of drawing the shape, it is cut out of the previsously drawn shapes, leaving a 'hole'.\n\nStyling rules and the styling rules section are completely optional; if there is no styling rule for a shape, it is drawn in the default style (black color, closed, and filled).\n\n## Usage \nTo include QtAsciimage into your QMake-based project, copy the QtAsciimage directory to your project tree and `include()` QtAsciimage's `pri`-file in you main QMake-file:\n\n    include(QtAsciimage/QtAsciimage.pri)\n\nOf course you need to `include()` QtAsciimage's header files (`QtAsciimage/image.h` should normally suffice; you also need `QtAsciimage/iconengine.h` if you want to use the QIconEngine) into your C++ sources. \n\n### Rendering to QImage\n\n```C++\n#include \u003cQtAsciimage/image.h\u003e\n// ...\n\nasciimage::Image asciiSun({\n  \". . . . 8 . . . .\",\n  \". 7 . . 8 . . 9 .\",\n  \". . 7 . . . 9 . .\",\n  \". . . . 1 . . . .\",\n  \"6 6 . 1 # 1 . 2 2\",\n  \". . . . 1 . . . .\",\n  \". . 5 . . . 3 . .\",\n  \". 5 . . 4 . . 3 .\",\n  \". . . . 4 . . . .\"\n});\n\nint scale = 4;\nQImage result = asciiSun.render(scale);\n```\n\n### Rendering via QIconEngine\n\n```C++\n#include \u003cQtAsciimage/image.h\u003e\n#include \u003cQtAsciimage/iconengine.h\u003e\n// ...\n\nasciimage::Image asciiSaveIcon({\n  \". . . . 5 . . . .\",\n  \". . . . # . . . .\",\n  \". . . . # . . . .\",\n  \". . . . # . . . .\",\n  \". . 1 . # . 3 . .\",\n  \". . . # 5 # . . .\",\n  \"6 . . . 2 . . . 9\",\n  \"# . . . . . . . #\",\n  \"7 # # # # # # # 8\",\n  \"---\",\n  \"1 open\",\n  \"6 open\"\n});\nQIconEngine* iconEngine = new asciimage::IconEngine(asciiSaveIcon);\nQAction* saveAction = new QAction(\"Save\", this);\nsaveAction-\u003esetIcon(QIcon(iconEngine));\n// add saveAction to a toolbar/menu to display the icon\n```\n\n## Demo Program / QtAsciimageEditor\n\nQtAsciimageEditor let's you edit Asciimages visually and, furthermore, demos how to use the QtAsciimage library.\n \n![Screenshot of QtAsciimageEditor](http://flopp.github.io/QtAsciimage/editor-screenshot.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflopp%2Fqtasciimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflopp%2Fqtasciimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflopp%2Fqtasciimage/lists"}