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

Uploaded CPython 3.14Windows x86-64

raster_blend2d-0.1.3-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.3-cp313-cp313-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.13Windows x86-64

raster_blend2d-0.1.3-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.3-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

raster_blend2d-0.1.3-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.3-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

raster_blend2d-0.1.3-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.3-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10Windows x86-64

raster_blend2d-0.1.3-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.3-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

raster_blend2d-0.1.3-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.3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 3729800d11f83b46d6d6b35ed5b85edbc43c13080b213185970d96e7b419913c
MD5 8cc2604363e2988aef19eeac4895cba1
BLAKE2b-256 2e377d6f62931f1af8bcce844564ccb8c061c10715082db3d4055e45fa087491

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30eb0bc83199275fcfeca51e402feba0d1034b08415a9351beaddc0516f4a2b5
MD5 09a23c1f2e1f71709cac046422bb2de5
BLAKE2b-256 9daa42d5b392452c1a6ee12a4f4a770ac4b0571bd19dcec03751b20368098f14

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.3-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.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5ba14491a679da72236167c872e789faf96ac57dff29858ca8edf857bd74d6cd
MD5 daee492a76fb7b3401875f00ce4c9771
BLAKE2b-256 f9a1e451da5b0844569ed4fca8d0b9f2a732ab6fc32e3b3a428f95b4f391419a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 727211db5734fd1d38cec65c16e625b6db42d027b6b6608a681b31f0383cae94
MD5 e0634d08e4517b975713f3c9987f462b
BLAKE2b-256 331dc4c9841bee675f4a5884412cd7b34374b9cd47454014df81c9d12388912d

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.3-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.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7896e30a03bbdc121afae30beea4ab8110715ba4f4d32a5be12bddcfa530402a
MD5 2508cec2de5d6690c4d759032cbcf676
BLAKE2b-256 d9a081cf398e2c38f52aaac002b3166cb158461ca370cc5d47264983cddb39f2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dd036b3d03025826b5eb75003706be17eac28571a6491e503d2ec1fdcec7b8b5
MD5 1129864f86d0a683137310128d4d7f15
BLAKE2b-256 b33b5e665f15ef5d17d6c147b4555b267943e3b07e18bfc9ac7c670afa7438e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.3-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.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 364c64acf6bed33d31d89317a2246d7286817fed74eaf179f12c0b6f468ad3a3
MD5 0f1f04c0eaccad9b1240ff8d9f7cd01d
BLAKE2b-256 86948473e35c71dc1aa05d9e12486164d936ce3fe5635f66827a8d62b889c437

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d4bfe6b56ad0a4392c0701e4b7d8bc7b7c1f1f8828eafc5b4cd63f2310c6cd78
MD5 286f446a36ae87e5b5b8c23f5afa7dc8
BLAKE2b-256 5410e97d12da02ddfd21a51fdf4120fe918e5411e4fa3da8b5ef324f4eb1baaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.3-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.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b1b24a75cf0f7dd4c8fa0f1e30ed43cc08656054d84dc962b304deff0761ab7a
MD5 96e676703c4377c1e57ca7a823384640
BLAKE2b-256 21774bd6e01a4852075a1e356d5ba685ba507d893cf1e5504733a782a48d74c2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 39d1e59dd2757c59f20fe4c868a9bbf9116d273c4ac3640cf3b1e004ccd681a2
MD5 ecdee837f15f9505653270ac19559b12
BLAKE2b-256 50dd571cea8989babd34744d14899c9a2efe2b7f63f08ecc1af42c3fe57fc9a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.3-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.3-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d4f78ddc53551bb47a4077cb91c539a199a746ff1483a754f579c4ec6a7bc840
MD5 512784619eb053c97a3d6ca3dac4d600
BLAKE2b-256 0bc1b2e75e6e16a672ad30256475aea1a05d9e437bf82991fc68f9e2b7db1545

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raster_blend2d-0.1.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d681103446ab9e39e702f2eff816e0cc579111d8af7be7b975f9a088061764f3
MD5 59f9ba9a46b021d559e8620f2a4e1e93
BLAKE2b-256 4fa9e3e3ce669cb51fff333fabf0526954e3ee7a974c3682065091ed9ab26f2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for raster_blend2d-0.1.3-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