C# Class Utilities.Media.SwiftBitmapExtensions

显示文件 Open project: JaCraig/Craig-s-Utility-Library

Public Methods

Method Description
AddNoise ( this Image, int Amount = 10 ) : SwiftBitmap

adds noise to the image

AdjustBrightness ( this Image, int Value ) : SwiftBitmap

Adjusts the brightness

AdjustContrast ( this OriginalImage, float Value ) : SwiftBitmap

Adjusts the Contrast

AdjustGamma ( this OriginalImage, float Value = 1.0f ) : SwiftBitmap

Adjusts the Gamma

BlackAndWhite ( this Image ) : SwiftBitmap

Converts an SwiftBitmap to black and white

BlueFilter ( this Image ) : SwiftBitmap

Gets the blue filter for an image

BoxBlur ( this Image, int Size = 3 ) : SwiftBitmap

Does smoothing using a box blur

BumpMap ( this Image, Direction Direction = Direction.TopBottom, bool Invert = false ) : SwiftBitmap

Creates the bump map

Colorize ( this OriginalImage, Color Colors ) : SwiftBitmap

Colorizes a black and white image

Dilate ( this OriginalImage, int Size ) : SwiftBitmap

Does dilation

DrawRoundedRectangle ( this Image, Color BoxColor, int XPosition, int YPosition, int Height, int Width, int CornerRadius ) : SwiftBitmap

Draws a rounded rectangle on a SwiftBitmap

EdgeDetection ( this OriginalImage, float Threshold, Color EdgeColor ) : SwiftBitmap

Does basic edge detection on an image

Emboss ( this Image ) : SwiftBitmap

Emboss function

Equalize ( this OriginalImage ) : SwiftBitmap

Uses an RGB histogram to equalize the image

GaussianBlur ( this Image, int Size = 3 ) : SwiftBitmap

Does smoothing using a gaussian blur

GreenFilter ( this Image ) : SwiftBitmap

Gets the Green filter for an image

Jitter ( this OriginalImage, int MaxJitter = 5 ) : SwiftBitmap

Causes a "Jitter" effect

KuwaharaBlur ( this OriginalImage, int Size = 3 ) : SwiftBitmap

Does smoothing using a kuwahara blur

LaplaceEdgeDetection ( this Image ) : SwiftBitmap

Laplace edge detection function

MedianFilter ( this OriginalImage, int Size = 3 ) : SwiftBitmap

Does smoothing using a median filter

Negative ( this OriginalImage ) : SwiftBitmap

gets the negative of the image

NormalMap ( this ImageUsing, bool InvertX = false, bool InvertY = false ) : SwiftBitmap

Creates the normal map

Pixelate ( this OriginalImage, int PixelSize = 5 ) : SwiftBitmap

Pixelates an image

RedFilter ( this Image ) : SwiftBitmap

Gets the Red filter for an image

SNNBlur ( this OriginalImage, int Size = 3 ) : SwiftBitmap

Does smoothing using a SNN blur

SepiaTone ( this Image ) : SwiftBitmap

Converts an SwiftBitmap to sepia tone

Sharpen ( this Image ) : SwiftBitmap

Sharpens an image

SharpenLess ( this Image ) : SwiftBitmap

Sharpens an image

SinWave ( this OriginalImage, float Amplitude, float Frequency, bool XDirection, bool YDirection ) : SwiftBitmap

Does a "wave" effect on the image

SobelEdgeDetection ( this Input ) : SwiftBitmap

Sobel edge detection function

SobelEmboss ( this Image ) : SwiftBitmap

Sobel emboss function

StretchContrast ( this OriginalImage ) : SwiftBitmap

Stretches the contrast

Threshold ( this OriginalImage, float Threshold = 0.5f ) : SwiftBitmap

Does threshold manipulation of the image

ToASCIIArt ( this Input ) : string

Converts an SwiftBitmap to ASCII art

Turbulence ( this OriginalImage, int Roughness = 8, float Power = 5.0f, int Seed = 25123864 ) : SwiftBitmap

Does turbulence manipulation of the image

Watermark ( this Image, SwiftBitmap WatermarkImage, float Opacity, int X, int Y, Color KeyColor ) : SwiftBitmap

Adds a watermark to an image

Private Methods

Method Description
Distance ( int R1, int R2, int G1, int G2, int B1, int B2 ) : double
GetHeight ( Color Color ) : float
GetHeight ( int x, int y, SwiftBitmap BlackAndWhiteData ) : float
GetMinMaxPixel ( Color &Min, Color &Max, SwiftBitmap ImageData ) : void
Map ( int Value, int Min, int Max ) : int

Method Details

AddNoise() public static method

adds noise to the image
public static AddNoise ( this Image, int Amount = 10 ) : SwiftBitmap
Image this The image to add noise to
Amount int Amount of noise to add (defaults to 10)
return SwiftBitmap

AdjustBrightness() public static method

Adjusts the brightness
public static AdjustBrightness ( this Image, int Value ) : SwiftBitmap
Image this Image to change
Value int The value.
return SwiftBitmap

AdjustContrast() public static method

Adjusts the Contrast
public static AdjustContrast ( this OriginalImage, float Value ) : SwiftBitmap
OriginalImage this Image to change
Value float Used to set the contrast (-100 to 100)
return SwiftBitmap

AdjustGamma() public static method

Adjusts the Gamma
public static AdjustGamma ( this OriginalImage, float Value = 1.0f ) : SwiftBitmap
OriginalImage this Image to change
Value float Used to build the gamma ramp (usually .2 to 5)
return SwiftBitmap

BlackAndWhite() public static method

Converts an SwiftBitmap to black and white
public static BlackAndWhite ( this Image ) : SwiftBitmap
Image this Image to change
return SwiftBitmap

BlueFilter() public static method

Gets the blue filter for an image
public static BlueFilter ( this Image ) : SwiftBitmap
Image this Image to change
return SwiftBitmap

BoxBlur() public static method

Does smoothing using a box blur
public static BoxBlur ( this Image, int Size = 3 ) : SwiftBitmap
Image this Image to manipulate
Size int Size of the aperture
return SwiftBitmap

BumpMap() public static method

Creates the bump map
public static BumpMap ( this Image, Direction Direction = Direction.TopBottom, bool Invert = false ) : SwiftBitmap
Image this Image to create a bump map from
Direction Direction Direction of the bump map
Invert bool Inverts the direction of the bump map
return SwiftBitmap

Colorize() public static method

Colorizes a black and white image
public static Colorize ( this OriginalImage, Color Colors ) : SwiftBitmap
OriginalImage this Black and white image
Colors Color Color array to use for the image
return SwiftBitmap

Dilate() public static method

Does dilation
public static Dilate ( this OriginalImage, int Size ) : SwiftBitmap
OriginalImage this Image to manipulate
Size int Size of the aperture
return SwiftBitmap

DrawRoundedRectangle() public static method

Draws a rounded rectangle on a SwiftBitmap
public static DrawRoundedRectangle ( this Image, Color BoxColor, int XPosition, int YPosition, int Height, int Width, int CornerRadius ) : SwiftBitmap
Image this Image to draw on
BoxColor Color The color that the box should be
XPosition int The upper right corner's x position
YPosition int The upper right corner's y position
Height int Height of the box
Width int Width of the box
CornerRadius int Radius of the corners
return SwiftBitmap

EdgeDetection() public static method

Does basic edge detection on an image
public static EdgeDetection ( this OriginalImage, float Threshold, Color EdgeColor ) : SwiftBitmap
OriginalImage this Image to do edge detection on
Threshold float Decides what is considered an edge
EdgeColor Color Color of the edge
return SwiftBitmap

Emboss() public static method

Emboss function
public static Emboss ( this Image ) : SwiftBitmap
Image this Image to manipulate
return SwiftBitmap

Equalize() public static method

Uses an RGB histogram to equalize the image
public static Equalize ( this OriginalImage ) : SwiftBitmap
OriginalImage this Image to manipulate
return SwiftBitmap

GaussianBlur() public static method

Does smoothing using a gaussian blur
public static GaussianBlur ( this Image, int Size = 3 ) : SwiftBitmap
Image this Image to manipulate
Size int Size of the aperture
return SwiftBitmap

GreenFilter() public static method

Gets the Green filter for an image
public static GreenFilter ( this Image ) : SwiftBitmap
Image this Image to change
return SwiftBitmap

Jitter() public static method

Causes a "Jitter" effect
public static Jitter ( this OriginalImage, int MaxJitter = 5 ) : SwiftBitmap
OriginalImage this Image to manipulate
MaxJitter int Maximum number of pixels the item can move
return SwiftBitmap

KuwaharaBlur() public static method

Does smoothing using a kuwahara blur
public static KuwaharaBlur ( this OriginalImage, int Size = 3 ) : SwiftBitmap
OriginalImage this Image to manipulate
Size int Size of the aperture
return SwiftBitmap

LaplaceEdgeDetection() public static method

Laplace edge detection function
public static LaplaceEdgeDetection ( this Image ) : SwiftBitmap
Image this Image to manipulate
return SwiftBitmap

MedianFilter() public static method

Does smoothing using a median filter
public static MedianFilter ( this OriginalImage, int Size = 3 ) : SwiftBitmap
OriginalImage this Image to manipulate
Size int Size of the aperture
return SwiftBitmap

Negative() public static method

gets the negative of the image
public static Negative ( this OriginalImage ) : SwiftBitmap
OriginalImage this Image to manipulate
return SwiftBitmap

NormalMap() public static method

Creates the normal map
public static NormalMap ( this ImageUsing, bool InvertX = false, bool InvertY = false ) : SwiftBitmap
ImageUsing this Image to create the normal map from
InvertX bool Invert the X direction
InvertY bool Invert the Y direction
return SwiftBitmap

Pixelate() public static method

Pixelates an image
public static Pixelate ( this OriginalImage, int PixelSize = 5 ) : SwiftBitmap
OriginalImage this Image to pixelate
PixelSize int Size of the "pixels" in pixels
return SwiftBitmap

RedFilter() public static method

Gets the Red filter for an image
public static RedFilter ( this Image ) : SwiftBitmap
Image this Image to change
return SwiftBitmap

SNNBlur() public static method

Does smoothing using a SNN blur
public static SNNBlur ( this OriginalImage, int Size = 3 ) : SwiftBitmap
OriginalImage this Image to manipulate
Size int Size of the aperture
return SwiftBitmap

SepiaTone() public static method

Converts an SwiftBitmap to sepia tone
public static SepiaTone ( this Image ) : SwiftBitmap
Image this Image to change
return SwiftBitmap

Sharpen() public static method

Sharpens an image
public static Sharpen ( this Image ) : SwiftBitmap
Image this Image to manipulate
return SwiftBitmap

SharpenLess() public static method

Sharpens an image
public static SharpenLess ( this Image ) : SwiftBitmap
Image this Image to manipulate
return SwiftBitmap

SinWave() public static method

Does a "wave" effect on the image
public static SinWave ( this OriginalImage, float Amplitude, float Frequency, bool XDirection, bool YDirection ) : SwiftBitmap
OriginalImage this Image to manipulate
Amplitude float Amplitude of the sine wave
Frequency float Frequency of the sine wave
XDirection bool Determines if this should be done in the X direction
YDirection bool Determines if this should be done in the Y direction
return SwiftBitmap

SobelEdgeDetection() public static method

Sobel edge detection function
public static SobelEdgeDetection ( this Input ) : SwiftBitmap
Input this Image to manipulate
return SwiftBitmap

SobelEmboss() public static method

Sobel emboss function
public static SobelEmboss ( this Image ) : SwiftBitmap
Image this Image to manipulate
return SwiftBitmap

StretchContrast() public static method

Stretches the contrast
public static StretchContrast ( this OriginalImage ) : SwiftBitmap
OriginalImage this Image to manipulate
return SwiftBitmap

Threshold() public static method

Does threshold manipulation of the image
public static Threshold ( this OriginalImage, float Threshold = 0.5f ) : SwiftBitmap
OriginalImage this Image to transform
Threshold float /// Float defining the threshold at which to set the pixel to black vs white. ///
return SwiftBitmap

ToASCIIArt() public static method

Converts an SwiftBitmap to ASCII art
public static ToASCIIArt ( this Input ) : string
Input this The SwiftBitmap you wish to convert
return string

Turbulence() public static method

Does turbulence manipulation of the image
public static Turbulence ( this OriginalImage, int Roughness = 8, float Power = 5.0f, int Seed = 25123864 ) : SwiftBitmap
OriginalImage this Image to transform
Roughness int Roughness of the movement
Power float How strong the movement is
Seed int Random seed
return SwiftBitmap

Watermark() public static method

Adds a watermark to an image
public static Watermark ( this Image, SwiftBitmap WatermarkImage, float Opacity, int X, int Y, Color KeyColor ) : SwiftBitmap
Image this image to add the watermark to
WatermarkImage SwiftBitmap Watermark image
Opacity float /// Opacity of the watermark (1.0 to 0.0 with 1 being completely visible and 0 being invisible) ///
X int X position in pixels for the watermark
Y int Y position in pixels for the watermark
KeyColor Color /// Transparent color used in watermark image, set to null if not used ///
return SwiftBitmap