Skip to content

Commit

Permalink
fix: remove texture guessing (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 authored Jan 17, 2025
1 parent c1be08a commit d02445c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 49 deletions.
6 changes: 2 additions & 4 deletions src/ndv/views/_vispy/_array_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from ndv._types import CursorType
from ndv.views._app import filter_mouse_events
from ndv.views._vispy._utils import supports_float_textures
from ndv.views.bases import ArrayCanvas
from ndv.views.bases._graphics._canvas_elements import (
CanvasElement,
Expand Down Expand Up @@ -441,7 +440,6 @@ def __init__(self) -> None:
self._ndim: Literal[2, 3] | None = None

self._elements: WeakKeyDictionary = WeakKeyDictionary()
self._txt_fmt = "auto" if supports_float_textures() else None

@property
def _camera(self) -> vispy.scene.cameras.BaseCamera:
Expand Down Expand Up @@ -485,7 +483,7 @@ def add_image(self, data: np.ndarray | None = None) -> VispyImageHandle:
data = _downcast(data)
try:
img = scene.visuals.Image(
data, parent=self._view.scene, texture_format=self._txt_fmt
data, parent=self._view.scene, texture_format="auto"
)
except ValueError as e:
warnings.warn(f"{e}. Falling back to CPUScaledTexture", stacklevel=2)
Expand All @@ -506,7 +504,7 @@ def add_volume(self, data: np.ndarray | None = None) -> VispyImageHandle:
data,
parent=self._view.scene,
interpolation="nearest",
texture_format=self._txt_fmt,
texture_format="auto",
)
except ValueError as e:
warnings.warn(f"{e}. Falling back to CPUScaledTexture", stacklevel=2)
Expand Down
45 changes: 0 additions & 45 deletions src/ndv/views/_vispy/_utils.py

This file was deleted.

0 comments on commit d02445c

Please sign in to comment.