ImageFormat
Represents image format metadata (dimensions and optionally pixel format, channel datatype, and color model) without storing pixel data. This datatype is used when only format or metadata is required within the Telekinesis ecosystem.
Field
Required
| Field | Type | Description |
|---|---|---|
width | int | Image width in pixels (int). |
height | int | Image height in pixels (int). |
Optional
| Field | Type | Description |
|---|---|---|
pixel_format | int | Pixel format enum value (int). |
channel_datatype | ChannelDatatype | Channel datatype. See Enums. |
color_model | ColorModel | Color model. See Enums. |
Example
python
from datatypes import datatypes
from loguru import logger
# ------------------------------------------------
# 1. Create ImageFormat instance
# ------------------------------------------------
image_format = datatypes.ImageFormat(
width=2,
height=2,
pixel_format=1,
channel_datatype=0,
color_model=1,
)
# ------------------------------------------------
# 2. Access format attributes
# ------------------------------------------------
logger.info("ImageFormat width={}", image_format.width)
logger.info("ImageFormat height={}", image_format.height)
logger.info("ImageFormat pixel_format={}", image_format.pixel_format)
logger.info("ImageFormat channel_datatype={}", image_format.channel_datatype)
logger.info("ImageFormat color_model={}", image_format.color_model)
