Skip to content

Commit

Permalink
Merge pull request #65 from MetaCell/feature/NA-377-fix
Browse files Browse the repository at this point in the history
Screenshot refactoring
  • Loading branch information
seankmartin authored Jan 27, 2025
2 parents f3e108c + a29818d commit 5a6d07c
Show file tree
Hide file tree
Showing 3 changed files with 301 additions and 428 deletions.
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

0 comments on commit 5a6d07c

Please sign in to comment.