SampleBuffer
Description
- Derived from
- Extended by
-
SampleBufferFloat32 abstract
SampleBufferInt32 abstract
SampleBufferInt64 abstract
Abstract base class for ISampleBuffer implementations.
Public / Attributes
Samples
The samples of this buffer.
The buffer stores ISampleBuffer.TupleSize values per sample in row-major order.
The returned array can be indexed as follows:
Samples[Offset + y * Stride + x * TupleSize + 0] := 1st value of sample at (x,y). Samples[Offset + y * Stride + x * TupleSize + 1] := 2nd value of sample at (x,y). ... Samples[Offset + y * Stride + x * TupleSize + TupleSize - 1] := last value of sample.
where x
and y
are the coordinates of the sample to access.
Protected / Constructors
SampleBuffer
2 overloads
Creates a new instance of SampleBuffer.
A new sample buffer array will be allocated.
Creates a new instance of SampleBuffer.
This sample buffer will use the given data array.
Protected / Methods
EqualsInternal
2 overloads
Compares array elements in source in with those in target in for equality.
Compares array elements in source in with the given value in for equality.
Interpolate4
Interpolates a sample value from the given sample block.
Interpolation occurs between b in, c in:
+---+---+---+---+ | a | b | c | d | +---+---+---+---+
The interpolation factors are mapped as follows:
-
f = 0
=> b in -
f = 65536
=> c in
Interpolate4x4
Interpolates a sample value from the given sample block.
Interpolation occurs between f
, g
, j
and k
:
+---+---+---+---+ | a | b | c | d | +---+---+---+---+ | e | f | g | h | +---+---+---+---+ | i | j | k | l | +---+---+---+---+ | m | n | o | p | +---+---+---+---+
The interpolation factors are mapped as follows:
-
(fx = 0, fy = 0)
=>f
-
(fx = 65536, fy = 0)
=>g
-
(fx = 0, fy = 65536)
=>j
-
(fx = 65536, fy = 65536)
=>k
ScaleOffsetClamp
Applies the given offset and scale to all samples in this buffer.
This method is intended to be called by implementations of ISampleBuffer.ScaleOffset.
WarpFix
Fixes the samples in the given range.
This method is called after samples have been computed in the given range by the Warp method. Subclasses may override this method in order to perform additional post-processing, for example clamping values or normalizing vectors to unit-length.
- See also