Constructors
GH_MemoryBitmap
#Constructor with Wrap mode override.
public GH_MemoryBitmap()
Bitmap
bitmap,
Bitmap to operate on. This bitmap will be in an invalid state until the Release() function has been called.
wrap
Wrap mode to use during sampling.
GH_MemoryBitmap
#Default constructor.
public GH_MemoryBitmap()
Bitmap
bitmap
Bitmap to operate on. This bitmap will be in an invalid state until the Release() function has been called.
Properties
HasAlphaChannel
#Gets a value indicating whether or not the local image has an alpha channel defined.
Methods
A
#Gets the alpha channel value at the given pixel coordinates.
Returns: Value of alpha channel at given pixel or 255 if the alpha channel is not defined.
B
#Gets the blue channel value at the given pixel coordinates.
Returns: Value of Blue channel at given pixel.
Colour
#Sets the colour at the given pixel coordinates.
CopyChannel
#Copy the contents of one channel into another.
public void CopyChannel()
source,
Source channel (compound channels are not allowed).
target
Target channel (compound channels are not allowed).
Filter_AlphaEdges
#Set the alpha component on all edges to a specific value.
Filter_Blur
#Blur the image in both directions.
Filter_Blur
#Blur the image N times in both directions.
Filter_BlurAlpha
#Blur the alpha channel of the image N times in both directions.
Filter_Contrast
#Adjust the contrast of a specific channel.
public void Filter_Contrast()
channel,
Channel(s) to modify.
factor
Contrast boost factor. A factor of 1.0 will not affect contrast. Lower values will lessen contrast and higher values will increase contrast.
Filter_DitherPattern
#Create a checkerboard dither pattern.
public void Filter_DitherPattern()
Color
colour
Colour value to set at dithered pixels.
Filter_DropShadow
#Add a drop-shadow to the image. Image is not grown, so if you want the drop shadow to extend beyond the image boundaries, you have to add padding to the image first.
Filter_Dullify
#Reduces contrast based on opacity. This filter pulls all colours towards dull grey, without wrecking drop-shadows.
public void Filter_Dullify()
Filter_Equalize
#Set all the values in a specific channel to a specific value.
public void Filter_Equalize()
Filter_GreyScale
#Convert the image to a greyscale shadow of its former self.
public void Filter_GreyScale()
Filter_GreyScale
#Convert the image to a greyscale shadow of its former self.
public void Filter_GreyScale()
amount
Greyscale factor. 1.0 equals complete greyscale, 0.0 equals no greyscale, -1.0 equals inverse greyscale
Filter_HueScale
#Convert the image to a greyscale representation of the hues.
public void Filter_HueScale()
Filter_LumScale
#Convert the image to a greyscale representation of the luminance.
public void Filter_LumScale()
Filter_Multiply
#Multiply all values in a specific channel with a specific factor, using a custom scaling center anchor.
public void Filter_Multiply()
channel,
Channel(s) to multiply.
factor,
Multiplication factor.
anchor
Byte value to scale from.
Filter_Multiply
#Multiply all values in a specific channel with a specific factor.
public void Filter_Multiply()
Filter_SatScale
#Convert the image to a greyscale representation of the saturation.
public void Filter_SatScale()
Filter_SpectrumScale
#Convert the image to a spectral representation of the hues.
public void Filter_SpectrumScale()
Filter_Tint
#Colorize the image using Hue and Saturation from a base colour.
public void Filter_Tint()
Color
tint,
Colour of colorize operation.
lum_factor,
Luminance blend factor. 0.0 equals no luminance adjustment, 1.0 equals complete luminance adjustment.
sat_factor
Saturation blend factor. 0.0 equals no saturation adjustment, 1.0 equals complete saturation adjustment.
G
#Gets the greeb channel value at the given pixel coordinates.
Returns: Value of Green channel at given pixel.
OpaqueArea
#Find the opaque area of a bitmap. The opaque area is the rectangle that contains pixels with a colour that is not fully transparent.
public Rectangle OpaqueArea()
Returns: Area of bitmap containing all non-transparent pixels.
PadBitmap
#Add padding edges around a bitmap.
Returns: A new bitmap with padded edges and the same PixelFormat as the original bitmap.
R
#Gets the red channel value at the given pixel coordinates.
Returns: Value of Red channel at given pixel.
Release
#Release the locked bits. You must call this function when you are done with this GH_MemoryBitmap instance.
public void Release()
Sample
#Top level sampling function for interpolated sampling.
ShrinkBitmap
#Shrink an image by removing all outer columns and rows that contain only fully transparent pixels.
public static Bitmap ShrinkBitmap()
Bitmap
image
Image to shrink.
Returns: Shrunk bitmap.