Skip to main content

Parse and model GenICam PFNC pixel format designations and decode image buffers via extensible decoders.

Project description

Data Spree PFNC Pixel Format

Parse and model GenICam PFNC pixel format designations and decode image buffers via extensible decoders. We follow semantic versioning; breaking changes only occur in major versions. Every public symbol defined under pfnc.* is stable.

CI/CD pdm-managed pre-commit

Introduction

This library provides a structured representation of GenICam PFNC pixel format designations and a pluggable system for decoding image buffers into numpy arrays.

It is intended for industrial camera and machine vision use cases where pixel formats are specified using PFNC strings (e.g. RGB8, Mono12Packed, BayerRG10) and need to be parsed, inspected, or decoded outside of a vendor-specific SDK.

The focus of this project is:

  • correct parsing of PFNC designations
  • explicit modeling of pixel format properties
  • extensibility via registries (decoders, data types, components, packing, interface specifics)

This is not a general-purpose image processing library.

Getting Started

Installation

pip install pfnc

or, when using pdm:

pdm add pfnc

Basic Usage

from dataspree.pfnc import PixelFormat

pf = PixelFormat.from_designation("RGB8")

image = pf.decode(
    buffer,
    width=256,
    height=256,
    copy=False,
)

Extending the library

The library is designed to be extensible. You can register custom decoders or extend parsing behavior for additional PFNC variants.

Registering a custom decoder

from dataspree.pfnc import register_decoder, PixelFormatDecoder

class MyDecoder(PixelFormatDecoder):
    priority = 10

    def supports(self, pixel_format) -> bool:
        ...

    def decode(self, data, width, height, *, copy=False):
        ...

register_decoder(MyDecoder)

Advanced extensions

Advanced users may extend:

  • data types
  • components
  • packing rules
  • interface specifics

These extension points are intentionally exposed.

Scope and limitations

Parsing support covers common PFNC designations.

Decoding support depends on available decoders.

Not all packed or planar formats may be decodable out of the box.

See the documentation for details on supported formats.

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.

pfnc-0.1.0-cp314-cp314-win_amd64.whl (557.8 kB view details)

Uploaded CPython 3.14Windows x86-64

pfnc-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

pfnc-0.1.0-cp313-cp313-win_amd64.whl (545.9 kB view details)

Uploaded CPython 3.13Windows x86-64

pfnc-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pfnc-0.1.0-cp312-cp312-win_amd64.whl (548.1 kB view details)

Uploaded CPython 3.12Windows x86-64

pfnc-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pfnc-0.1.0-cp311-cp311-win_amd64.whl (566.0 kB view details)

Uploaded CPython 3.11Windows x86-64

pfnc-0.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pfnc-0.1.0-cp310-cp310-win_amd64.whl (563.4 kB view details)

Uploaded CPython 3.10Windows x86-64

pfnc-0.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file pfnc-0.1.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pfnc-0.1.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 557.8 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pfnc-0.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c8feac669d9d6088d32b9d94ad0028f525e12ec83bd5fccfb582380b8a7213a5
MD5 1d9968c7c26f35708a1d4caa3fadc61b
BLAKE2b-256 d8fab76ccf16b2d7bf5ed9885f6aeb63444e2cfb40ba28567108bbacad2dfbf9

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pfnc-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b88c8483ea98cb78b435c220ed28f96f3d42d859483794ea9df1c1bc042e4f84
MD5 de5e8a0d0762686e02f98d9fb7ffa0a3
BLAKE2b-256 b98ca678a23611fb7627a24331264bdac64a9084faf4f1a7e97c3eadd8b5884a

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pfnc-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 545.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pfnc-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1afd4594a85ed963efa3fce63f1424e08db6e99e2df57a74864040e5d924e6d9
MD5 0108cac3d418657643147a90dece0195
BLAKE2b-256 96e8f085059b295f27b1a76e0b3255e18a23bce4e9d5bf0bcb80e2a425d8f80b

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pfnc-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3dad490b1241b2d7a07f5dc1fa26cb6c567a04090992020a5c96ee325ffc664b
MD5 7c0707ca04a6d2203f6b1a7f2f44ec1c
BLAKE2b-256 f9fb45b260ae7726bb0b40f274e0bf32391d9383ccca5f9d9d64079981edac68

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pfnc-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 548.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pfnc-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7c9002511153cda3b129e6130564e49bd9e9036b8b73b00082cde48849f55c8e
MD5 5a663073e297fd253162d80d230ac649
BLAKE2b-256 cf65d234343556dc66a12a5ef9f078fee43d50e9c290fa3311a13ffe76bc6f90

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pfnc-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b1d9e9eb3989b7c4712d02fd84d4cbdc45d1d51042891e2c8d4f46e058fcebf2
MD5 6ff9127e9d17709bddc124fb849bf4a9
BLAKE2b-256 16917cfde32b05d4304f50d69cda60f5d86ae323fe2bae4b5354f381c36f9f9d

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pfnc-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 566.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pfnc-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 873a780fbd1d67a2fe312a98a2e2b81be2d8c39f2e9e7e5920873cbc10ebc8e9
MD5 9885b120ab19968c34b9eb08caff92e0
BLAKE2b-256 ab6e16b6793c80a71abdff291ad22a15fabcf6f4d8a094ba472c6ba83f2ff645

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pfnc-0.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 58643c454cdcd90bff31b796055f8c9fdf0f1b918c974a5076990db7f7c5f48c
MD5 dfcc2ae5c2c55cf1de06997cdcca5362
BLAKE2b-256 60ae5d8ec5d8d8885717c568ad3b51609286da5fa4713e1e84bc7b15f6570875

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pfnc-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 563.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pfnc-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dc23452e2c5176d10d001438dcee711d18c123eef1cfc307dd18f8377df4d73d
MD5 a86dfd83e55e50e602399b2feee285d8
BLAKE2b-256 b1e7749e4b113bb17d82ef38e9a5391ff5638b0d4c57b1a981b29d0f01400e89

See more details on using hashes here.

File details

Details for the file pfnc-0.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pfnc-0.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fbcb103e0cbdc0262fc4107eb72bf1fa82c7ae586ba6fd136c703c979967d4ee
MD5 077c59ce0d51dfc2cf5bf2e87d36968c
BLAKE2b-256 5930d735b1c14fa488bd8914076e1bf536c71154238357e6ae5d079e8e7afbad

See more details on using hashes here.

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