Commit Graph

16 Commits

Author SHA1 Message Date
Manuel Castilla
5f28a90b34 Compositor: Add coordinates to BuffersIterator
Allows to cover many use cases where iterating both buffers and
coordinates is needed.
2021-07-22 18:05:55 +02:00
Manuel Castilla
45b46e5de9 Compositor: Buffer iterators
Currently we mostly iterate buffer areas using x/y loops or through
utility methods extending from base classes.

To simplify code in simple operations this commit adds wrappers for
specifying buffer areas and their iterators for raw buffers with any
element stride:
- BufferRange: Specifies a range of contiguous buffer elements from a
 given element index.
- BufferRangeIterator: Iterates elements in a BufferRange.
- BufferArea: Specifies a rectangle area of elements in a 2D buffer.
- BufferAreaIterator: Iterates elements in a BufferArea.
- BuffersIterator: Simultaneously iterates an area of elements in an
 output buffer and any number of input buffers.
- BuffersIteratorBuilder: Helper for building BuffersIterator adding
 buffers one by one.
For iterating areas coordinates it adds `XRange` and `YRange` methods
that return `IndexRange`.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11882
2021-07-19 20:06:21 +02:00
Manuel Castilla
cf17f7e0cc Fix T89671: Crash when using Denoise node on Full Frame mode
Tiled fallback doesn't support single element buffers.
Ensure tiles are initialized as full buffers.
2021-07-05 23:36:43 +02:00
Manuel Castilla
35db01325f Compositor: Full frame Image node
Adds full frame implementation to Image node operations.
Mostly refactored into buffer utility methods for reuse in other
operations.
No functional changes.
1.8x faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11559
2021-06-23 17:46:53 +02:00
Manuel Castilla
f966f6ed55 Compositor: Add vars and methods for easier image looping
These variables and methods should make it easier to loop through buffers elements/pixels. They take into account single element buffers.
Single element buffers can be used for set operations to reduce memory usage.

Usage example: P2078

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D11015
2021-05-10 11:16:06 +02:00
Jeroen Bakker
094c950915 Cleanup: clang-format. 2021-03-30 16:03:43 +02:00
Jeroen Bakker
88e0ed3288 Cleanup: Use constexpr. 2021-03-30 16:03:43 +02:00
Jeroen Bakker
25c02ea703 Cleanup: Add namespace to compositor. 2021-03-29 08:18:33 +02:00
Jeroen Bakker
9f86933f2e Cleanup: Remove unused states and vars from MemoryBuffer. 2021-03-19 17:11:47 +01:00
Jeroen Bakker
31d5c5078c Cleanup: MemoryBuffer do not store width and height. 2021-03-19 17:11:47 +01:00
Jeroen Bakker
8cb1089795 Cleanup: Rename copyContentFrom to fill_from. 2021-03-19 17:11:47 +01:00
Jeroen Bakker
dc9aea9903 Cleanup: Add copy constructor to MemoryBuffer. 2021-03-19 17:11:47 +01:00
Jeroen Bakker
260e50ed82 Cleanup: Use ref to read from encapsuled data.
MemoryBuffer->getRect was returning a ptr.
2021-03-19 17:11:47 +01:00
Jeroen Bakker
c905dd24b6 Cleanup: Replace ptr with ref (COM_MemoryBuffer). 2021-03-19 17:11:47 +01:00
Jeroen Bakker
e5ffefe606 Cleanup: Use enum class for DataType. 2021-03-19 17:11:47 +01:00
Jeroen Bakker
1775ea74c1 Cleanup: Change extension .cpp to .cc 2021-03-08 13:41:52 +01:00