C# Класс ARCed.Core.QColorMatrix

Extension of the GDI+ struct ColorMatrix.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Color2Vector ( Color color ) : float[]

Converts a Color object to a vector and returns it.

FromColorMatrix ( System.Drawing.Imaging.ColorMatrix colorMatrix ) : void

Translates the matrix from a ColorMatrix.

FromJaggedMatrix ( float matrixData ) : void

Returns the given matrix data as a jagged matrix

Multiply ( QColorMatrix matrix ) : void

Multiplies the given matrix

Multiply ( QColorMatrix matrix, MatrixOrder order ) : void

Multiply the given matrix using the specified matrix order.

QColorMatrix ( ) : System

Default constructor

QColorMatrix ( System.Drawing.Imaging.ColorMatrix colorMatrix ) : System

Constructor specifying matrix data

QColorMatrix ( QColorMatrix matrixData ) : System

Constructor specifying matrix data

QColorMatrix ( float matrixData ) : System

Constructor specifying matrix data

Reset ( ) : void

Set to identity matrix

RotateBlue ( float phi ) : void

Rotate the matrix around the blue color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.

RotateBlue ( float phi, MatrixOrder order ) : void

Rotate the matrix around the blue color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.

RotateGreen ( float phi ) : void

Rotate the matrix around the green color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.

RotateGreen ( float phi, MatrixOrder order ) : void

Rotate the matrix around the green color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.

RotateHue ( float phi ) : void

Rotate the hue around the gray axis, keeping luminance fixed. Grays are fixed, all other colors change.

RotateRed ( float phi ) : void

Rotate the matrix around the red color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.

RotateRed ( float phi, MatrixOrder order ) : void

Rotate the matrix around the red color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.

Scale ( float scaleRed, float scaleGreen, float scaleBlue, float scaleOpacity ) : void

Update this matrix with the product of itself and a scaling vector.

Scale ( float scaleRed, float scaleGreen, float scaleBlue, float scaleOpacity, MatrixOrder order ) : void

Update this matrix with the product of itself and a scaling vector.

ScaleColors ( float scale ) : void

Scale just the three colors with the same amount, leave opacity unchanged

ScaleColors ( float scale, MatrixOrder order ) : void

Scale just the three colors with the same amount, leave opacity unchanged

ScaleOpacity ( float scaleOpacity ) : void

Scales the matrix opacity

ScaleOpacity ( float scaleOpacity, MatrixOrder order ) : void

Scales the matrix opacity

SetBrightness ( float offset ) : void

Sets the matrix brightness

SetContrast ( float scale ) : void

Sets the matrix contrast

SetSaturation ( float saturation ) : void

Sets the matrix saturation

SetSaturation ( float saturation, MatrixOrder order ) : void

Set the saturation of the matrix. Saturation of 0.0f yields black and white, 1.0f is neutral.

SetSaturation2 ( float saturation ) : void

Sets the matrix saturation using MatrixOrder.MatrixOrderAppend order.

ShearBlue ( float red, float green ) : void

Shear the matrix in the blue color plane. The color is influenced by the other two planes.

ShearBlue ( float red, float green, MatrixOrder order ) : void

Shear the matrix in the blue color plane. The color is influenced by the other two planes.

ShearGreen ( float red, float blue ) : void

Shear the matrix in the green color plane. The color is influenced by the other two planes.

ShearGreen ( float red, float blue, MatrixOrder order ) : void

Shear the matrix in the green color plane. The color is influenced by the other two planes.

ShearRed ( float green, float blue ) : void

Shear the matrix in the red color plane. The color is influenced by the other two planes.

ShearRed ( float green, float blue, MatrixOrder order ) : void

Shear the matrix in the red color plane. The color is influenced by the other two planes.

ToColorMatrix ( ) : System.Drawing.Imaging.ColorMatrix

Converts the matrix to a ColorMatrix and returns it.

ToJaggedMatrix ( ) : float[][]

Converts the matrix to a jagged array of data

TransformColors ( Color colors ) : Color[]

Multiply each color by the matrix.

TransformVector ( float v ) : float[]

Multiply the vector v by the matrix in place. v points to an array of at least four values, representing R, G, B and A.

TransformVector ( float vector, bool normalize ) : float[]

Transforms a vector

Translate ( float offsetRed, float offsetGreen, float offsetBlue, float offsetOpacity ) : void

Update this matrix with the product of itself and a translation vector.

Translate ( float offsetRed, float offsetGreen, float offsetBlue, float offsetOpacity, MatrixOrder order ) : void

Update this matrix with the product of itself and a translation vector.

TranslateColors ( float offset ) : void

Translate matrix colors

TranslateColors ( float offset, MatrixOrder order ) : void

Translate matrix colors

TranslateOpacity ( float offsetOpacity ) : void

Translate matrix opacity

TranslateOpacity ( float offsetOpacity, MatrixOrder order ) : void

Translate matrix opacity

Vector2Color ( float vector ) : Color

Converts a vector array to a Color object.

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

Метод Описание
Copy ( QColorMatrix qm ) : void
Copy ( float m ) : void
InitHue ( ) : void
RotateColor ( float phi, int x, int y, MatrixOrder order ) : void

X and Y are the indices of the value to receive the sin(phi) value

ShearColor ( int x, int y1, float d1, int y2, float d2, MatrixOrder order ) : void

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

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

Converts a Color object to a vector and returns it.
public static Color2Vector ( Color color ) : float[]
color Color Color to convert
Результат float[]

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

Translates the matrix from a ColorMatrix.
public FromColorMatrix ( System.Drawing.Imaging.ColorMatrix colorMatrix ) : void
colorMatrix System.Drawing.Imaging.ColorMatrix ColorMatrix to translate from
Результат void

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

Returns the given matrix data as a jagged matrix
public FromJaggedMatrix ( float matrixData ) : void
matrixData float Matrix data
Результат void

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

Multiplies the given matrix
public Multiply ( QColorMatrix matrix ) : void
matrix QColorMatrix Matrix to multiply
Результат void

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

Multiply the given matrix using the specified matrix order.
public Multiply ( QColorMatrix matrix, MatrixOrder order ) : void
matrix QColorMatrix Matrix to multiply
order MatrixOrder Order to multiply with
Результат void

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

Default constructor
public QColorMatrix ( ) : System
Результат System

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

Constructor specifying matrix data
public QColorMatrix ( System.Drawing.Imaging.ColorMatrix colorMatrix ) : System
colorMatrix System.Drawing.Imaging.ColorMatrix Matrix data to initialize with
Результат System

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

Constructor specifying matrix data
public QColorMatrix ( QColorMatrix matrixData ) : System
matrixData QColorMatrix Matrix data to initialize with
Результат System

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

Constructor specifying matrix data
public QColorMatrix ( float matrixData ) : System
matrixData float Matrix data to initialize with
Результат System

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

Set to identity matrix
public Reset ( ) : void
Результат void

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

Rotate the matrix around the blue color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.
public RotateBlue ( float phi ) : void
phi float Angle in degrees to rotate (-180.0f... 180.0f).
Результат void

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

Rotate the matrix around the blue color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.
public RotateBlue ( float phi, MatrixOrder order ) : void
phi float Angle in degrees to rotate (-180.0f... 180.0f).
order MatrixOrder Matrix order
Результат void

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

Rotate the matrix around the green color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.
public RotateGreen ( float phi ) : void
phi float Angle in degrees to rotate (-180.0f... 180.0f).
Результат void

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

Rotate the matrix around the green color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.
public RotateGreen ( float phi, MatrixOrder order ) : void
phi float Angle in degrees to rotate (-180.0f... 180.0f).
order MatrixOrder Matrix order
Результат void

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

Rotate the hue around the gray axis, keeping luminance fixed. Grays are fixed, all other colors change.
public RotateHue ( float phi ) : void
phi float Degrees to rotate
Результат void

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

Rotate the matrix around the red color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.
public RotateRed ( float phi ) : void
phi float Angle in degrees to rotate (-180.0f... 180.0f).
Результат void

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

Rotate the matrix around the red color axes. The color of the rotation axis is unchanged, the other two colors are rotated in color space.
public RotateRed ( float phi, MatrixOrder order ) : void
phi float Angle in degrees to rotate (-180.0f... 180.0f).
order MatrixOrder Matrix order
Результат void

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

Update this matrix with the product of itself and a scaling vector.
public Scale ( float scaleRed, float scaleGreen, float scaleBlue, float scaleOpacity ) : void
scaleRed float Red scaling value
scaleGreen float Green scaling value
scaleBlue float Blue scaling value
scaleOpacity float Alpha scaling value
Результат void

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

Update this matrix with the product of itself and a scaling vector.
public Scale ( float scaleRed, float scaleGreen, float scaleBlue, float scaleOpacity, MatrixOrder order ) : void
scaleRed float Red scaling value
scaleGreen float Green scaling value
scaleBlue float Blue scaling value
scaleOpacity float Alpha scaling value
order MatrixOrder Matrix order
Результат void

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

Scale just the three colors with the same amount, leave opacity unchanged
public ScaleColors ( float scale ) : void
scale float Scale value
Результат void

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

Scale just the three colors with the same amount, leave opacity unchanged
public ScaleColors ( float scale, MatrixOrder order ) : void
scale float Scale value
order MatrixOrder Matrix order
Результат void

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

Scales the matrix opacity
public ScaleOpacity ( float scaleOpacity ) : void
scaleOpacity float Alpha scaling value
Результат void

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

Scales the matrix opacity
public ScaleOpacity ( float scaleOpacity, MatrixOrder order ) : void
scaleOpacity float Alpha scaling value
order MatrixOrder Matrix order
Результат void

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

Sets the matrix brightness
public SetBrightness ( float offset ) : void
offset float Brightness offset value
Результат void

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

Sets the matrix contrast
public SetContrast ( float scale ) : void
scale float Constrast scale value
Результат void

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

Sets the matrix saturation
public SetSaturation ( float saturation ) : void
saturation float Saturation value
Результат void

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

Set the saturation of the matrix. Saturation of 0.0f yields black and white, 1.0f is neutral.
public SetSaturation ( float saturation, MatrixOrder order ) : void
saturation float Saturation value
order MatrixOrder Matrix order
Результат void

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

Sets the matrix saturation using MatrixOrder.MatrixOrderAppend order.
public SetSaturation2 ( float saturation ) : void
saturation float Saturation value.
Результат void

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

Shear the matrix in the blue color plane. The color is influenced by the other two planes.
public ShearBlue ( float red, float green ) : void
red float Red color plane
green float Green color plane
Результат void

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

Shear the matrix in the blue color plane. The color is influenced by the other two planes.
public ShearBlue ( float red, float green, MatrixOrder order ) : void
red float Red color plane
green float Green color plane
order MatrixOrder Matrix order
Результат void

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

Shear the matrix in the green color plane. The color is influenced by the other two planes.
public ShearGreen ( float red, float blue ) : void
red float Red color plane
blue float Blue color plane
Результат void

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

Shear the matrix in the green color plane. The color is influenced by the other two planes.
public ShearGreen ( float red, float blue, MatrixOrder order ) : void
red float Red color plane
blue float Blue color plane
order MatrixOrder Matrix order
Результат void

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

Shear the matrix in the red color plane. The color is influenced by the other two planes.
public ShearRed ( float green, float blue ) : void
green float Green color plane
blue float Blue color plane
Результат void

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

Shear the matrix in the red color plane. The color is influenced by the other two planes.
public ShearRed ( float green, float blue, MatrixOrder order ) : void
green float Green color plane
blue float Blue color plane
order MatrixOrder Matrix order
Результат void

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

Converts the matrix to a ColorMatrix and returns it.
public ToColorMatrix ( ) : System.Drawing.Imaging.ColorMatrix
Результат System.Drawing.Imaging.ColorMatrix

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

Converts the matrix to a jagged array of data
public ToJaggedMatrix ( ) : float[][]
Результат float[][]

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

Multiply each color by the matrix.
public TransformColors ( Color colors ) : Color[]
colors Color
Результат Color[]

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

Multiply the vector v by the matrix in place. v points to an array of at least four values, representing R, G, B and A.
public TransformVector ( float v ) : float[]
v float
Результат float[]

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

Transforms a vector
public TransformVector ( float vector, bool normalize ) : float[]
vector float Vector to transform
normalize bool Flag to normalize data before returning
Результат float[]

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

Update this matrix with the product of itself and a translation vector.
public Translate ( float offsetRed, float offsetGreen, float offsetBlue, float offsetOpacity ) : void
offsetRed float Red offset value
offsetGreen float Green offset value
offsetBlue float Blue offset value
offsetOpacity float Alpha offset value
Результат void

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

Update this matrix with the product of itself and a translation vector.
public Translate ( float offsetRed, float offsetGreen, float offsetBlue, float offsetOpacity, MatrixOrder order ) : void
offsetRed float Red offset value
offsetGreen float Green offset value
offsetBlue float Blue offset value
offsetOpacity float Alpha offset value
order MatrixOrder Matrix order
Результат void

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

Translate matrix colors
public TranslateColors ( float offset ) : void
offset float Offset value
Результат void

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

Translate matrix colors
public TranslateColors ( float offset, MatrixOrder order ) : void
offset float Offset value
order MatrixOrder Matrix order
Результат void

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

Translate matrix opacity
public TranslateOpacity ( float offsetOpacity ) : void
offsetOpacity float Alpha offset value
Результат void

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

Translate matrix opacity
public TranslateOpacity ( float offsetOpacity, MatrixOrder order ) : void
offsetOpacity float Alpha offset value
order MatrixOrder Matrix order
Результат void

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

Converts a vector array to a Color object.
public static Vector2Color ( float vector ) : Color
vector float Floar array vector
Результат Color