Skip to main content

Python bindings for Blend2D focused on layout rasterization workflows.

Project description

raster-blend2d

Python bindings for Blend2D focused on layout rasterization.

Status

This project is an initial packaging and binding skeleton. It expects Blend2D source at extern/blend2d before native builds can succeed.

Development

Add Blend2D and AsmJit as vendored dependencies:

git clone --depth 1 https://github.com/blend2d/blend2d extern/blend2d
git clone --depth 1 https://github.com/asmjit/asmjit extern/asmjit

Build and test locally:

python -m pip install -U pip build pytest
python -m pip install -e .
pytest

Build a wheel:

python -m build

Polygon Rasterization API

from raster_blend2d import Blend2DPolygonRasterizer

rasterizer = Blend2DPolygonRasterizer(
    pixel_size_um=(0.01, 0.02),
    oversampling=4,
)

polygons = [
    {
        "hull": [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)],
        "holes": [],
    }
]

coverage = rasterizer.rasterize(
    polygons=polygons,
    window_size_um=(2.0, 2.0),
)

assert coverage.dtype == "float32"
assert coverage.shape == (200, 100)
assert coverage[0, 0] >= 0.0

coverage[x, y] uses a lower-left window origin. Internally, polygons are rendered to a Blend2D A8 mask at the requested oversampling rate and downsampled to float32 coverage.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

raster_blend2d-0.1.2-cp313-cp313-win_amd64.whl (883.4 kB view details)

Uploaded CPython 3.13Windows x86-64

raster_blend2d-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

raster_blend2d-0.1.2-cp312-cp312-win_amd64.whl (883.4 kB view details)

Uploaded CPython 3.12Windows x86-64

raster_blend2d-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

raster_blend2d-0.1.2-cp311-cp311-win_amd64.whl (880.0 kB view details)

Uploaded CPython 3.11Windows x86-64

raster_blend2d-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

raster_blend2d-0.1.2-cp310-cp310-win_amd64.whl (879.6 kB view details)

Uploaded CPython 3.10Windows x86-64

raster_blend2d-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

raster_blend2d-0.1.2-cp39-cp39-win_amd64.whl (879.7 kB view details)

Uploaded CPython 3.9Windows x86-64

raster_blend2d-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file raster_blend2d-0.1.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f67fef62fb296b33b47128e2ff90b46cc3627e3995658f583dcddb99e55686ac
MD5 7d51234996144fa7ee67ce4994bc3479
BLAKE2b-256 2b2feb3f8a4a72b80dced1fa01d1d214883371e09601474674e6d3d3ffa8204d

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp313-cp313-win_amd64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44b74c883d71680fc17e3d27848a6df814d361f53b5e2edca4279672d1b49b9e
MD5 187c0850615abfa73862975879c5af5e
BLAKE2b-256 047498f2458dc16d7ced382f4cfe9effdacbea628ab0d0354fcf4436f1d3ecb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d153c9da80594946c42600b253e363e4e479323fb2e130f7426274259455351b
MD5 7a9583f9819aa7469410556e799d227d
BLAKE2b-256 8d4bacc8aa6a4f67982c1d38e2f22ab3e1b7e6b0658a4d23a23e49b8b2b918ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5cbda9855b0f86889893d19a095b94eeb67a53607c311d4d058c28645ae5cbf
MD5 22c87cfe8424ea12c9861982cfa7fa00
BLAKE2b-256 ed177194f4439867b4d73b90d6996e15be949d7eedd61c1cf7ef0f8e020a6180

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a5a62b0bfdf334e7265097eaed7601dd01a8736450c0dfc75126d586b391e3cd
MD5 34bb0a80f3f0142f35364fc4031a1ff0
BLAKE2b-256 120c35b0cefba70d88160d7245694be5e122ed498607f8cc6001b23fec8ab582

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp311-cp311-win_amd64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 42edb621c775fb5c284ea8fa34839577e3ac31b9e1e8ee70d2f1f0c89a1e3639
MD5 a403bf988fd075114e9ae7aa43e83234
BLAKE2b-256 1f91b841012c57daa3b3cc12f929719f29d040d953446b802a96721bb0d3efc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1c0341687f9ff752a93737b254847cd23144a49245a37d7dab8a25f065ebe468
MD5 9e28048bcf6993bc9309c0687bee4850
BLAKE2b-256 a7b1f46d9bd0220345b6f55d9c0a6f7677fb1425700a21a7b58957995bb269be

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1b8eac7935b38eecce881e626e27fed277a25e301e2e80a4e2f11d44ee2a9ec
MD5 7e16d936ee774854bba7275682188281
BLAKE2b-256 5cf486b0c56abe96f39556d2273df046be9a43d084ecc0196097ca99025918d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0c1c0f78bd007e0dced189f9abc20202e4444bb6f224d76f381fc882e2a3893e
MD5 76948b1e1b71396d00c415f82b0cf918
BLAKE2b-256 327f5622aa63733240f4a62aeaed831a799692dc38934c2038450c7e780452a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp39-cp39-win_amd64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raster_blend2d-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f52751a13afb416bc4fde4a948568f99f7897ed9ea732de599dfaed47bf1980d
MD5 2edbadacf09813ce129b70abd470015d
BLAKE2b-256 bcc66e471c9677eb1f71fe00354abf79e54056b9316e68830331d91a1d542d5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on diffractlight/raster_blend2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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