C# Class Pinta.Core.Utility

Show file Open project: xxgreg/Pinta

Public Methods

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

Smoothly blends between two colors.

Clamp ( double x, double min, double max ) : double
Clamp ( float x, float min, float max ) : float
Clamp ( int x, int min, int max ) : int
ClampToByte ( double x ) : byte
ClampToByte ( float x ) : byte
ClampToByte ( int x ) : byte
ColorDifference ( ColorBgra a, ColorBgra b ) : int
ColorDifferenceSquared ( ColorBgra a, ColorBgra b ) : int
FastScaleByteByByte ( byte a, byte b ) : byte
GetLinePoints ( Gdk first, Gdk second ) : Gdk.Point[]
GetRegionBounds ( Gdk rects, int startIndex, int length ) : Gdk.Rectangle

Allows you to find the bounding box for a "region" that is described as an array of bounding boxes.

GetStaticName ( Type type ) : string
InflateRectangles ( Gdk rects, int len ) : Gdk.Rectangle[]
Lerp ( Cairo from, Cairo to, float frac ) : Cairo.PointD
Lerp ( double from, double to, double frac ) : double
Lerp ( float from, float to, float frac ) : float
RectanglesToRegion ( Gdk rects ) : Gdk.Region
Swap ( int &a, int &b ) : void

Private Methods

Method Description
IsNumber ( float x ) : bool

Method Details

Blend() public static method

Smoothly blends between two colors.
public static Blend ( ColorBgra ca, ColorBgra cb, byte cbAlpha ) : ColorBgra
ca ColorBgra
cb ColorBgra
cbAlpha byte
return ColorBgra

Clamp() public static method

public static Clamp ( double x, double min, double max ) : double
x double
min double
max double
return double

Clamp() public static method

public static Clamp ( float x, float min, float max ) : float
x float
min float
max float
return float

Clamp() public static method

public static Clamp ( int x, int min, int max ) : int
x int
min int
max int
return int

ClampToByte() public static method

public static ClampToByte ( double x ) : byte
x double
return byte

ClampToByte() public static method

public static ClampToByte ( float x ) : byte
x float
return byte

ClampToByte() public static method

public static ClampToByte ( int x ) : byte
x int
return byte

ColorDifference() public static method

public static ColorDifference ( ColorBgra a, ColorBgra b ) : int
a ColorBgra
b ColorBgra
return int

ColorDifferenceSquared() public static method

public static ColorDifferenceSquared ( ColorBgra a, ColorBgra b ) : int
a ColorBgra
b ColorBgra
return int

FastScaleByteByByte() public static method

public static FastScaleByteByByte ( byte a, byte b ) : byte
a byte
b byte
return byte

GetLinePoints() public static method

public static GetLinePoints ( Gdk first, Gdk second ) : Gdk.Point[]
first Gdk
second Gdk
return Gdk.Point[]

GetRegionBounds() public static method

Allows you to find the bounding box for a "region" that is described as an array of bounding boxes.
public static GetRegionBounds ( Gdk rects, int startIndex, int length ) : Gdk.Rectangle
rects Gdk
startIndex int
length int
return Gdk.Rectangle

GetStaticName() public static method

public static GetStaticName ( Type type ) : string
type System.Type
return string

InflateRectangles() public static method

public static InflateRectangles ( Gdk rects, int len ) : Gdk.Rectangle[]
rects Gdk
len int
return Gdk.Rectangle[]

Lerp() public static method

public static Lerp ( Cairo from, Cairo to, float frac ) : Cairo.PointD
from Cairo
to Cairo
frac float
return Cairo.PointD

Lerp() public static method

public static Lerp ( double from, double to, double frac ) : double
from double
to double
frac double
return double

Lerp() public static method

public static Lerp ( float from, float to, float frac ) : float
from float
to float
frac float
return float

RectanglesToRegion() public static method

public static RectanglesToRegion ( Gdk rects ) : Gdk.Region
rects Gdk
return Gdk.Region

Swap() public static method

public static Swap ( int &a, int &b ) : void
a int
b int
return void