diff --git a/rerun_py/rerun_sdk/rerun/archetypes/image_encoded_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/image_encoded_ext.py index 31641b209ce99..4d7e9ffc8e090 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/image_encoded_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/image_encoded_ext.py @@ -8,6 +8,7 @@ if TYPE_CHECKING: from ..components import MediaType + from ..datatypes import Float32Like def guess_media_type(path: str | pathlib.Path) -> MediaType | None: @@ -31,6 +32,8 @@ def __init__( path: str | pathlib.Path | None = None, contents: datatypes.BlobLike | None = None, media_type: datatypes.Utf8Like | None = None, + opacity: Float32Like | None = None, + draw_order: Float32Like | None = None, ): """ Create a new instance of the ImageEncoded archetype. @@ -56,6 +59,15 @@ def __init__( or the viewer will try to guess from the contents (magic header). If the media type cannot be guessed, the viewer won't be able to render the asset. + opacity: + Opacity of the image, useful for layering several images. + Defaults to 1.0 (fully opaque). + + draw_order: + An optional floating point value that specifies the 2D drawing + order. Objects with higher values are drawn on top of those with + lower values. + """ with catch_and_log_exceptions(context=self.__class__.__name__): @@ -69,7 +81,7 @@ def __init__( if media_type is None: media_type = guess_media_type(str(path)) - self.__attrs_init__(blob=blob, media_type=media_type) + self.__attrs_init__(blob=blob, media_type=media_type, draw_order=draw_order, opacity=opacity) return self.__attrs_clear__()