C# 클래스 Pinta.Core.ColorBgra

파일 보기 프로젝트 열기: xxgreg/Pinta 1 사용 예제들

공개 메소드들

메소드 설명
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

Constructs a new ColorBgra instance from the values in the given Color instance.

Converts this ColorBgra instance to a Color instance.

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

Gets the equivalent GDI+ PixelFormat.

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

This property always returns PixelFormat.Format32bppArgb.

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

Compares two ColorBgra instance to determine if they are not 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() 공개 정적인 메소드

Constructs a new ColorBgra instance from the values in the given Color instance. Converts this ColorBgra instance to a Color instance. 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() 공개 메소드

Gets the equivalent GDI+ PixelFormat. Returns a new ColorBgra with the same color values but with a new alpha component value.
This property always returns PixelFormat.Format32bppArgb.
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 not 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