C# Класс Pinta.ImageManipulation.ColorBgra

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BgraToUInt32 ( byte b, byte g, byte r, byte a ) : UInt32

Packs color and alpha values into a 32-bit integer.

BgraToUInt32 ( int b, int g, int r, int a ) : UInt32

Packs color and alpha values into a 32-bit integer.

Blend ( ColorBgra ca, ColorBgra cb, byte cbAlpha ) : ColorBgra

Smoothly blends between two colors.

Blend ( ColorBgra colors, int count ) : ColorBgra

Smoothly blends the given colors together, assuming equal weighting for each one.

BlendColors4W16IP ( ColorBgra c1, uint w1, ColorBgra c2, uint w2, ColorBgra c3, uint w3, ColorBgra c4, uint w4 ) : ColorBgra

Blends four colors together based on the given weight values.

The weights should be 16-bit fixed point numbers that add up to 65536 ("1.0"). 4W16IP means "4 colors, weights, 16-bit integer precision"

BlendColorsWAIP ( ColorBgra c, uint w ) : ColorBgra

Blends the colors based on the given weight values.

"WAIP" stands for "weights, arbitrary integer precision"

BlendColorsWFP ( ColorBgra c, double w ) : ColorBgra

Blends the colors based on the given weight values.

"WAIP" stands for "weights, floating-point"

ClampToByte ( double x ) : byte
ClampToByte ( float x ) : byte
ClampToByte ( int x ) : byte
Equals ( object obj ) : bool

Compares two ColorBgra instance to determine if they are equal.

FromBgr ( byte b, byte g, byte r ) : ColorBgra

Creates a new ColorBgra instance with the given color values, and 255 for alpha.

FromBgra ( byte b, byte g, byte r, byte a ) : ColorBgra

Creates a new ColorBgra instance with the given color and alpha values.

FromBgraClamped ( float b, float g, float r, float a ) : ColorBgra

Creates a new ColorBgra instance with the given color and alpha values.

FromBgraClamped ( int b, int g, int r, int a ) : ColorBgra

Creates a new ColorBgra instance with the given color and alpha values.

FromUInt32 ( UInt32 bgra ) : ColorBgra

Constructs a new ColorBgra instance with the given 32-bit value.

GetAverageColorChannelValue ( ) : byte

Returns the average of the B, G, and R values. Alpha is ignored.

GetHashCode ( ) : int

Returns a hash code for this color value.

GetIntensity ( ) : double

Gets the luminance intensity of the pixel based on the values of the red, green, and blue components. Alpha is ignored.

GetIntensityByte ( ) : byte

Gets the luminance intensity of the pixel based on the values of the red, green, and blue components. Alpha is ignored.

GetMaxColorChannelValue ( ) : byte

Returns the maximum value out of the B, G, and R values. Alpha is ignored.

Lerp ( ColorBgra from, ColorBgra to, double frac ) : ColorBgra

Linearly interpolates between two color values.

This method does a simple lerp on each color value and on the alpha channel. It does not properly take into account the alpha channel's effect on color blending.

Lerp ( ColorBgra from, ColorBgra to, float frac ) : ColorBgra

Linearly interpolates between two color values.

This method does a simple lerp on each color value and on the alpha channel. It does not properly take into account the alpha channel's effect on color blending.

Lerp ( double from, double to, double frac ) : double
Lerp ( float from, float to, float frac ) : float
NewAlpha ( byte newA ) : ColorBgra

Returns a new ColorBgra with the same color values but with a new alpha component value.

ParseHexString ( string hexString ) : ColorBgra
ToHexString ( ) : string
ToString ( ) : string
operator ( ) : bool

Compares two ColorBgra instance to determine if they are equal.

this ( int channel ) : byte

Gets or sets the byte value of the specified color channel.

Приватные методы

Метод Описание
FromRgb ( byte r, byte g, byte b ) : ColorBgra
FromRgba ( byte r, byte g, byte b, byte a ) : ColorBgra

Описание методов

BgraToUInt32() публичный статический Метод

Packs color and alpha values into a 32-bit integer.
public static BgraToUInt32 ( byte b, byte g, byte r, byte a ) : UInt32
b byte
g byte
r byte
a byte
Результат System.UInt32

BgraToUInt32() публичный статический Метод

Packs color and alpha values into a 32-bit integer.
public static BgraToUInt32 ( int b, int g, int r, int a ) : UInt32
b int
g int
r int
a int
Результат System.UInt32

Blend() публичный статический Метод

Smoothly blends between two colors.
public static Blend ( ColorBgra ca, ColorBgra cb, byte cbAlpha ) : ColorBgra
ca ColorBgra
cb ColorBgra
cbAlpha byte
Результат ColorBgra

Blend() публичный статический Метод

Smoothly blends the given colors together, assuming equal weighting for each one.
public static Blend ( ColorBgra colors, int count ) : ColorBgra
colors ColorBgra
count int
Результат ColorBgra

BlendColors4W16IP() публичный статический Метод

Blends four colors together based on the given weight values.
The weights should be 16-bit fixed point numbers that add up to 65536 ("1.0"). 4W16IP means "4 colors, weights, 16-bit integer precision"
public static BlendColors4W16IP ( ColorBgra c1, uint w1, ColorBgra c2, uint w2, ColorBgra c3, uint w3, ColorBgra c4, uint w4 ) : ColorBgra
c1 ColorBgra
w1 uint
c2 ColorBgra
w2 uint
c3 ColorBgra
w3 uint
c4 ColorBgra
w4 uint
Результат ColorBgra

BlendColorsWAIP() публичный статический Метод

Blends the colors based on the given weight values.
"WAIP" stands for "weights, arbitrary integer precision"
public static BlendColorsWAIP ( ColorBgra c, uint w ) : ColorBgra
c ColorBgra The array of color values.
w uint The array of weight values.
Результат ColorBgra

BlendColorsWFP() публичный статический Метод

Blends the colors based on the given weight values.
"WAIP" stands for "weights, floating-point"
public static BlendColorsWFP ( ColorBgra c, double w ) : ColorBgra
c ColorBgra The array of color values.
w double The array of weight values.
Результат ColorBgra

ClampToByte() публичный статический Метод

public static ClampToByte ( double x ) : byte
x double
Результат byte

ClampToByte() публичный статический Метод

public static ClampToByte ( float x ) : byte
x float
Результат byte

ClampToByte() публичный статический Метод

public static ClampToByte ( int x ) : byte
x int
Результат byte

Equals() публичный Метод

Compares two ColorBgra instance to determine if they are equal.
public Equals ( object obj ) : bool
obj object
Результат bool

FromBgr() публичный статический Метод

Creates a new ColorBgra instance with the given color values, and 255 for alpha.
public static FromBgr ( byte b, byte g, byte r ) : ColorBgra
b byte
g byte
r byte
Результат ColorBgra

FromBgra() публичный статический Метод

Creates a new ColorBgra instance with the given color and alpha values.
public static FromBgra ( byte b, byte g, byte r, byte a ) : ColorBgra
b byte
g byte
r byte
a byte
Результат ColorBgra

FromBgraClamped() публичный статический Метод

Creates a new ColorBgra instance with the given color and alpha values.
public static FromBgraClamped ( float b, float g, float r, float a ) : ColorBgra
b float
g float
r float
a float
Результат ColorBgra

FromBgraClamped() публичный статический Метод

Creates a new ColorBgra instance with the given color and alpha values.
public static FromBgraClamped ( int b, int g, int r, int a ) : ColorBgra
b int
g int
r int
a int
Результат ColorBgra

FromUInt32() публичный статический Метод

Constructs a new ColorBgra instance with the given 32-bit value.
public static FromUInt32 ( UInt32 bgra ) : ColorBgra
bgra System.UInt32
Результат ColorBgra

GetAverageColorChannelValue() публичный Метод

Returns the average of the B, G, and R values. Alpha is ignored.
public GetAverageColorChannelValue ( ) : byte
Результат byte

GetHashCode() публичный Метод

Returns a hash code for this color value.
public GetHashCode ( ) : int
Результат int

GetIntensity() публичный Метод

Gets the luminance intensity of the pixel based on the values of the red, green, and blue components. Alpha is ignored.
public GetIntensity ( ) : double
Результат double

GetIntensityByte() публичный Метод

Gets the luminance intensity of the pixel based on the values of the red, green, and blue components. Alpha is ignored.
public GetIntensityByte ( ) : byte
Результат byte

GetMaxColorChannelValue() публичный Метод

Returns the maximum value out of the B, G, and R values. Alpha is ignored.
public GetMaxColorChannelValue ( ) : byte
Результат byte

Lerp() публичный статический Метод

Linearly interpolates between two color values.
This method does a simple lerp on each color value and on the alpha channel. It does not properly take into account the alpha channel's effect on color blending.
public static Lerp ( ColorBgra from, ColorBgra to, double frac ) : ColorBgra
from ColorBgra The color value that represents 0 on the lerp number line.
to ColorBgra The color value that represents 1 on the lerp number line.
frac double A value in the range [0, 1].
Результат ColorBgra

Lerp() публичный статический Метод

Linearly interpolates between two color values.
This method does a simple lerp on each color value and on the alpha channel. It does not properly take into account the alpha channel's effect on color blending.
public static Lerp ( ColorBgra from, ColorBgra to, float frac ) : ColorBgra
from ColorBgra The color value that represents 0 on the lerp number line.
to ColorBgra The color value that represents 1 on the lerp number line.
frac float A value in the range [0, 1].
Результат ColorBgra

Lerp() публичный статический Метод

public static Lerp ( double from, double to, double frac ) : double
from double
to double
frac double
Результат double

Lerp() публичный статический Метод

public static Lerp ( float from, float to, float frac ) : float
from float
to float
frac float
Результат float

NewAlpha() публичный Метод

Returns a new ColorBgra with the same color values but with a new alpha component value.
public NewAlpha ( byte newA ) : ColorBgra
newA byte
Результат ColorBgra

ParseHexString() публичный статический Метод

public static ParseHexString ( string hexString ) : ColorBgra
hexString string
Результат ColorBgra

ToHexString() публичный Метод

public ToHexString ( ) : string
Результат string

ToString() публичный Метод

public ToString ( ) : string
Результат string

operator() публичный статический Метод

Compares two ColorBgra instance to determine if they are equal.
public static operator ( ) : bool
Результат bool

this() публичный Метод

Gets or sets the byte value of the specified color channel.
public this ( int channel ) : byte
channel int
Результат byte