Class ChannelMapping
- Namespace
- ValveResourceFormat.CompiledShader
- Assembly
- ValveResourceFormat.dll
Channel mapping definition used in shaders.
public class ChannelMapping : IEquatable<ChannelMapping>
Inheritance
Implements
Inherited Members
Fields
A
Alpha channel mapping.
public static readonly ChannelMapping A
Field Value
AG
Alpha-green channel mapping.
public static readonly ChannelMapping AG
Field Value
B
Blue channel mapping.
public static readonly ChannelMapping B
Field Value
G
Green channel mapping.
public static readonly ChannelMapping G
Field Value
MaxChannels
Maximum number of channels.
public const int MaxChannels = 4
Field Value
NULL
Null channel mapping.
public static readonly ChannelMapping NULL
Field Value
R
Red channel mapping.
public static readonly ChannelMapping R
Field Value
RG
Red-green channel mapping.
public static readonly ChannelMapping RG
Field Value
RGB
RGB channel mapping.
public static readonly ChannelMapping RGB
Field Value
RGBA
RGBA channel mapping.
public static readonly ChannelMapping RGBA
Field Value
Properties
Channels
Gets all channel bytes.
public IReadOnlyList<byte> Channels { get; }
Property Value
Count
Gets the number of valid channels.
public int Count { get; }
Property Value
Indices
Gets channel indices.
public IReadOnlyList<byte> Indices { get; }
Property Value
PackedValue
Gets the packed uint value.
public uint PackedValue { get; }
Property Value
ValidChannels
Gets valid channel bytes.
public IReadOnlyList<byte> ValidChannels { get; }
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
object?-
The object to compare with the current object.
Returns
Equals(ChannelMapping?)
Determines whether the specified ChannelMapping is equal to this instance.
public bool Equals(ChannelMapping? other)
Parameters
other
ChannelMapping?
Returns
FromChannels(byte, byte, byte, byte)
Creates a ChannelMapping from channel bytes, filling missing slots with ValveResourceFormat.CompiledShader.ChannelMapping.Channel.NULL.
public static ChannelMapping FromChannels(byte first, byte second = 255, byte third = 255, byte fourth = 255)
Parameters
Returns
FromUInt32(uint)
Creates a ChannelMapping from a packed uint value.
public static ChannelMapping FromUInt32(uint packedValue)
Parameters
packedValue
uint
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
-
A hash code for the current object.
GetPackedValueComponent(uint, int)
Gets a component byte from a packed value.
public static byte GetPackedValueComponent(uint packedValue, int index)
Parameters
Returns
ToByte(ChannelMapping)
Returns the first mapped channel component.
public static byte ToByte(ChannelMapping channelMapping)
Parameters
channelMapping
ChannelMapping
Returns
ToComponent(ChannelMapping)
Returns the first mapped channel component.
public static byte ToComponent(ChannelMapping channelMapping)
Parameters
channelMapping
ChannelMapping
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
-
A string that represents the current object.
Remarks
Returns the channel letters (e.g., "RGBA", "RG", "A") or a hexadecimal representation if no channels are mapped.
Operators
operator ==(ChannelMapping, ChannelMapping)
Equality operator.
public static bool operator ==(ChannelMapping left, ChannelMapping right)
Parameters
left
ChannelMappingright
ChannelMapping
Returns
explicit operator ChannelMapping(uint)
Converts from uint to ChannelMapping.
public static explicit operator ChannelMapping(uint value)
Parameters
value
uint
Returns
implicit operator byte(ChannelMapping)
Returns the first mapped channel component.
public static implicit operator byte(ChannelMapping channelMapping)
Parameters
channelMapping
ChannelMapping
Returns
operator !=(ChannelMapping, ChannelMapping)
Inequality operator.
public static bool operator !=(ChannelMapping left, ChannelMapping right)
Parameters
left
ChannelMappingright
ChannelMapping