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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pfnc-0.1.2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: pfnc-0.1.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 567.8 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f97586b0a7f1ac7768b2002a249a7c65d87d37cd3a46cfb61096e908b13450c
|
|
| MD5 |
8d723e2307208d4a0d56ede2c6c998ca
|
|
| BLAKE2b-256 |
bf0b9bb481499c5e33e59f283a1f467dcbac8875ad429d14af51c1d677c5307d
|
File details
Details for the file pfnc-0.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pfnc-0.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ec89b44a9fbaa54d6ed2703d7a559ef7f12fff5f1cdee78432f46f4fe873f75
|
|
| MD5 |
4263080baa16a4c03271a2d1d5e16158
|
|
| BLAKE2b-256 |
71955ef762d728baf1aba3585338af0973e58562e4306b94669b3bf70746cefc
|
File details
Details for the file pfnc-0.1.2-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: pfnc-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 638.3 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e301819d21bc0760b60c2029302f62e022753e8a2cecc73c732d1be8866e1a23
|
|
| MD5 |
061e9c5684a4640941d5f0f9a4783b55
|
|
| BLAKE2b-256 |
abb5dffe61b4423c21d6e5be1beaaa6bfad68c1e82bb2f132a5067ea48b25467
|
File details
Details for the file pfnc-0.1.2-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: pfnc-0.1.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 585.6 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
228a449bfa738220667930bd92556cb8fd3e1407eea55a8875891b93fdff889c
|
|
| MD5 |
4d23c9e434f001a22844b634391a4ab0
|
|
| BLAKE2b-256 |
126429960e845e57d91462dff7da65b44ccbb0fad37cd12170bd5af3f9f3e768
|
File details
Details for the file pfnc-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pfnc-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
324070e3f44d88f142d3da8bf3a9106818da05625feb1e6291c634eff2c66f3a
|
|
| MD5 |
1df6020784632b87b12be6344bddc76f
|
|
| BLAKE2b-256 |
b5e7274695cac8787b35c5fdff5f59c1bffc0d619b92d074a98a75d4ed301a10
|
File details
Details for the file pfnc-0.1.2-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: pfnc-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 647.6 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2393e21aa8008f5d23dc3ee3105a33e9d30b22f4f3457d9e2cd02319b4dbe8ba
|
|
| MD5 |
4d31917b3b5f7facb1bc0a55f8b2451b
|
|
| BLAKE2b-256 |
7ef93b6819bc522348368a40d9ea13eee94992a410b0f12eaaf2471feb89a22d
|