Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

better buffer handling #150

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

Merged
merged 1 commit into from
Mar 9, 2023
Merged

better buffer handling #150

merged 1 commit into from
Mar 9, 2023

Conversation

kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Mar 9, 2023

partially addresses #147

  • all feature buffers are now public
  • ImageGraphic and HeatmapGraphic allow setting the input array buffer directly as the texture data buffer if isolated_buffer=False. The default is True, so by default the texture data buffer is a new array that is initialized using the shape and type of the input array, and then the isolated texture data buffer is set using the input data array values.

allows this type of behavior:
image

# initialize a buffer with the same shape as the input data
# we do not directly use the input data array as the buffer
# because if the input array is a read-only type, such as
# numpy memmaps, we would not be able to change the image data
Copy link
Member

@clewis7 clewis7 Mar 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, the point of having the option for using an isolated buffer is to be able to change data in the event that the type of the data is read only? will this occur when using improv?


if (vmin is None) or (vmax is None):
vmin, vmax = quick_min_max(data)

texture_view = pygfx.Texture(self.data(), dim=2).get_view(filter=filter)
texture_view = pygfx.Texture(buffer_init, dim=2).get_view(filter=filter)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before, Texture and Geometry were all under the hood correct?

@kushalkolar kushalkolar deleted the better-buffer-handling branch May 23, 2023 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.