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.1-cp314-cp314-win_amd64.whl (576.0 kB view details)

Uploaded CPython 3.14Windows x86-64

pfnc-0.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

pfnc-0.1.1-cp313-cp313-win_amd64.whl (563.5 kB view details)

Uploaded CPython 3.13Windows x86-64

pfnc-0.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pfnc-0.1.1-cp312-cp312-win_amd64.whl (565.6 kB view details)

Uploaded CPython 3.12Windows x86-64

pfnc-0.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pfnc-0.1.1-cp311-cp311-win_amd64.whl (586.8 kB view details)

Uploaded CPython 3.11Windows x86-64

pfnc-0.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pfnc-0.1.1-cp310-cp310-win_amd64.whl (584.5 kB view details)

Uploaded CPython 3.10Windows x86-64

pfnc-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pfnc-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.0 MB view details)

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

pfnc-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (647.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pfnc-0.1.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 576.0 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.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0deebccc30004d907eae7141ab7e9f02eb7066c4a87edc614a3fa7a965229db5
MD5 2711060be68b5244f75d67eb79085ea8
BLAKE2b-256 bece9fa0091c3c9ef631429b1ffd9899753c2f8fc7765eeaf6204368bfd9cb5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pfnc-0.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 42b38e869f0cee36dc73d7c949621d13ad9833953d1cbcdb1601e49bbe4114dd
MD5 b52359902ab54f3d83032ce183254510
BLAKE2b-256 5528b7ea7e8130166ece6ea99356c29b2954242f43b258f19ac89f225b6852ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pfnc-0.1.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 563.5 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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 79cf33c1464439ab291d1c72216c4e6b67894f63ee1d8993ab8afe7759d0d4e0
MD5 74d401aee5e1529570511beccd63ac6c
BLAKE2b-256 b76acd4387e7dbde6c890b2c7d9454c3f3d5c31cf58510584d92cc3a685ba3cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pfnc-0.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fd3eeeb2646d6fb08e94df90e6f5b3d69b01905c3befe686045704ae04df9064
MD5 c58f8706514b0d72c82788442aa98f46
BLAKE2b-256 d3551b41435773a6d363fcc269fb703edab1979cf06dd23ffd8555ccb4ddfe6b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pfnc-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 565.6 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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9d73686431c9318de39256996b70a8e8904403e0e5c604d0cdd81cfa8895e31b
MD5 a901c02e3c94beca0d521b249dd6cadd
BLAKE2b-256 3269b4875f2ee5ce7ffccaee162954c9e27134cd9473dbd6c1e56e7f4dc5b71f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pfnc-0.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b55a625290571f43c48148370edd8c1d23574a254982ab64399638dce6e5efe6
MD5 51dbfa802e261d2cfb47cee6f45b27fb
BLAKE2b-256 1e9c4470cd08f60be9d25c13da186c6a309b3b4b5b9f5e945872f7d353a928aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pfnc-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 586.8 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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1e1630516721300cb7cc42d9f20adab6d699adaa372393d9973678c3ea2d171c
MD5 b526e2820e85518103d5fa1f63fc5bc0
BLAKE2b-256 c934c6682f6c781bf5a2efd9d79b304237b34215e58e1d01edc2d7bb9f60efe0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pfnc-0.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d14e388d2467fc7d9fd1f1bd0bcc3eb71c81906046c1bd0d1523ac8c0da156ca
MD5 d530b9de9e1a8238f82b48538306a37f
BLAKE2b-256 f644fe3b28be1e1c4308d6a459ec9ee8e6ea7445999cd2313bda5a35433da94e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pfnc-0.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 584.5 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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 747b3ac1d1ea143195cabfb3917f1073fab035671340467c5ec35c6eb6ebe3b1
MD5 d0035e220c0eb3f4ba6ee9678edd62ba
BLAKE2b-256 b1621fc916e1f69aabd4d0de4f2242fe46b0bd5781eead6a2162c7823838c082

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pfnc-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d1e1083cbecf89d2cca6ba18639e8c488117967e40f6446df3c85d6c2abc3fce
MD5 37f8390095c4a8b86bf9101da9ed9772
BLAKE2b-256 c035db69228340a930e35b34ecdfff7c7ebbb459154e48c4c86edc730285d4d5

See more details on using hashes here.

File details

Details for the file pfnc-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pfnc-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a12d38ac6ee4daeef8d4ad72af31758627353a3b9d1bf394b336a27235d9661d
MD5 e6fb2c7e9bd62b69bf804709eec03898
BLAKE2b-256 be6f4ab825cf536de1929e5395f53444091863af94cb2e7afb082ef07fcf880d

See more details on using hashes here.

File details

Details for the file pfnc-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pfnc-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8f6f2d0ac765a8280565b5d9d897754c9d00a79f2923b0b1cccf07a9569a7dfb
MD5 6252c6b151af19f4666df34bf8cf00ac
BLAKE2b-256 1b1eef2fa7b9b79dd7566582eaca3fd72dc4a0f3390e92eafc72d15dbf9ceaaf

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