Open dietzc opened 9 years ago
@dietzc I don't really understand the question. What would T
be? The returned RandomAccessible<T>
would have pixel values that are related to the IterableRegion
how? I mean: assume I access position x in the returned RA. The source RA has value t
, the (iterable) region is false
at that position, what do I get?
T
can be arbitrary. You would get something defined by the OutOfBoundsStrategy<T>
, which can be the t
defined in the RandomAccessible<T>
at the position you access (which is false
for the (iterable) region) or something else (e.g. a constant value or some kind of mirroring). Of course one could achieve this by always checking if the (iterable) region I access is false
or not at a given position and then return a constant value or the value of the RandomAccessible<T>
. In the end the suggested method would just be a convenience method.
@dietzc Ok, now I get it. Sounds like a good idea. Do you have any use-cases in mind?
@dietzc Maybe I would name it differently though. We cannot use all of the existing OutOfBoundsStrategies, I think only Constant would make sense.
ConstantValue is the only use-case I can currently think of. Mirror etc is tricky, because we of course of irregular shapes.
Hi @tpietzsch,
would it make sense to offer a method in
Regions
which one can pass anIterableRegion
,RandomAccessible<T>
and anOutOfBoundsStrategy<T>
and which returns aRandomAccessible<T>
which returns the values of the passedRandomAccessible<T>
on positions defined by theIterableRegion
and values from theOutOfBoundsStrategy<T>
on positions which lie outside theIterableRegion<T>
?