Enums
The datatypes package defines several enumerations used by other types. Reference this page from datatypes that accept or use these enums.
Box2DFormat
How to interpret 2D box arrays (axis-aligned bounding boxes). Used by Boxes2D for the array_format field.
| Value | Description |
|---|---|
XYWH | [x, y, width, height], with (x, y) = left, top. |
YXHW | [y, x, height, width], with (x, y) = left, top. |
XYXY | [x0, y0, x1, y1], with (x0, y0) = left, top and (x1, y1) = right, bottom. |
YXYX | [y0, x0, y1, x1], with (x0, y0) = left, top and (x1, y1) = right, bottom. |
XCYCWH | [x_center, y_center, width, height]. |
XCYCW2H2 | [x_center, y_center, width/2, height/2]. |
ImageEncoding
How image pixel data is encoded (e.g. for transport). Used internally by Image.
| Value | Description |
|---|---|
RAW | Uncompressed raw pixel data. |
PNG | PNG compressed image data. |
ImageCompression
Whether image bytes are compressed. Used internally by Image.
| Value | Description |
|---|---|
NONE | No compression. |
ZSTD | Zstandard compression. |
ChannelDatatype
The scalar type of each color channel. Used by Image (e.g. when constructing from raw bytes or for channel_datatype).
Values
| Value | Description |
|---|---|
U8 | 8-bit unsigned integer. |
I8 | 8-bit signed integer. |
U16 | 16-bit unsigned integer. |
I16 | 16-bit signed integer. |
U32 | 32-bit unsigned integer. |
I32 | 32-bit signed integer. |
U64 | 64-bit unsigned integer. |
I64 | 64-bit signed integer. |
F16 | 16-bit IEEE-754 float (half). |
F32 | 32-bit IEEE-754 float. |
F64 | 64-bit IEEE-754 float (double). |
Extension (ChannelDatatypeExt)
from_np_dtype(dtype)— Returns theChannelDatatypefor a NumPy dtype (e.g.np.uint8→U8,np.float32→F32). Supported:uint8/16/32/64,int8/16/32/64,float16/32/64.to_np_dtype()— Returns the NumPy dtype for this channel datatype (e.g.ChannelDatatype.U8.to_np_dtype()→np.uint8).ChannelDatatype.auto(val)— Best-effort converter: accepts aChannelDatatype, anint(enum value), or a string (case-insensitive variant name). RaisesValueErrorif conversion fails.
ColorModel
Which color channels are present in an image. Used by Image and ImageFormat.
Values
| Value | Description |
|---|---|
L | Grayscale (luminance). |
RGB | Red, Green, Blue. |
RGBA | Red, Green, Blue, Alpha. |
BGR | Blue, Green, Red. |
BGRA | Blue, Green, Red, Alpha. |
Extension (ColorModelExt)
num_channels()— Returns the number of channels:L→ 1;RGB,BGR→ 3;RGBA,BGRA→ 4.ColorModel.from_string(name)— Converts a string to aColorModel(case-insensitive, e.g."rgb","BGRA"). Valid names:"L","RGB","RGBA","BGR","BGRA". RaisesValueErrorfor unknown names.
Type aliases: ColorModelLike is a union of ColorModel, string literals (e.g. "RGB", "L"), and int. ColorModelArrayLike extends this to allow sequences of ColorModelLike for batch APIs.
PartState
State of a part in a tray or bin. Used by Part for the optional state field.
| Value | Description |
|---|---|
VISIBLE | Part is visible. |
OCCLUDED | Part is occluded. |
REMOVED | Part has been removed. |
PROCESSED | Part has been processed. |
NOTPROCESSED | Part not yet processed. |
FAILED_GRASP | Grasp attempt failed. |

