Page MenuHome

Compositor: Buffer iterators
ClosedPublic

Authored by Manuel Castilla (manzanilla) on Jul 11 2021, 1:23 PM.

Details

Summary

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 patch 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.


Examples of use -> P2244

Diff Detail

Repository
rB Blender
Branch
cmp-iterators (branched from master)
Build Status
Buildable 15891
Build 15891: arc lint + arc unit

Event Timeline

Manuel Castilla (manzanilla) requested review of this revision.Jul 11 2021, 1:23 PM
Manuel Castilla (manzanilla) created this revision.
  • Take into account single elem buffers

Would be nice to add test cases that demonstrates how to use them.

This revision is now accepted and ready to land.Jul 19 2021, 11:04 AM
This revision was automatically updated to reflect the committed changes.