TexelBuffer
Description
- Derived from
-
Disposable abstract
IMemoryConsumption
IEquatable<TexelBuffer>
IBufferCodec
ITexelBufferInfo
IDisposableGeneric<TexelBuffer>
IConfigurable - Extended by
-
Example_TexelBuffer sealed
TexelBufferBitPattern abstract
TexelBuffer objects are used to generate texel data for updating textures.
- See also
Public / Constructors
FromBase85
Decodes a buffer from the given base-85 encoded TXB
file.
- IOException
-
If value in is malformed.
- See also
ReadTXB
3 overloads
Reads a texel buffer in TXB
file format from the given file.
- IOException
-
If an I/O error has occurred.
Reads a texel buffer in TXB
file format from the given data stream.
- IOException
-
If an I/O error has occurred.
Reads a texel buffer in TXB
file format from the given binary reader.
- IOException
-
If an I/O error has occurred.
Public / Methods
Convert
3 overloads
Converts this texel buffer to the given format.
Scales this texel buffer to the given dimensions, without converting the format.
Scales this texel buffer to the given dimensions while converting it to the given format.
CopyBytes
Copies texel data to the given buffer.
The given target X- and Y-coordinates must be a multiple of the texture format block size (see TextureFormat.BlockSize).
CopyTexels
Copies all samples from this buffer to the given one.
The given target X- and Y-coordinates must be a multiple of the texture format block size (see TextureFormat.BlockSize).
FromConfigEmbedded
Returns the embedded TXB
file from the given config value.
- ConfigException
-
If value in is invalid.
- IOException
-
If the embedded
TXB
data is invalid.
- See also
PixelEncode
Encodes a block of pixels into this texel buffer.
If the given color buffer is too small (see ITexelBufferInfo.Width and ITexelBufferInfo.Height), it will be padded with Colors.Zero to fill the texel buffer, using ColorBuffer.PadColor.
- See also
PixelEncodeMipmaps
Encodes the given pixels and fills all texels in all mipmap levels.
If the given pixel buffer is too small (see ITexelBufferInfo.Width and ITexelBufferInfo.Height), its right and bottom edges will be duplicated to fill the texel buffer, using ColorBuffer.PadEdges.
- See also
RawTexelsSize
Returns the size of the texel buffer.
The following figure shows the case when stride opt is smaller than RawTexelsSize, which is used when copying a part of the texel buffer:
+---+---+---+---+ bytesPerBlock = Format.BytesPerBlock | X | X | ! | ! | RawTexelsStride = 4 * bytesPerBlock +---+---+---+---+ stride = 2 * bytesPerBlock | X | X | ! | ! | blocks = 3 +---+---+---+---+ | X | X | X := texel block +---+---+ ! := skipped texel block (not read)
This figure shows the case when stride opt is greater than RawTexelsSize, which is used to copy the texel buffer contents to a larger buffer:
+---+---+---+---+ bytesPerBlock = Format.BytesPerBlock | X | X | X | . | RawTexelsStride = 3 * bytesPerBlock +---+---+---+---+ stride = 4 * bytesPerBlock | X | X | X | . | blocks = 3 +---+---+---+---+ | X | X | X | X := texel block +---+---+---+ . := skipped texel block (not written)
ReadTXBInfo
3 overloads
Reads a texel buffer metadata in TXB
file format from the given file.
- IOException
-
If an I/O error has occurred.
Reads a texel buffer metadata in TXB
file format from the given data stream.
- IOException
-
If an I/O error has occurred.
Reads a texel buffer metadata in TXB
file format from the given binary reader.
- IOException
-
If an I/O error has occurred.
ToColorBuffer
Helper method that converts this texel buffer into a new compact color buffer.
- See also
ToColorBufferOwn
Helper method that converts this texel buffer into a new compact color buffer.
- See also
WriteTXB
3 overloads
Writes the texel data in this buffer to the given file, using the TXB
file format.
- IOException
-
If an I/O error has occurred.
Writes the texel data in this buffer to the given data stream, using the TXB
file format.
- IOException
-
If an I/O error has occurred.
Writes the texel data in this buffer to the given binary writer, using the TXB
file format.
- IOException
-
If an I/O error has occurred.
Public / Attributes
RawTexelsStride
Returns the stride of RawTexels.
The stride is the byte size of one row of texel blocks (see TextureFormat.BlockSize).
Protected / Methods
BufferDecodeInternal
Decodes a block of texels from the storage format.
- IOException
-
If the binary format input in is malformed.
BufferEncodeInternal
Encodes a block of texels into the storage format.
The storage format must be dependent on the native byte-order (see ByteBuffer.NativeOrder). The storage format may include additional compression techniques, for example RangeCompression.
BufferTemp
Creates the temporary buffer to use for BufferDecodeInternal resp. BufferEncodeInternal.
The default implementation returns null
.