Skip to main content

lpdraw

This is a simple drawing package that contains Line and Circle Drawing Algorithms. This package can display the output on terminal as well as visually appealing grayscale image.

Usage

Example:

from lpdraw import Line, Circle, Clear, DisplayTerminal
from lpython import i32, Const

from numpy import empty, int32

def main():
    Width: Const[i32] = 100 # x-axis limits [0, 99]
    Height: Const[i32] = 40 # y-axis limits [0, 39]
    Screen: i32[Height, Width] = empty((Height, Width), dtype=int32)

    Clear(Height, Width, Screen)
    Line(Height, Width, Screen, 2, 4, 99, 11)
    Line(Height, Width, Screen, 0, 39, 49, 0)
    Circle(Height, Width, Screen, 52, 20, 6.0)
    DisplayTerminal(Height, Width, Screen)

main()

Output:

$ python main.py
+----------------------------------------------------------------------------------------------------+
|.                                                                                                   |
| .                                                                                                  |
|  ..                                                                                                |
|    .                                                                                               |
|     .                                                                                              |
|      .                                                                                             |
|       ..                                                                                           |
|         .                                                                                          |
|          .                                                                                         |
|           .                                                                                        |
|            ..                                                                                      |
|              .                                                                                     |
|               .                                                                                    |
|                .                                   .                                               |
|                 ..                               .. ..                                             |
|                   .                             .     .                                            |
|                    .                           .       .                                           |
|                     .                         .         .                                          |
|                      ..                       .         .                                          |
|                        .                     .           .                                         |
|                         .                     .         .                                          |
|                          ..                   .         .                                          |
|                            .                   .       .                                           |
|                             .                   .     .                                            |
|                              .                   .. ..                                             |
|                               ..                   .                                               |
|                                 .                                                                  |
|                                  .                                                                 |
|                                   .                                                         .......|
|                                    ..                                         ..............       |
|                                      .                          ..............                     |
|                                       .           ..............                                   |
|                                     ..............                                                 |
|                       ..............    ..                                                         |
|         ..............                    .                                                        |
|  .......                                   .                                                       |
|                                             .                                                      |
|                                              ..                                                    |
|                                                .                                                   |
|                                                 .                                                  |
+----------------------------------------------------------------------------------------------------+

You can also use the Display() provided in this package to generate a grascale .pgm image. You need to save the output produced on execution to a .pgm file. For example,

python main.py > img.pgm

Metadata

Release files for lpdraw 0.0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lpdraw 0.0.1.1
File Size Uploaded Provenance Actions
lpdraw-0.0.1.1.tar.gz 3.9 kB Without provenance Details for lpdraw-0.0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lpdraw 0.0.1.1
File Interpreter ABI Platform Actions
lpdraw-0.0.1.1-py3-none-any.whl Python 3 none any Details for lpdraw-0.0.1.1-py3-none-any.whl

Total release size: 7.7 kB

Release files / lpdraw-0.0.1.1.tar.gz

Download URL lpdraw-0.0.1.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
93db72706daf23f075e58e3db070ddf47633d46cc0a7dc8290549555821ccb36
BLAKE2b-256 checksum
How to use checksums
bfa80a217f0c81cf8c756f87d2e726fdb76fe2e52c7204044cd9ea1890ca1b5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / lpdraw-0.0.1.1-py3-none-any.whl

Download URL lpdraw-0.0.1.1-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98cd53abc77fae4cc06f92e906234095b0a600acb9a88af2d4645da98851c282
BLAKE2b-256 checksum
How to use checksums
4b7b8c6e41fa98ad7f6437f2db34b0d6409976d4cfe45a43746a4db3a82daa04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Security for lpdraw 0.0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page