termgl


Nametermgl JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/wojciech-graj/pyTermGL
SummaryTermGL wrapper in Cython
upload_time2024-04-26 17:09:08
maintainerNone
docs_urlNone
authorWojciech Graj
requires_pythonNone
licenseMIT
keywords graphics terminal render rendering text ascii
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TermGL

Cython binding for a terminal-based graphics library for both 2D and 3D graphics.\
Works in all terminals supporting ANSI escape codes.\
Support for Windows and UNIX.\
Realtime input reading from terminal for user-interaction.\
16 Background colors, 16 foreground colors, bold and underline.

## Table of Contents

[Install](https://github.com/wojciech-graj/pyTermGL/blob/master/README.md#Install)\
[Documentation](https://github.com/wojciech-graj/pyTermGL/blob/master/README.md#Documentation)\
[Gallery](https://github.com/wojciech-graj/pyTermGL/blob/master/README.md#Gallery)

## Install

Package can be found on [PyPI](https://pypi.org/project/termgl/) and can be installed using pip:
```
pip install termgl
```

## Documentation

Documentation can be found [here](https://wojciech-graj.github.io/pyTermGL/)

### Basic Example

```
import termgl as tgl

# Create context and enable settings
ctx = tgl.TGL(10, 10, tgl.gradient_min)
ctx.enable(tgl.Setting.OUTPUT_BUFFER)

# Write to the framebuffer
ctx.puts(1, 0, b"Hello,\nWorld!", tgl.Color.WHITE | tgl.Color.BLUE_BKG)
ctx.line(1, 2, 0, 255, 5, 10, 0, 0, tgl.Color.RED)
ctx.triangle(3, 2, 0, 255, 6, 8, 0, 0, 10, 5, 0, 127, tgl.Color.CYAN, fill=True)

# Print
ctx.flush()
```

### Demo

A variety of demos can be found in the ```demo``` directory
To run the demo utility, simply ```python demo```
Available demos and TermGL features used:
1. Utah Teapot\
Renders a rotating 3D Utah Teapot.
	- Backface culling
	- Z buffering
	- Double-width characters
	- 3D camera
	- 3D transformations
	- 3D rendering
	- 3D Shaders
2. Star Polygon\
Renders a star polygon in steps using random colors.
	- Colors
	- Line rendering
3. Color Palette\
Renders a palette of various text colors and styles.
	- Colors & Modifiers
4. Mandelbrot\
Renders an infinitely zooming-in Mandelbrot set.
	- Point rendering
5. Realtime Keyboard\
Displays keyboard input in realtime.
	- Text rendering
	- Realtime keyboard input


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wojciech-graj/pyTermGL",
    "name": "termgl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "graphics terminal render rendering text ascii",
    "author": "Wojciech Graj",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/2a/11/37cc8f6050e4bc06faab1af91273b88715f72cb2ddce9e97e36f9ea514db/termgl-0.1.2.tar.gz",
    "platform": null,
    "description": "# TermGL\n\nCython binding for a terminal-based graphics library for both 2D and 3D graphics.\\\nWorks in all terminals supporting ANSI escape codes.\\\nSupport for Windows and UNIX.\\\nRealtime input reading from terminal for user-interaction.\\\n16 Background colors, 16 foreground colors, bold and underline.\n\n## Table of Contents\n\n[Install](https://github.com/wojciech-graj/pyTermGL/blob/master/README.md#Install)\\\n[Documentation](https://github.com/wojciech-graj/pyTermGL/blob/master/README.md#Documentation)\\\n[Gallery](https://github.com/wojciech-graj/pyTermGL/blob/master/README.md#Gallery)\n\n## Install\n\nPackage can be found on [PyPI](https://pypi.org/project/termgl/) and can be installed using pip:\n```\npip install termgl\n```\n\n## Documentation\n\nDocumentation can be found [here](https://wojciech-graj.github.io/pyTermGL/)\n\n### Basic Example\n\n```\nimport termgl as tgl\n\n# Create context and enable settings\nctx = tgl.TGL(10, 10, tgl.gradient_min)\nctx.enable(tgl.Setting.OUTPUT_BUFFER)\n\n# Write to the framebuffer\nctx.puts(1, 0, b\"Hello,\\nWorld!\", tgl.Color.WHITE | tgl.Color.BLUE_BKG)\nctx.line(1, 2, 0, 255, 5, 10, 0, 0, tgl.Color.RED)\nctx.triangle(3, 2, 0, 255, 6, 8, 0, 0, 10, 5, 0, 127, tgl.Color.CYAN, fill=True)\n\n# Print\nctx.flush()\n```\n\n### Demo\n\nA variety of demos can be found in the ```demo``` directory\nTo run the demo utility, simply ```python demo```\nAvailable demos and TermGL features used:\n1. Utah Teapot\\\nRenders a rotating 3D Utah Teapot.\n\t- Backface culling\n\t- Z buffering\n\t- Double-width characters\n\t- 3D camera\n\t- 3D transformations\n\t- 3D rendering\n\t- 3D Shaders\n2. Star Polygon\\\nRenders a star polygon in steps using random colors.\n\t- Colors\n\t- Line rendering\n3. Color Palette\\\nRenders a palette of various text colors and styles.\n\t- Colors & Modifiers\n4. Mandelbrot\\\nRenders an infinitely zooming-in Mandelbrot set.\n\t- Point rendering\n5. Realtime Keyboard\\\nDisplays keyboard input in realtime.\n\t- Text rendering\n\t- Realtime keyboard input\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "TermGL wrapper in Cython",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/wojciech-graj/pyTermGL"
    },
    "split_keywords": [
        "graphics",
        "terminal",
        "render",
        "rendering",
        "text",
        "ascii"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2a1137cc8f6050e4bc06faab1af91273b88715f72cb2ddce9e97e36f9ea514db",
                "md5": "2cd77b89793c47bbff199543f2ee7640",
                "sha256": "7a6f5739c17bf96b170f453e24eaed51efd9bdb223af3ce6bbce2e62342b296e"
            },
            "downloads": -1,
            "filename": "termgl-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2cd77b89793c47bbff199543f2ee7640",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20153,
            "upload_time": "2024-04-26T17:09:08",
            "upload_time_iso_8601": "2024-04-26T17:09:08.171909Z",
            "url": "https://files.pythonhosted.org/packages/2a/11/37cc8f6050e4bc06faab1af91273b88715f72cb2ddce9e97e36f9ea514db/termgl-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 17:09:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wojciech-graj",
    "github_project": "pyTermGL",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "termgl"
}
        
Elapsed time: 0.25761s