wolfhece.wolf_texture
Author: HECE - University of Liege, Pierre Archambeau Date: 2024
Copyright (c) 2024 University of Liege. All rights reserved.
This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
Module Contents
- class wolfhece.wolf_texture.genericImagetexture(which: str, label: str, mapviewer, xmin: float, xmax: float, ymin: float, ymax: float, imageFile: str = '', imageObj=None, transparent_color=None, tolerance: int = 3, replace_color=None, drawing_scale: float = 1.0, offset: list[float, float] = [0.0, 0.0])[source]
Bases:
wolfhece.drawing_obj.Element_To_Draw
Affichage d’une image en OpenGL via une texture
- load(imageFile='')[source]
Load the image texture into OpenGL
- Parameters:
imageFile – Optional file path to load the image from
This method first checks if an asynchronous image has been loaded and is ready. If so, it uses that image. Otherwise, it proceeds with synchronous loading.
- reload(xmin=-99999, xmax=-99999, ymin=-99999, ymax=-99999)[source]
Reload the texture with new spatial bounds and trigger async image update if using cache.
When spatial bounds change, this method: 1. Updates the bounds 2. Checks if the view has changed significantly 3. If using a cache service, schedules async image loading 4. Immediately updates the texture if using direct service (non-cached)
- _schedule_async_image_update()[source]
Schedule an asynchronous image update based on current bounds and service.
This is called when bounds change and the texture is using a cached service. The image is loaded in the background without blocking the UI.
Optimizations: 1. Cancel obsolete requests for this texture (old bounds become irrelevant) 2. Load a degraded image (lower resolution, larger bounds) while waiting for best quality
- _load_degraded_image_for_fallback(service) bool[source]
Load a lower-resolution image at wider bounds for immediate display while best quality loads.
This improves perceived responsiveness by showing a degraded image immediately. The wider bounds ensure the degraded image covers the viewport during fast pans/zooms.
- Parameters:
service – WebService enum for the source
- Returns:
True if fallback was loaded, False otherwise
- _get_current_service() wolfhece.PyWMS.WebService | None[source]
Determine the current service based on texture type.
- Returns:
WebService enum value or None
- plot(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None)[source]
alias for paint
- class wolfhece.wolf_texture.imagetexture(which: str, label: str, cat: str, subc: str, mapviewer, xmin: float, xmax: float, ymin: float, ymax: float, width: int = 1000, height: int = 1000, France: bool = False, epsg='31370', Vlaanderen: bool = False, LifeWatch: bool = False, IGN_Belgium: bool = False, IGN_Cartoweb: bool = False, postFlood2021: bool = False, Alaro: bool = False)[source]
Bases:
wolfhece.drawing_obj.Element_To_Draw
Affichage d’une image, obtenue depuis un Web service, en OpenGL via une texture
- load()[source]
Load the image texture into OpenGL, fetching it from the appropriate web service if necessary and caching it for future use.
- _update_texture_from_image(image)[source]
Update the OpenGL texture with a new image (used for progressive tile updates).
- class wolfhece.wolf_texture.Text_Image_Texture(text: str, mapviewer, proptext: wolfhece.textpillow.Text_Infos, vector, x: float, y: float)[source]
Bases:
genericImagetexture
Affichage d’une image en OpenGL via une texture
- load(imageFile='')[source]
Load the image texture into OpenGL
- Parameters:
imageFile – Optional file path to load the image from
This method first checks if an asynchronous image has been loaded and is ready. If so, it uses that image. Otherwise, it proceeds with synchronous loading.
- update_image(newtext: str = '', proptext: wolfhece.textpillow.Text_Infos = None)[source]