Nodes and result types
The Python type layer defines node inputs, measurement results, and animation scenes.
AnimationScene.duration_ms and RawAnimationFrame.duration_ms must be positive.
Raw animation frames also require positive dimensions and exactly
width * height * 4 RGBA bytes.
RawRgbaImage describes decoded row-major RGBA pixels used as an ImageNode.src.
Its byte length follows the same width * height * 4 contract.
takumi_py.types.ImageNode
Bases: NodeBase
src
instance-attribute
src : str | bytes | RawRgbaImage
width
instance-attribute
width : NotRequired [ float ]
height
instance-attribute
height : NotRequired [ float ]
takumi_py.types.RawRgbaImage
Bases: TypedDict
Raw row-major RGBA pixels used directly as an image node source.
height
instance-attribute
premultiplied
instance-attribute
premultiplied : NotRequired [ bool ]
takumi_py.types.ContainerNode
Bases: NodeBase
type
instance-attribute
type : Literal [ 'container' ]
children
instance-attribute
children : NotRequired [ list [ Node ]]
takumi_py.types.MeasuredNode
dataclass
height
instance-attribute
transform : tuple [ float , float , float , float , float , float ]
children
instance-attribute
children : tuple [ MeasuredNode , ... ]
runs
instance-attribute
runs : tuple [ MeasuredTextRun , ... ]
__init__
__init__ (
width : float ,
height : float ,
transform : tuple [
float , float , float , float , float , float
],
children : tuple [ MeasuredNode , ... ],
runs : tuple [ MeasuredTextRun , ... ],
) -> None
takumi_py.types.MeasuredTextRun
dataclass
height
instance-attribute
__init__
__init__ (
text : str ,
x : float ,
y : float ,
width : float ,
height : float ,
) -> None
takumi_py.types.AnimationScene
dataclass
node
instance-attribute
node : NodeInput | CompiledNode
duration_ms
instance-attribute
__init__
__init__ (
node : NodeInput | CompiledNode , duration_ms : int
) -> None
takumi_py.types.RawAnimationFrame
dataclass
height
instance-attribute
duration_ms
instance-attribute
__init__
__init__ (
data : bytes , width : int , height : int , duration_ms : int
) -> None
takumi_py.types.validate_node
validate_node ( node : object ) -> Node