C# Класс RemoteLedMatrix.Helpers.ColorExtensions

Class of extensions to make dealing with Colors easier
Показать файл Открыть проект

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

Метод Описание
ApplyGamma ( this source, double gamma ) : Color

Gamma shifts a color by a given amount

FlipEvenColumns ( this pixels, int pixelsPerColumn ) : List

Flips alternating columns of colors in an image

Get21BitPixelBytes ( this colors ) : IEnumerable

Converts an IEnumerable of colors into an IEnumerable of bytes

GetHue ( this color ) : float

Gets the hue as a 0-360 value, representing the degree of rotation

GetIntensity ( this color ) : float

Gets the HSI intensity of the color

GetSaturation ( this color ) : float

Gets the HSI saturation of the color

To21BitPixelBytes ( this color ) : IEnumerable

Extension method for converting a color to three 7-bit bytes

ToColorList ( this bitmap ) : List

Gets a list of all the pixels in a bitmap, serialized to a flat list

ToPerceptual ( this source ) : Color

Shifts a color's intensity so that it looks perceptually correct when displayed on RGB leds.

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

Метод Описание
ApplyGammaToChannel ( byte value, double gamma ) : byte

Applies a gamma shift to a byte value

PerceptualTransformA ( double hue, float saturation, float intensity ) : byte

Transform one of three for converting a HSI-based color to a perceptually adjusted RGB value

PerceptualTransformB ( double hue, float saturation, float intensity ) : byte

Transform two of three for converting a HSI-based color to a perceptually adjusted RGB value

PerceptualTransformC ( double hue, float saturation, float intensity ) : byte

Transform three of three for converting a HSI-based color to a perceptually adjusted RGB value

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

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

Gamma shifts a color by a given amount
public static ApplyGamma ( this source, double gamma ) : Color
source this Source pixel to gamma shift
gamma double Amount to gamma shift by
Результат Color

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

Flips alternating columns of colors in an image
public static FlipEvenColumns ( this pixels, int pixelsPerColumn ) : List
pixels this Color data to flip columns for
pixelsPerColumn int How many pixels are in each column
Результат List

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

Converts an IEnumerable of colors into an IEnumerable of bytes
public static Get21BitPixelBytes ( this colors ) : IEnumerable
colors this List of colors to get bytes for
Результат IEnumerable

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

Gets the hue as a 0-360 value, representing the degree of rotation
public static GetHue ( this color ) : float
color this Color to get the hue of
Результат float

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

Gets the HSI intensity of the color
public static GetIntensity ( this color ) : float
color this Color to get the intensity of
Результат float

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

Gets the HSI saturation of the color
public static GetSaturation ( this color ) : float
color this Color to get the saturation of
Результат float

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

Extension method for converting a color to three 7-bit bytes
public static To21BitPixelBytes ( this color ) : IEnumerable
color this Color to convert to bytes
Результат IEnumerable

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

Gets a list of all the pixels in a bitmap, serialized to a flat list
public static ToColorList ( this bitmap ) : List
bitmap this Bitmap to serialize into a list of colors
Результат List

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

Shifts a color's intensity so that it looks perceptually correct when displayed on RGB leds.
public static ToPerceptual ( this source ) : Color
source this Unadjusted color to shift
Результат Color