wolfhece.wolf_texture ===================== .. py:module:: wolfhece.wolf_texture .. autoapi-nested-parse:: 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 --------------- .. py:data:: msg .. py:class:: 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]) Bases: :py:obj:`wolfhece.drawing_obj.Element_To_Draw` .. autoapi-inheritance-diagram:: wolfhece.wolf_texture.genericImagetexture :parts: 1 :private-bases: Affichage d'une image en OpenGL via une texture .. py:attribute:: name :type: str .. py:attribute:: idtexture :type: int .. py:attribute:: width :type: int .. py:attribute:: height :type: int .. py:attribute:: which :type: str .. py:attribute:: myImage :type: PIL.Image .. py:attribute:: time :value: None .. py:attribute:: xmin .. py:attribute:: xmax .. py:attribute:: ymin .. py:attribute:: ymax .. py:attribute:: idx .. py:attribute:: imageFile :value: '' .. py:attribute:: drawing_scale :value: 1.0 .. py:attribute:: offset :value: [0.0, 0.0] .. py:attribute:: oldview .. py:method:: unload() Unload the texture from memory .. py:method:: load(imageFile='') Load the image texture into OpenGL :param imageFile: Optional file path to load the image from .. py:method:: update_minmax() Update the spatial extent of the texture based on its size .. py:method:: reload(xmin=-99999, xmax=-99999, ymin=-99999, ymax=-99999) .. py:method:: plot(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None) alias for paint .. py:method:: find_minmax(update=False) Generic function to find min and max spatial extent in data .. py:method:: uv(x: float, y: float) -> tuple[float, float] Convert coordinates to texture coordinates taking into account the texture's spatial extent, the scaleing factor, and the offset. :param x: X coordinate in pixels :param y: Y coordinate in pixels :return: Tuple of (u, v) texture coordinates .. py:method:: paint() Paint the image texture on the OpenGL canvas .. py:class:: 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) Bases: :py:obj:`wolfhece.drawing_obj.Element_To_Draw` .. autoapi-inheritance-diagram:: wolfhece.wolf_texture.imagetexture :parts: 1 :private-bases: Affichage d'une image, obtenue depuis un Web service, en OpenGL via une texture .. py:attribute:: name :type: str .. py:attribute:: idtexture :type: int .. py:attribute:: width :type: int .. py:attribute:: height :type: int .. py:attribute:: which :type: str .. py:attribute:: category :type: str .. py:attribute:: subcategory :type: str .. py:attribute:: France :type: bool .. py:attribute:: epsg :type: str .. py:attribute:: Vlaanderen :value: False .. py:attribute:: LifeWatch :value: False .. py:attribute:: IGN_Belgium :value: False .. py:attribute:: IGN_Cartoweb :value: False .. py:attribute:: postFlood2021 :value: False .. py:attribute:: Alaro :value: False .. py:attribute:: xmin .. py:attribute:: xmax .. py:attribute:: ymin .. py:attribute:: ymax .. py:attribute:: idx .. py:attribute:: time :value: None .. py:attribute:: alpha :value: 1.0 .. py:attribute:: force_alpha :value: False .. py:attribute:: oldview .. py:method:: load() .. py:method:: reload() .. py:method:: plot(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None) alias for paint .. py:method:: find_minmax(update=False) Generic function to find min and max spatial extent in data .. py:method:: paint() .. py:method:: check_plot() Generic function responding to check operation from mapviewer .. py:method:: uncheck_plot(unload=True) Generic function responding to uncheck operation from mapviewer .. py:class:: Text_Image_Texture(text: str, mapviewer, proptext: wolfhece.textpillow.Text_Infos, vector, x: float, y: float) Bases: :py:obj:`genericImagetexture` .. autoapi-inheritance-diagram:: wolfhece.wolf_texture.Text_Image_Texture :parts: 1 :private-bases: Affichage d'une image en OpenGL via une texture .. py:attribute:: x .. py:attribute:: y .. py:attribute:: vector .. py:attribute:: proptext .. py:attribute:: mapviewer .. py:attribute:: oldview .. py:method:: findscale() .. py:method:: load(imageFile='') Load the image texture into OpenGL :param imageFile: Optional file path to load the image from .. py:method:: paint() Paint the image texture on the OpenGL canvas .. py:method:: update_image(newtext: str = '', proptext: wolfhece.textpillow.Text_Infos = None)