C# Class ImageProcessor.Imaging.Helpers.PixelOperations

Performs per-pixel operations.
ファイルを表示 Open project: JimBobSquarePants/ImageProcessor

Public Methods

Method Description
Gamma ( Color color, float value ) : Color

Returns the given color adjusted by the given gamma value.

ToGammaFromLinear ( Color composite ) : Color

Converts an pixel from a linear color-space to the equivalent gamma color-space.

ToLinear ( Color composite ) : Color

Converts an pixel from an sRGB color-space to the equivalent linear color-space.

ToLinearFromGamma ( Color composite ) : Color

Converts an pixel from a gamma color-space to the equivalent linear color-space.

ToSRGB ( Color linear ) : Color

Converts an image from a linear color-space to the equivalent sRGB color-space.

Private Methods

Method Description
GetGammaLinearBytes ( ) : byte[]

Gets an array of bytes representing each possible value of color component converted from linear to the gamma color space.

GetLinearBytes ( ) : byte[]

Gets an array of bytes representing each possible value of color component converted from sRGB to the linear color space.

GetLinearGammaBytes ( ) : byte[]

Gets an array of bytes representing each possible value of color component converted from gamma to the linear color space.

GetSRGBBytes ( ) : byte[]

Gets an array of bytes representing each possible value of color component converted from linear to the sRGB color space.

LinearToSRGB ( float signal ) : float

Gets the correct sRGB value from an linear signal.

SRGBToLinear ( float signal ) : float

Gets the correct linear value from an sRGB signal.

Method Details

Gamma() public static method

Returns the given color adjusted by the given gamma value.
/// Thrown if the given gamma value is out with the acceptable range. ///
public static Gamma ( Color color, float value ) : Color
color Color /// The to adjust. ///
value float /// The gamma value - Between .1 and 5. ///
return Color

ToGammaFromLinear() public static method

Converts an pixel from a linear color-space to the equivalent gamma color-space.
public static ToGammaFromLinear ( Color composite ) : Color
composite Color /// The to convert. ///
return Color

ToLinear() public static method

Converts an pixel from an sRGB color-space to the equivalent linear color-space.
public static ToLinear ( Color composite ) : Color
composite Color /// The to convert. ///
return Color

ToLinearFromGamma() public static method

Converts an pixel from a gamma color-space to the equivalent linear color-space.
public static ToLinearFromGamma ( Color composite ) : Color
composite Color /// The to convert. ///
return Color

ToSRGB() public static method

Converts an image from a linear color-space to the equivalent sRGB color-space.
public static ToSRGB ( Color linear ) : Color
linear Color /// The to convert. ///
return Color