Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
84e6590
remove isolated_buffer
kushalkolar Jan 13, 2026
7163c96
remove isolated_buffer from mixin
kushalkolar Jan 13, 2026
426ee5c
basics works for positions data
kushalkolar Jan 13, 2026
23622b0
replaceable buffers for all positions related features
kushalkolar Jan 13, 2026
e19588a
image data buffer can change
kushalkolar Jan 13, 2026
d9f5ca9
resizeable buffers for volume
kushalkolar Jan 13, 2026
ea0d791
black
kushalkolar Jan 13, 2026
734be0e
buffer resize condition checked only if new value is an array
kushalkolar Jan 13, 2026
7974436
gc for buffer managers
kushalkolar Jan 13, 2026
fe749ce
uniform colors WIP
kushalkolar Jan 14, 2026
e667a9d
Merge branch 'main' into replaceable-buffers
kushalkolar Feb 2, 2026
b8f8613
switching color modes works!
kushalkolar Feb 2, 2026
543d4e9
typo
kushalkolar Feb 2, 2026
8a1c15a
balck
kushalkolar Feb 2, 2026
fdeecb1
update tests for color_mode
kushalkolar Feb 2, 2026
6299cdd
update examples
kushalkolar Feb 2, 2026
8b217cc
backend tests passing
kushalkolar Feb 2, 2026
5fd68e2
default for all uniforms is True
kushalkolar Feb 2, 2026
e1d40ba
update examples
kushalkolar Feb 2, 2026
096a51c
forgot
kushalkolar Feb 2, 2026
274d449
update test
kushalkolar Feb 2, 2026
8d776d4
example tests passing
kushalkolar Feb 2, 2026
fce7087
dereferencing test and fixes
kushalkolar Feb 3, 2026
44fdbb9
simplify texture array tests a bit
kushalkolar Feb 3, 2026
d090dca
image replace buffer tests pass yay
kushalkolar Feb 3, 2026
d6754d0
forgot a file
kushalkolar Feb 4, 2026
83b924e
comments, check image graphic
kushalkolar Feb 4, 2026
2237d51
add image reshaping example
kushalkolar Feb 4, 2026
630435e
add buffer replace imgui thing for manual testing
kushalkolar Feb 4, 2026
a87dfdf
black
kushalkolar Feb 4, 2026
30e87ad
dont call wgpu_obj.destroy(), seems to work and clear VRAM with norma…
kushalkolar Feb 4, 2026
6228d6c
slower changes
kushalkolar Feb 4, 2026
e207d5b
update
kushalkolar Feb 4, 2026
5c894c3
update example
kushalkolar Feb 4, 2026
7452fa8
fixes and tweaks for test
kushalkolar Feb 4, 2026
16c979d
remove unecessary stuff
kushalkolar Feb 4, 2026
68be2e0
update
kushalkolar Feb 4, 2026
cb85ac1
Merge branch 'main' into replaceable-buffers
kushalkolar Feb 4, 2026
500426d
docstrings
kushalkolar Feb 4, 2026
dd7a829
fix example
kushalkolar Feb 4, 2026
da54a9c
update example
kushalkolar Feb 4, 2026
eb7fbae
update example
kushalkolar Feb 4, 2026
2e8726f
update docs
kushalkolar Feb 4, 2026
fd87cae
Merge branch 'main' into replaceable-buffers
kushalkolar Feb 4, 2026
bf3041a
Merge branch 'ndwidget' into replaceable-buffers
kushalkolar Feb 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resizeable buffers for volume
  • Loading branch information
kushalkolar committed Jan 13, 2026
commit d9f5ca9c35df287f6f7ad9ff569af3d4210db457
8 changes: 5 additions & 3 deletions fastplotlib/graphics/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ def __init__(
)

# create the _ImageTile world objects, add to group
for tile in self._create_image_tiles():
for tile in self._create_tiles():
group.add(tile)

self._set_world_object(group)

def _create_image_tiles(self) -> list[_ImageTile]:
def _create_tiles(self) -> list[_ImageTile]:
tiles = list()
# iterate through each texture chunk and create
# an _ImageTile, offset the tile using the data indices
Expand Down Expand Up @@ -235,9 +235,11 @@ def data(self, data):
self.world_object.clear()

# create new tiles
for tile in self._create_image_tiles():
for tile in self._create_tiles():
self.world_object.add(tile)

return

self._data[:] = data

@property
Expand Down
29 changes: 26 additions & 3 deletions fastplotlib/graphics/image_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __init__(

super().__init__(**kwargs)

world_object = pygfx.Group()
group = pygfx.Group()

if isinstance(data, TextureArrayVolume):
# share existing buffer
Expand Down Expand Up @@ -231,6 +231,15 @@ def __init__(

self._mode = VolumeRenderMode(mode)

# create tiles
for tile in self._create_tiles():
group.add(tile)

self._set_world_object(group)

def _create_tiles(self) -> list[_VolumeTile]:
tiles = list()

# iterate through each texture chunk and create
# a _VolumeTile, offset the tile using the data indices
for texture, chunk_index, data_slice in self._data:
Expand All @@ -253,9 +262,9 @@ def __init__(
vol.world.x = data_col_start
vol.world.y = data_row_start

world_object.add(vol)
tiles.append(vol)

self._set_world_object(world_object)
return tiles

@property
def data(self) -> TextureArrayVolume:
Expand All @@ -264,6 +273,20 @@ def data(self) -> TextureArrayVolume:

@data.setter
def data(self, data):
# check if a new buffer is required
if self._data.value.shape != data.shape:
# create new TextureArray
self._data = TextureArrayVolume(data)

# clear image tiles
self.world_object.clear()

# create new tiles
for tile in self._create_tiles():
self.world_object.add(tile)

return

self._data[:] = data

@property
Expand Down