lavavu 1.8.76__cp311-cp311-win_amd64.whl → 1.8.79__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
lavavu/html/webview.html CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  <input id="fileinput" type="file" style="visibility:hidden" onchange="useFileInput(this)" />
29
29
 
30
- <script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.76/LavaVu-amalgamated.min.js"></script>
30
+ <script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.79/LavaVu-amalgamated.min.js"></script>
31
31
  <!--script src="dat.gui.min.js"></script>
32
32
  <script src="OK-min.js"></script>
33
33
 
lavavu/lavavu.py CHANGED
@@ -2319,29 +2319,29 @@ class _LavaVuWrapper(LavaVuPython.LavaVu):
2319
2319
  if _LavaVuWrapper._ctx:
2320
2320
  self.ctx = _LavaVuWrapper._ctx
2321
2321
  else:
2322
- self.ctx = moderngl.create_standalone_context(require=330)
2322
+ import platform
2323
+ if platform.system() == 'Linux':
2324
+ self.ctx = moderngl.create_context(standalone=True, require=330, backend='egl')
2325
+ else:
2326
+ self.ctx = moderngl.create_standalone_context(require=330)
2327
+ #print(self.ctx.info)
2323
2328
  _LavaVuWrapper._ctx = self.ctx
2324
2329
 
2325
2330
  if self.use_moderngl_window and self.ctx:
2326
2331
  # Activate the context
2327
2332
  moderngl_window.activate_context(ctx=self.ctx)
2328
- if self.use_moderngl_window == 'window':
2329
- # Configure with default window class / settings
2330
- from moderngl_window.conf import settings
2331
- settings.WINDOW['gl_version'] = (3, 3)
2332
- settings.WINDOW['samples'] = 4
2333
- if self.resolution:
2334
- settings.WINDOW['size'] = self.resolution
2335
- # Creates the window instance and activates its context
2336
- self.wnd = moderngl_window.create_window_from_settings()
2337
- else:
2338
- # Configure to use provided window class
2339
- window_str = 'moderngl_window.context.' + self.use_moderngl_window + '.Window'
2340
- window_cls = moderngl_window.get_window_cls(window_str)
2341
- if self.resolution:
2342
- self.wnd = window_cls(title="LavaVu", gl_version=(3, 3), samples=4, vsync=True, cursor=True, size=self.resolution)
2343
- else:
2344
- self.wnd = window_cls(title="LavaVu", gl_version=(3, 3), samples=4, vsync=True, cursor=True)
2333
+
2334
+ # Configure with default window class / settings
2335
+ from moderngl_window.conf import settings
2336
+ settings.WINDOW['gl_version'] = (3, 3)
2337
+ if self.use_moderngl_window != 'window':
2338
+ #Use specified class
2339
+ settings.WINDOW['class'] = f'moderngl_window.context.{self.use_moderngl_window}.Window'
2340
+ settings.WINDOW['samples'] = 4
2341
+ if self.resolution:
2342
+ settings.WINDOW['size'] = self.resolution
2343
+ # Creates the window instance and activates its context
2344
+ self.wnd = moderngl_window.create_window_from_settings()
2345
2345
 
2346
2346
  # register event methods
2347
2347
  self.wnd.resize_func = self.resized
@@ -3695,6 +3695,56 @@ class Viewer(dict):
3695
3695
  else:
3696
3696
  return c.tolist()
3697
3697
 
3698
+ def texture(self, label, data=None, flip=True, filter=2, bgr=False):
3699
+ """
3700
+ Load or clear global/shared texture data
3701
+
3702
+ Parameters
3703
+ ----------
3704
+ label : string
3705
+ Label to load a custom texture by name of uniform used
3706
+ Will attempt to find the texture by this label and replace its data
3707
+ data : list or array or string
3708
+ (If data is not provided, the object's texture data will be cleared)
3709
+ Pass a list or numpy uint32 or uint8 array
3710
+ texture data is loaded as raw image data
3711
+ shape of array must be 2d or 3d,
3712
+ either (height, width, channels) for RGB(A) image
3713
+ or (height, width) for single channel grayscale image
3714
+ Pass a string to load a texture from given filename
3715
+ flip : boolean
3716
+ flip the texture vertically after loading
3717
+ (default is enabled as usually required for OpenGL but can be disabled)
3718
+ filter : int
3719
+ type of filtering, 0=None/nearest, 1=linear, 2=mipmap linear
3720
+ bgr : boolean
3721
+ rgb data is in BGR/BGRA format instead of RGB/RGBA
3722
+ """
3723
+ if data is None:
3724
+ #Clear texture
3725
+ self.app.clearTexture(None, label)
3726
+ return
3727
+ if isinstance(data, str):
3728
+ self.app.setTexture(None, data, flip, filter, bgr, label)
3729
+ return
3730
+
3731
+ data = _convert(data)
3732
+ if len(data.shape) < 2:
3733
+ raise ValueError(data.shape + " : Must pass a 2D or 3D data set")
3734
+ if len(data.shape) < 3:
3735
+ height, width = data.shape
3736
+ channels = 1
3737
+ else:
3738
+ height, width, channels = data.shape
3739
+
3740
+ #Convert floating point data
3741
+ if data.dtype == numpy.float32:
3742
+ data = _convert(data, numpy.uint8)
3743
+ if data.dtype == numpy.uint32:
3744
+ self.app.textureUInt(None, data.ravel(), width, height, channels, flip, filter, bgr, label)
3745
+ elif data.dtype == numpy.uint8:
3746
+ self.app.textureUChar(None, data.ravel(), width, height, channels, flip, filter, bgr, label)
3747
+
3698
3748
  def clear(self, objects=True, colourmaps=True):
3699
3749
  """
3700
3750
  Clears all data from the visualisation
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lavavu
3
- Version: 1.8.76
3
+ Version: 1.8.79
4
4
  Summary: Python interface to LavaVu OpenGL 3D scientific visualisation utilities
5
5
  Author-email: Owen Kaluza <owen@kaluza.id.au>
6
6
  License: ### Licensing
@@ -221,7 +221,7 @@ Requires-Dist: jupyter-server-proxy
221
221
  [![Build Status](https://github.com/lavavu/LavaVu/workflows/Test/badge.svg)](https://github.com/lavavu/LavaVu/actions?query=workflow:Test)
222
222
  [![Deploy Status](https://github.com/lavavu/LavaVu/workflows/Deploy/badge.svg?branch=1.7.3)](https://github.com/lavavu/LavaVu/actions?query=workflow:Deploy)
223
223
  [![DOI](https://zenodo.org/badge/45163055.svg)](https://zenodo.org/badge/latestdoi/45163055)
224
- [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.76)
224
+ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.79)
225
225
 
226
226
  A scientific visualisation tool with a python interface for fast and flexible visual analysis.
227
227
 
@@ -1,5 +1,5 @@
1
1
  lavavu/LavaVuPython.py,sha256=fM1Xo8N4RGzWPdCkJy3rvjHECge4Vw5h8QZLCU31ep4,33691
2
- lavavu/_LavaVuPython.cp311-win_amd64.pyd,sha256=VMDgd803xTP5vQoi4tEeeYfDu-2vPQWyGG2gE8tilLo,3111424
2
+ lavavu/_LavaVuPython.cp311-win_amd64.pyd,sha256=gK2mgx6-2YntZmGmKJ992RcwR5QD8sU7A2G0sLC1P_w,3116544
3
3
  lavavu/__init__.py,sha256=ZOkoA9N5M5swxkeLDlrc9NGFQ1PggLWW4GheseTtq8I,206
4
4
  lavavu/__main__.py,sha256=9L7Rfhb_U9Oqkop7MVJ4fi9XUnx4t2vpajOMKNNVunc,247
5
5
  lavavu/amalgamate.py,sha256=goS8OLot2q400zRMMRoksYkaNyBgRJlrpU1UxSKwLmA,601
@@ -14,7 +14,7 @@ lavavu/convert.py,sha256=3F79LHdsi74pvewvDuvnlYR_Zsh5mCc1QI7XZnQSMN8,36404
14
14
  lavavu/dict.json,sha256=6WjVWKKKfF5ieZK2AfWldrl4c7BCo8tEgigJR5CpCqQ,55239
15
15
  lavavu/font.bin,sha256=fvi5zkvmq6gh9v3jXedBVuxNJWKmHtbjECzv6eT9wb4,225360
16
16
  lavavu/glfw3.dll,sha256=zI-Qy4RDHQo4mYYgW4QLREz-WZ5l5HCXJzyksyTy0bY,83456
17
- lavavu/lavavu.py,sha256=U-cz-UJxMYHJA7-xkJwNIQz5iroRe6I4dqA-OeQcK7g,211403
17
+ lavavu/lavavu.py,sha256=-jnCO6HDx7PMIfy0yBwwbZCWDp3oeVdNUpdTQFEaJVE,213371
18
18
  lavavu/liblzma.dll,sha256=_n95XbzYpeaXq6wB884fmpf8nqs2Ot9gyxUL_CS2TCI,154624
19
19
  lavavu/points.py,sha256=bp5XFMUHShjeRW7XUNgq8uxj3wjk4EE-qnWEJjAn-uM,6062
20
20
  lavavu/postproc-55.dll,sha256=DwfCHwxbuZiEzRcfbh5aa-5Ax3xIsWkxEN0achBvJPU,133120
@@ -46,7 +46,7 @@ lavavu/html/server.js,sha256=WXuAnY6aE4h8vYs4U2sl4Xq5RjrkuDi-mIgM-x3Nkj0,7325
46
46
  lavavu/html/stats.min.js,sha256=q9kZjkwmWu8F8HV-4m2EfZRJXQBzyibceJoz-tDgB94,1970
47
47
  lavavu/html/styles.css,sha256=8JE8l7zcc0PV8CfOQpfDyhM226-Sq9eDLXvTCe-wSgw,3041
48
48
  lavavu/html/webview-template.html,sha256=E5w7pd91z0WL3244PQxDKMNZorWzoRT5G7wuBHXJc6Y,1573
49
- lavavu/html/webview.html,sha256=4mKjKToZMhjneCJyVJ57ViSayk_pglb85smcZMp2oLE,1565
49
+ lavavu/html/webview.html,sha256=w4C77Jr0rq4vnugNAdEol8i1i6echtei4cbsBWzIYz8,1565
50
50
  lavavu/shaders/default.frag,sha256=AlGMo01JdaOsXx6Gq7s1WADi2b-vyX9XMSB91AcJvuA,278
51
51
  lavavu/shaders/default.vert,sha256=SKC2BkE2axNjJL2j5QYjU2bj6mMXs8Wq02XgMTiOeFo,334
52
52
  lavavu/shaders/fontShader.frag,sha256=0GGFFg6S4v0p_1gDTIATDmc19jrCl7xIgH9PpxcXEcE,469
@@ -59,9 +59,9 @@ lavavu/shaders/triShader.frag,sha256=eVGp_ttGMVgKnDYRwByvx_PN80EYiSz61jeuAD8JJvw
59
59
  lavavu/shaders/triShader.vert,sha256=tzgJjqbhKDgVngUJvMVL1ehYvwxAMFLQ-WtKEYU3in0,1175
60
60
  lavavu/shaders/volumeShader.frag,sha256=PLTei6fN_uLxPD35LHbBQVe_S7TanxdBqcW5khslQMI,16583
61
61
  lavavu/shaders/volumeShader.vert,sha256=CroiEfEIe7pP66w14KwmKxfbTuKN6EuXYbZJvt_bfHk,83
62
- lavavu-1.8.76.dist-info/LICENSE.md,sha256=zHOh_qOPkfR76vdrTRP7J-BqPieAIWVDTl2ZP0SN6lQ,8782
63
- lavavu-1.8.76.dist-info/METADATA,sha256=auIzfJ0-5C-LJYC06IywxU70e61vm4NOZYRjrne29Fw,18555
64
- lavavu-1.8.76.dist-info/WHEEL,sha256=yNCBXpt7EYM4XWkQWwdIjv6aROYfg72vYtkZaa0M7Y4,101
65
- lavavu-1.8.76.dist-info/entry_points.txt,sha256=LC2qXR6EMe45Cb7zGAF99R9HFrAECP6Qkp_YuG6HZB0,44
66
- lavavu-1.8.76.dist-info/top_level.txt,sha256=JptS0k1nlBumjLs_0hITr3_XUJhxqvKBXD2jGho3E3A,7
67
- lavavu-1.8.76.dist-info/RECORD,,
62
+ lavavu-1.8.79.dist-info/LICENSE.md,sha256=zHOh_qOPkfR76vdrTRP7J-BqPieAIWVDTl2ZP0SN6lQ,8782
63
+ lavavu-1.8.79.dist-info/METADATA,sha256=bHU40XkfV2_g2GpMFX1-ruODskLB6kUQBoGNOMyw2kI,18555
64
+ lavavu-1.8.79.dist-info/WHEEL,sha256=qW4RD1rfHm8ZRUjJbXUnZHDNPCXHt6Rq0mgR8lv_JEg,101
65
+ lavavu-1.8.79.dist-info/entry_points.txt,sha256=LC2qXR6EMe45Cb7zGAF99R9HFrAECP6Qkp_YuG6HZB0,44
66
+ lavavu-1.8.79.dist-info/top_level.txt,sha256=JptS0k1nlBumjLs_0hITr3_XUJhxqvKBXD2jGho3E3A,7
67
+ lavavu-1.8.79.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-win_amd64
5
5