C# Class QuickFont.JBitmap

A class for basic bitmap manipulation: clearing bitmaps, blitting from one bitmap to another etc. Generally methods in this class are quite slow and are only intended for pre-rendering. TODO : replace loops with block copies
Exibir arquivo Open project: Pireax/neovim.cs Class Usage Examples

Public Properties

Property Type Description
bitmap System.Drawing.Bitmap
bitmapData System.Drawing.Imaging.BitmapData
format JBitmapPixelFormat

Public Methods

Method Description
Blit ( JBitmap target, int px, int py ) : void
Blit ( JBitmap target, int srcPx, int srcPy, int srcW, int srcH, int px, int py ) : void
BlitAdditive ( JBitmap target, int px, int py, float strength ) : void

Additively blits onto the target. Only supported for 8bbp.

BlitAdditive24 ( JBitmap target, int px, int py, float strength ) : void

Additively blits onto the target. Supports just 24bpp (source and target)

BlitMax ( JBitmap target, int px, int py, float strength ) : void
BlitOLD ( JBitmap target, int px, int py ) : void

Blits this bitmap onto the target - clips regions that are out of bounds. Only supported for 8bbp

Clear ( byte val ) : void
Clear24 ( byte r, byte g, byte b ) : void
CreateCopy ( ) : JBitmap
DownScale ( int newWidth, int newHeight ) : void
Free ( ) : void

Just unlocks the bits, so that the bitmap can no longer be blitted to / from.

GetPixel ( int px, int py ) : byte
GetPixel24 ( int px, int py, byte &r, byte &g, byte &b ) : void
GetPixelFast ( int px, int py, byte &col ) : void
GetPixelFast ( int px, int py, byte &r, byte &g, byte &b ) : void
GetPixelFast ( int px, int py, byte &r, byte &g, byte &b, byte &a ) : void
JBitmap ( String fileName, JBitmapPixelFormat _format ) : System
JBitmap ( int w, int h, JBitmapPixelFormat _format ) : System
PutPixelFast ( int px, int py, byte col ) : void
PutPixelFast ( int px, int py, byte r, byte g, byte b ) : void
PutPixelFast ( int px, int py, byte r, byte g, byte b, byte a ) : void

Private Methods

Method Description
GetPixFormat ( JBitmapPixelFormat format ) : System.Drawing.Imaging.PixelFormat

Gets the corresponding C# pixel format

Method Details

Blit() public method

public Blit ( JBitmap target, int px, int py ) : void
target JBitmap
px int
py int
return void

Blit() public method

public Blit ( JBitmap target, int srcPx, int srcPy, int srcW, int srcH, int px, int py ) : void
target JBitmap
srcPx int
srcPy int
srcW int
srcH int
px int
py int
return void

BlitAdditive() public method

Additively blits onto the target. Only supported for 8bbp.
public BlitAdditive ( JBitmap target, int px, int py, float strength ) : void
target JBitmap
px int
py int
strength float
return void

BlitAdditive24() public method

Additively blits onto the target. Supports just 24bpp (source and target)
public BlitAdditive24 ( JBitmap target, int px, int py, float strength ) : void
target JBitmap
px int
py int
strength float
return void

BlitMax() public method

public BlitMax ( JBitmap target, int px, int py, float strength ) : void
target JBitmap
px int
py int
strength float
return void

BlitOLD() public method

Blits this bitmap onto the target - clips regions that are out of bounds. Only supported for 8bbp
public BlitOLD ( JBitmap target, int px, int py ) : void
target JBitmap
px int
py int
return void

Clear() public method

public Clear ( byte val ) : void
val byte
return void

Clear24() public method

public Clear24 ( byte r, byte g, byte b ) : void
r byte
g byte
b byte
return void

CreateCopy() public method

public CreateCopy ( ) : JBitmap
return JBitmap

DownScale() public method

public DownScale ( int newWidth, int newHeight ) : void
newWidth int
newHeight int
return void

Free() public method

Just unlocks the bits, so that the bitmap can no longer be blitted to / from.
public Free ( ) : void
return void

GetPixel() public method

public GetPixel ( int px, int py ) : byte
px int
py int
return byte

GetPixel24() public method

public GetPixel24 ( int px, int py, byte &r, byte &g, byte &b ) : void
px int
py int
r byte
g byte
b byte
return void

GetPixelFast() public method

public GetPixelFast ( int px, int py, byte &col ) : void
px int
py int
col byte
return void

GetPixelFast() public method

public GetPixelFast ( int px, int py, byte &r, byte &g, byte &b ) : void
px int
py int
r byte
g byte
b byte
return void

GetPixelFast() public method

public GetPixelFast ( int px, int py, byte &r, byte &g, byte &b, byte &a ) : void
px int
py int
r byte
g byte
b byte
a byte
return void

JBitmap() public method

public JBitmap ( String fileName, JBitmapPixelFormat _format ) : System
fileName String
_format JBitmapPixelFormat
return System

JBitmap() public method

public JBitmap ( int w, int h, JBitmapPixelFormat _format ) : System
w int
h int
_format JBitmapPixelFormat
return System

PutPixelFast() public method

public PutPixelFast ( int px, int py, byte col ) : void
px int
py int
col byte
return void

PutPixelFast() public method

public PutPixelFast ( int px, int py, byte r, byte g, byte b ) : void
px int
py int
r byte
g byte
b byte
return void

PutPixelFast() public method

public PutPixelFast ( int px, int py, byte r, byte g, byte b, byte a ) : void
px int
py int
r byte
g byte
b byte
a byte
return void

Property Details

bitmap public_oe property

public Bitmap,System.Drawing bitmap
return System.Drawing.Bitmap

bitmapData public_oe property

public BitmapData,System.Drawing.Imaging bitmapData
return System.Drawing.Imaging.BitmapData

format public_oe property

public JBitmapPixelFormat format
return JBitmapPixelFormat