11import abc
2- from typing import Any , Dict , Final , List , NamedTuple , Optional , Tuple , Union
2+ from typing import TYPE_CHECKING , Any , Dict , Final , List , Optional , Tuple , Union
33
44from PIL .Image import Image
55
66from viam .media .video import NamedImage
77from viam .proto .common import ResponseMetadata
8+ from viam .proto .component .camera import GetPropertiesResponse
89from viam .resource .types import RESOURCE_NAMESPACE_RDK , RESOURCE_TYPE_COMPONENT , Subtype
910
1011from ..component_base import ComponentBase
11- from . import DistortionParameters , IntrinsicParameters , RawImage
12+ from . import RawImage
13+
14+ if TYPE_CHECKING :
15+ from typing import TypeAlias
1216
1317
1418class Camera (ComponentBase ):
@@ -22,17 +26,7 @@ class Camera(ComponentBase):
2226
2327 SUBTYPE : Final = Subtype (RESOURCE_NAMESPACE_RDK , RESOURCE_TYPE_COMPONENT , "camera" )
2428
25- class Properties (NamedTuple ):
26- """The camera's supported features and settings"""
27-
28- supports_pcd : bool
29- """Whether the camera has a valid implementation of ``get_point_cloud``"""
30-
31- intrinsic_parameters : IntrinsicParameters
32- """The properties of the camera"""
33-
34- distortion_parameters : DistortionParameters
35- """The distortion parameters of the camera"""
29+ Properties : "TypeAlias" = GetPropertiesResponse
3630
3731 @abc .abstractmethod
3832 async def get_image (
@@ -41,7 +35,7 @@ async def get_image(
4135 """Get the next image from the camera as an Image or RawImage.
4236 Be sure to close the image when finished.
4337
44- NOTE: If the mime type is ``image/vnd.viam.dep`` you can use :func:`viam.media.video.RawImage .bytes_to_depth_array`
38+ NOTE: If the mime type is ``image/vnd.viam.dep`` you can use :func:`viam.media.video.ViamImage .bytes_to_depth_array`
4539 to convert the data to a standard representation.
4640
4741 Args:
0 commit comments