Patches to Bf Blender for CAD development. https://tornavis.org/
Go to file
Aras Pranckevicius 5ed2eea0f6 ImBuf: Refactor pixel interpolation functions
There exist a bunch of "give me a (filtered) image pixel at this location"
functions, some with duplicated functionality, some with almost the same but
not quite, some that look similar but behave slightly differently, etc.
Some of them were in BLI, some were in ImBuf.

This commit tries to improve the situation by:
* Adding low level interpolation functions to `BLI_math_interp.hh`
  - With documentation on their behavior,
  - And with more unit tests.
* At `ImBuf` level, there are only convenience inline wrappers to the above BLI
  functions (split off into a separate header `IMB_interp.hh`). However, since
  these wrappers are inline,   some things get a tiny bit faster as a side
  effect. E.g. VSE image strip, scaling to 4K resolution (Windows/Ryzen5950X):
  - Nearest filter: 2.33 -> 1.94ms
  - Bilinear filter: 5.83 -> 5.69ms
  - Subsampled3x3 filter: 28.6 -> 22.4ms

Details on the functions:
- All of them have `_byte` and `_fl` suffixes.
- They exist in 4-channel byte (uchar4) and float (float4), as well as
  explicitly passed amount of channels for other float images.
- New functions in BLI `blender::math` namespace:
  - `interpolate_nearest`
  - `interpolate_bilinear`
  - `interpolate_bilinear_wrap`. Note that unlike previous "wrap" function,
    this one no longer requires the caller to do their own wrapping.
  - `interpolate_cubic_bspline`. Previous similar function was called just
    "bicubic" which could mean many different things.
- Same functions exist in `IMB_interp.hh`, they are just convenience that takes
  ImBuf and uses data pointer, width, height from that.

Other bits:
- Renamed `mod_f_positive` to `floored_fmod` (better matches `safe_floored_modf`
  and `floored_modulo` that exist elsewhere), made it branchless and added more
  unit tests.
- `interpolate_bilinear_wrap_fl` no longer clamps result to 0..1 range. Instead,
  moved the clamp to be outside of the call in `paint_image_proj.cc` and
  `paint_utils.cc`. Though the need for clamping in there is also questionable.

Pull Request: https://projects.blender.org/blender/blender/pulls/117387
2024-01-25 11:45:24 +01:00
.gitea Docs: Replace most wiki links with links to new developer docs 2024-01-18 16:49:38 +01:00
.github Docs: Replace most wiki links with links to new developer docs 2024-01-18 16:49:38 +01:00
build_files Render Tests: Separate difference of Color and Alpha 2024-01-25 10:04:16 +01:00
doc Cleanup: move bl_description to doc-strings 2024-01-23 13:59:15 +11:00
extern Audaspace: faster audio resampling 2024-01-03 21:23:24 +01:00
intern Cleanup: Cycles: use one fewer object struct member for motion data 2024-01-24 20:17:13 +01:00
locale I18N: Updated UI translations from git/weblate repo (fe7935fc8ede674). 2024-01-22 12:36:51 +01:00
release Cleanup: include release/datafiles/ to "make check_mypy" 2024-01-25 10:06:29 +11:00
scripts Extensions: use the TOML manifest as a source for extensions `bl_info` 2024-01-25 14:36:20 +11:00
source ImBuf: Refactor pixel interpolation functions 2024-01-25 11:45:24 +01:00
tests Render Tests: Separate difference of Color and Alpha 2024-01-25 10:04:16 +01:00
tools Cleanup: include release/datafiles/ to "make check_mypy" 2024-01-25 10:06:29 +11:00
.clang-format clang-format: set BraceWrapping::AfterControlStatement to "MultiLine" 2023-05-02 09:37:08 +10:00
.clang-tidy Clang-tidy: Ignore variable name length and .c/.cc include warnings 2022-05-06 15:26:54 +02:00
.editorconfig editorconfig: add HTML entry 2023-12-08 13:28:13 +11:00
.git-blame-ignore-revs Cleanup: add commit to .git-blame-ignore-revs 2023-05-03 20:31:11 +10:00
.gitignore Ignore build files for VS and VS Code 2023-03-07 17:38:34 +01:00
AUTHORS AUTHORS: correct canonical authors map 2024-01-16 17:30:38 +11:00
CMakeLists.txt CMake: always mark CMAKE_BUILD_TYPE_INIT as advanced 2024-01-23 20:40:00 +11:00
COPYING
GNUmakefile Build: improve make icons detection of Inkscape and Blender on macOS 2024-01-24 18:55:54 +01:00
README.md Docs: Replace most wiki links with links to new developer docs 2024-01-18 16:49:38 +01:00
make.bat Windows: Propagate errors in make.bat 2023-08-16 19:29:47 +02:00
pyproject.toml Black: skip string normalisation 2024-01-22 10:09:33 +01:00

README.md

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.