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.4-cp314-cp314-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.14Windows x86-64

raster_blend2d-0.1.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

raster_blend2d-0.1.4-cp313-cp313-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.13Windows x86-64

raster_blend2d-0.1.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

raster_blend2d-0.1.4-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

raster_blend2d-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

raster_blend2d-0.1.4-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

raster_blend2d-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

raster_blend2d-0.1.4-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10Windows x86-64

raster_blend2d-0.1.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

raster_blend2d-0.1.4-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

raster_blend2d-0.1.4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file raster_blend2d-0.1.4-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 5809ad84e3098688b02929d6a33d31e70880dd15a4191b13894b8257a33a3eca
MD5 4657550723f9534173f19de9efb07a6c
BLAKE2b-256 4709794752d2f6d30ff71ab76eabb9de9e2f6e3bb54d5a2c3403f8c6f305ed08

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-cp314-cp314-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.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3b0faa4b270d6d988190ea9ebc076f335091844c2b50e95fa3e217377d577374
MD5 e9fabb2002d287e0625f854653b16320
BLAKE2b-256 dfc1958ef11547ca8a58e029db4d6549cf17e9976147159581fe2de19c8b9eae

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_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.4-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c945ba83d56c6f7894a65899d55df0fb4f36143f1ec3e6f7b435ff90ac02e1a8
MD5 0a86a797a0d6ecef8905d5c298774368
BLAKE2b-256 a2e28423ab639b5ea53e2aad10c1284ae315ebc8ca286af4dd283fd97db6839e

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-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.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dbe91dedef82364dda8b674ddfdc5aa1d65fe5577fb9f8dab26302f857ed3d6b
MD5 222b00901cd185ee8faf8fea58cbd177
BLAKE2b-256 1683e4e9bfd390eab2870b19d60fb42c247de1038e8df9706638a072a018b91b

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_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.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d05b63b6a5ab45ac552b9229bbca375cf91989b2252a02b293c3ba55b8f849f3
MD5 8c08847eb096dbbf0c427ee9244f6ed9
BLAKE2b-256 073b93e6061c5d26ffb599fc2231cbeabb5dfe51b2a1dc5a4c9102ab0a6a68f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-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.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aef679e117182819ec64c9424837422107d5a2c5d5ef6ac802d1aadb82dde7dd
MD5 458e436c009e42f07131b78de4ec553c
BLAKE2b-256 c2abf5e042c3fb4dde6ceedca160fdfca782c7613ebc036e274bbc5805785c8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_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.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9874f28b0cdd534ee1f5e6111e57eb03b9cd517d41628f0d70bb86e7def7bedd
MD5 2d3e0edc93ae12c79d0e78b4fbf4ed70
BLAKE2b-256 2dc54c009eb327d0ebe9f5b3c9c147d84b660c4f4c588fc19fc9e58050ff9e7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-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.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0377c11bfb0550d2a0fd6c7f64b2fd89d1a87efe984b515fa7f3e48407af3058
MD5 85268f1735260461383836f6378653be
BLAKE2b-256 8863e1377fa811bd115336c671ffe1e842b0263bc436c328921f57558216a7e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_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.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 602d3e909451b22a8839691efb6b98c5321150dedf93d77780e990bab2eaea2a
MD5 59c1eb37174277d16a009f767a513adc
BLAKE2b-256 3d559565f05e8ad591de8f89ac674cf5b2945028ce405c29bc577c97bfa84b3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-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.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 83cd1fe8d0af03113b84fd6437abe6195d611e157c3b237511bbeee60f5181a5
MD5 f08173ddd7b959251a8ebee9fb0dd232
BLAKE2b-256 3bd763b1f3487f3bbbb1b69ff5dbb413015b731ac3aa8ba2bf4734c2ae0a04ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_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.4-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5a7deece21265f304eeecdb1523562411d8cf81074788db6be2a34d4b67fcfe1
MD5 2880f72e6cd0a1d29b7f262d6894cf94
BLAKE2b-256 4a42cdc484446ce98a0771e3772556e9051b11c728251fc10d1d4cadd7ce7412

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-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.4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dcfd6eba5c64a447d35668dfbb838bacc201de80ac4975691de453038290653c
MD5 fcb77b43220220bd318dd227e4e8b560
BLAKE2b-256 4aa9af55003815c5e0d117952498a98a9f3cd5924bbab3434d4a9475c6278678

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_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