Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot refactoring #65

Merged
merged 10 commits into from
Jan 27, 2025
27 changes: 26 additions & 1 deletion python/neuroglancer/viewer_config_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,31 @@ class LayerSelectionState(JsonObjectWrapper):
class LayerSelectedValues(_LayerSelectedValuesBase):
"""Specifies the data values associated with the current mouse position."""

@export
class PanelResolutionData(JsonObjectWrapper):
__slots__ = ()
type = wrapped_property("type", str)
width = wrapped_property("width", int)
height = wrapped_property("height", int)
resolution = wrapped_property("resolution", str)

@export
class LayerResolutionData(JsonObjectWrapper):
__slots__ = ()
name = wrapped_property("name", str)
type = wrapped_property("type", str)
resolution = wrapped_property("resolution", str)

@export
class ScreenshotResolutionMetadata(JsonObjectWrapper):
__slots__ = ()
panel_resolution_data = panelResolutionData = wrapped_property(
"panelResolutionData", typed_list(PanelResolutionData)
)
layer_resolution_data = layerResolutionData = wrapped_property(
"layerResolutionData", typed_list(LayerResolutionData)
)


@export
class ScreenshotReply(JsonObjectWrapper):
Expand All @@ -107,7 +132,7 @@ class ScreenshotReply(JsonObjectWrapper):
image_type = imageType = wrapped_property("imageType", str)
depth_data = depthData = wrapped_property("depthData", optional(base64.b64decode))
resolution_metadata = resolutionMetadata = wrapped_property(
"resolutionMetadata", dict
"resolutionMetadata", ScreenshotResolutionMetadata
)

@property
Expand Down
Loading
Loading