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

Define texture internalformat to fix colormap discretisation #441

Merged
merged 8 commits into from
Feb 27, 2025
11 changes: 9 additions & 2 deletions uwsift/view/scene_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
DEFAULT_TEXTURE_SHAPE = (4, 16)


class CustomImage(Image):
"""Custom image override to fix issue #404."""

def _init_texture(self, data, texture_format, **texture_kwargs):
return super()._init_texture(data, texture_format, internalformat="r32f")


class Markers2(Markers):
pass

Expand Down Expand Up @@ -952,7 +959,7 @@ def add_node_for_image_dataset(self, layer: LayerItem, product_dataset: ProductD
image.determine_reference_points()
elif IMAGE_DISPLAY_MODE == ImageDisplayMode.SIMPLE_GEOLOCATED:
grid = self._calc_subdivision_grid(product_dataset.info)
image = Image(
image = CustomImage(
image_data,
name=str(product_dataset.uuid),
interpolation="nearest",
Expand All @@ -965,7 +972,7 @@ def add_node_for_image_dataset(self, layer: LayerItem, product_dataset: ProductD
translate=(product_dataset.info[Info.ORIGIN_X], product_dataset.info[Info.ORIGIN_Y], 0),
)
else:
image = Image(
image = CustomImage(
image_data,
name=str(product_dataset.uuid),
interpolation="nearest",
Expand Down
Loading