Skip to content

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.

ValueDescription
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.

ValueDescription
RAWUncompressed raw pixel data.
PNGPNG compressed image data.

ImageCompression

Whether image bytes are compressed. Used internally by Image.

ValueDescription
NONENo compression.
ZSTDZstandard compression.

ChannelDatatype

The scalar type of each color channel. Used by Image (e.g. when constructing from raw bytes or for channel_datatype).

Values

ValueDescription
U88-bit unsigned integer.
I88-bit signed integer.
U1616-bit unsigned integer.
I1616-bit signed integer.
U3232-bit unsigned integer.
I3232-bit signed integer.
U6464-bit unsigned integer.
I6464-bit signed integer.
F1616-bit IEEE-754 float (half).
F3232-bit IEEE-754 float.
F6464-bit IEEE-754 float (double).

Extension (ChannelDatatypeExt)

  • from_np_dtype(dtype) — Returns the ChannelDatatype for a NumPy dtype (e.g. np.uint8U8, np.float32F32). 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 a ChannelDatatype, an int (enum value), or a string (case-insensitive variant name). Raises ValueError if conversion fails.

ColorModel

Which color channels are present in an image. Used by Image and ImageFormat.

Values

ValueDescription
LGrayscale (luminance).
RGBRed, Green, Blue.
RGBARed, Green, Blue, Alpha.
BGRBlue, Green, Red.
BGRABlue, 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 a ColorModel (case-insensitive, e.g. "rgb", "BGRA"). Valid names: "L", "RGB", "RGBA", "BGR", "BGRA". Raises ValueError for 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.

ValueDescription
VISIBLEPart is visible.
OCCLUDEDPart is occluded.
REMOVEDPart has been removed.
PROCESSEDPart has been processed.
NOTPROCESSEDPart not yet processed.
FAILED_GRASPGrasp attempt failed.