ISampleBuffer
Description
- Derived from
- Extended by
-
ISampleBufferGeneric
SampleBufferBase abstract
Base interface for classes that represent sample buffers which can transfer per-scanline data to and from pixel images.
Public / Methods
Clone
Clones the sample buffer.
The original and cloned buffers will share the buffer samples. Use this method if you need a separate buffer instance (e.g. for configuring buffer-specific properties while keeping the original buffer unmodified).
Downsample
Performs downsampling on the values of this sample buffer.
Each block of 2x2 input samples is downsampled to a single output sample.
+---+---+ | a | b | +---+ +---+---+ => | x | | c | d | +---+ +---+---+
If this color buffer has a width and/or height that is not divisible by two, the right and/or bottom border samples will be duplicated or clipped (see ceiling opt parameter) in order to get a full input sample block for downsampling. If the output opt buffer is too small, overhang samples will be discarded. The input and output buffers can be the same.
FixSamples
Fixes the samples in the given range.
This method can be called after modifying samples in the buffer. Subclasses may perform additional value fixing. For example, clamping values or normalizing vectors to unit-length. The following built-in methods call this method automatically:
IsCompatible
Checks whether the given other in sample buffer is compatible with this one.
Two sample buffers are compatible if they have the same sample data type, interpretation and tuple size.
Pack
Returns a densely packed sample buffer object that contains the same data as this buffer.
- See also
PadEdges
Resizes this sample buffer to the given size by duplicating the right and bottom edges.
- See also
SubBuffer
Represents a ISampleBuffer object that represents a rectangular subregion of this sample buffer.
Modifications made to this sample buffer will be visible to the returned buffer and vice versa.
Public / Attributes
ScanlineRange
The PixelRange of this buffer, where raw pixels values correspond to the buffer samples.
Extensions
ReadFromImage
Replaces the values in this sample buffer with the pixels read from the given source image.
Both IImageInfo.Width and IImageInfo.Height of image in must be equal to the width and height of this ISampleBuffer object.
- IOException
-
If an I/O error has occurred while reading the image pixels.
WriteImage
Writes the pixel data in this buffer to the given file.
This method calls IImageOps.WriteImage on the given imageFormat opt, where the ReadAsImage method is used to read pixel data from this buffer.
- IOException
-
If an I/O error has occurred while writing to file in.
- See also