Skip to main content

Ballistics reticle generator

Project description

BCRG - Ballistic reticle generator

Simple tool to generate dynamic ballistics reticles by .lua templates

Installation

pip install bcrg

Usage

As CLI tool

python -m bcrg 
usage: bcr [-h] [-o OUTPUT] [-W <int>] [-H <int>] [-cx <float>] [-cy <float>] [-z [<int> ...]] [-Z] file

positional arguments:
  file                  Reticle template file in .lua format

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output directory path, defaults to ./
  -W <int>, --width <int>
                        Canvas width (px)
  -H <int>, --height <int>
                        Canvas height (px)
  -cx <float>, --click-x <float>
                        Horizontal click size (cm/100m)
  -cy <float>, --click-y <float>
                        Vertical click size (cm/100m)
  -z [<int> ...], --zoom [<int> ...]
                        Zoom value (int)
  -Z, --zip             Store as .zip

As Imported module

from bcrg import LuaReticleLoader
loader = LuaReticleLoader('my_reticle_template.lua')

# Create 1bit-depth .bmp bytearray
byte_stream = loader.make_bmp(640, 480, 2.27, 2.27, 4, None)
with open("myreticle.bmp", 'b') as f:
    f.write(byte_stream)

References

  • A reticle template have to implement make_reticle function, that gets required arguments and have to return self:to_bmp or self:to_bmp_1bit
  • Examples in ./templates dir

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bcrg-1.0.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

bcrg-1.0.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file bcrg-1.0.0.tar.gz.

File metadata

  • Download URL: bcrg-1.0.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for bcrg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0d39582da4a98c50207013ca6be8b18244548c4d5ac99fed4ac2092cd4e89efa
MD5 8102a2020f1c2b048fcf2887dd2bdb7b
BLAKE2b-256 93df205e1a5ef7ad821a8e43609fe548687d9012024113471e19e875be60c623

See more details on using hashes here.

File details

Details for the file bcrg-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bcrg-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for bcrg-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd141f7b350b97451155d0c30ee783d1dbfdf06cde9187f6c756346048517dfb
MD5 e37efc73c65ca0d65015aa77a8f9a326
BLAKE2b-256 ea4b8248e62855f55367a7302f168c88f473abdb392e6309ce1aa0f8aa5b742f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page