Skip to content

Commit 5a6d07c

Browse files
authored
Merge pull request #65 from MetaCell/feature/NA-377-fix
Screenshot refactoring
2 parents f3e108c + a29818d commit 5a6d07c

File tree

3 files changed

+301
-428
lines changed

3 files changed

+301
-428
lines changed

python/neuroglancer/viewer_config_state.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,31 @@ class LayerSelectionState(JsonObjectWrapper):
9696
class LayerSelectedValues(_LayerSelectedValuesBase):
9797
"""Specifies the data values associated with the current mouse position."""
9898

99+
@export
100+
class PanelResolutionData(JsonObjectWrapper):
101+
__slots__ = ()
102+
type = wrapped_property("type", str)
103+
width = wrapped_property("width", int)
104+
height = wrapped_property("height", int)
105+
resolution = wrapped_property("resolution", str)
106+
107+
@export
108+
class LayerResolutionData(JsonObjectWrapper):
109+
__slots__ = ()
110+
name = wrapped_property("name", str)
111+
type = wrapped_property("type", str)
112+
resolution = wrapped_property("resolution", str)
113+
114+
@export
115+
class ScreenshotResolutionMetadata(JsonObjectWrapper):
116+
__slots__ = ()
117+
panel_resolution_data = panelResolutionData = wrapped_property(
118+
"panelResolutionData", typed_list(PanelResolutionData)
119+
)
120+
layer_resolution_data = layerResolutionData = wrapped_property(
121+
"layerResolutionData", typed_list(LayerResolutionData)
122+
)
123+
99124

100125
@export
101126
class ScreenshotReply(JsonObjectWrapper):
@@ -107,7 +132,7 @@ class ScreenshotReply(JsonObjectWrapper):
107132
image_type = imageType = wrapped_property("imageType", str)
108133
depth_data = depthData = wrapped_property("depthData", optional(base64.b64decode))
109134
resolution_metadata = resolutionMetadata = wrapped_property(
110-
"resolutionMetadata", dict
135+
"resolutionMetadata", ScreenshotResolutionMetadata
111136
)
112137

113138
@property

0 commit comments

Comments
 (0)