Skip to content
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

[GUI] Support images with 2 channels (RG) in GUI.set_image #1624

Merged
merged 7 commits into from
Aug 6, 2020

Conversation

archibate
Copy link
Collaborator

Related issue = #

[Click here for the format server]


This could be handy when visualizing 2D vector fields, e.g.: velocity field in stable_fluid.py.

@codecov
Copy link

codecov bot commented Aug 1, 2020

Codecov Report

Merging #1624 into master will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1624      +/-   ##
==========================================
+ Coverage   45.06%   45.07%   +0.01%     
==========================================
  Files          40       41       +1     
  Lines        5790     5766      -24     
  Branches     1012     1053      +41     
==========================================
- Hits         2609     2599      -10     
+ Misses       3032     3009      -23     
- Partials      149      158       +9     
Impacted Files Coverage Δ
python/taichi/lang/meta.py 62.31% <0.00%> (-2.39%) ⬇️
python/taichi/misc/gui.py 0.00% <0.00%> (ø)
python/taichi/lang/ast_checker.py 70.58% <0.00%> (-1.64%) ⬇️
python/taichi/lang/linalg.py 89.33% <0.00%> (-0.67%) ⬇️
python/taichi/lang/__init__.py 54.30% <0.00%> (-0.45%) ⬇️
python/taichi/misc/util.py 17.00% <0.00%> (-0.33%) ⬇️
python/taichi/main.py 23.99% <0.00%> (-0.14%) ⬇️
python/taichi/core/util.py 0.25% <0.00%> (-0.05%) ⬇️
python/taichi/testing.py 76.92% <0.00%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac4a6f5...2e837c9. Read the comment docs.

@Rullec
Copy link
Contributor

Rullec commented Aug 1, 2020

LGTM!
Only curious: Is it a good way to define a literally "2D" image by only truncate the red and green channel? I'm curious about its performance.

@archibate
Copy link
Collaborator Author

LGTM!
Only curious: Is it a good way to define a literally "2D" image by only truncate the red and green channel? I'm curious about its performance.

In fact we are always using RGBA as internal format storing in our GUI module, no matter grayscale, RG or RGB.

@archibate archibate requested a review from zhai-xiao August 3, 2020 04:34
Copy link
Contributor

@zhai-xiao zhai-xiao left a comment

Choose a reason for hiding this comment

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

Great job! Thanks, @archibate

docs/gui.rst Outdated Show resolved Hide resolved
examples/stable_fluid.py Outdated Show resolved Hide resolved
examples/stable_fluid.py Show resolved Hide resolved
archibate and others added 2 commits August 3, 2020 22:59
Co-authored-by: Xiao Zhai <7610945+TroyZhai@users.noreply.github.com>
@archibate archibate requested a review from zhai-xiao August 3, 2020 15:09
Copy link
Contributor

@zhai-xiao zhai-xiao left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks 🧀

@archibate archibate merged commit 3e9b446 into taichi-dev:master Aug 6, 2020
@yuanming-hu yuanming-hu mentioned this pull request Aug 8, 2020
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.

3 participants