C# 클래스 Alexandria.Raster

An indexed raster image that can be useful for a variety of systems.
파일 보기 프로젝트 열기: Burton-Radons/Alexandria

Private Properties

프로퍼티 타입 설명
BlendColorIndex int
DirtyAll void
DirtyArea void
DirtyPoint void
DrawFillAddToStackUnsafe void
DrawPixelUnsafe void
DrawPixelUnsafe void
Flush void
PointerTo int
PointerTo int
ProcessColor int
SetupDrawImage void

공개 메소드들

메소드 설명
BlendColorIndex ( int a, int b, int colorCount ) : int

Get the blend colour index in a blended palette.

BlendPalette ( IList original, double blend = 2.0/3.0 ) : Codex

Create a blended palette, which blends colors from the perspective of either A and B or B and A, but unevenly (unless if blend is 0.5). The first colour has blend influence on the result; the second colour has (1 - blend) influence. BlendColorIndex(int,int,int) can be used to create proper indices.

Clamp ( Vector2i value ) : Vector2i

Clamp the value so that it is within the bounds of the Raster.

ClampX ( int value ) : int

Clamp the X coordinate to be within the bounds of the Raster.

ClampY ( int value ) : int

Clamp the Y coordinate to be within the bounds of the Raster.

Clear ( int value ) : void

Clear the raster to a given index.

ColorAt ( Vector2i position ) : int

Get the colour index that will be used with dithering at the given position.

ColorAt ( int x, int y ) : int

Get the colour index that will be used with dithering at the given position.

Contains ( Vector2i position ) : bool

Get whehter the coordinates are within the Raster.

Contains ( int x, int y ) : bool

Get whether the coordinates are within the Raster.

ContainsX ( int value ) : bool

Get whether the Raster contains this X coordinate.

ContainsY ( int value ) : bool

Get whether the Raster contains this Y coordinate.

DrawFillSci ( Vector2i at ) : void

Floodfill drawing in such a way that specifically emulates SCI. Its logical cannot be changed without breaking things.

DrawFillSci ( Vector2i at, int matchColor ) : void

Perform a flood-fill in a way that Sierra's SCI engine does it.

DrawHorizontalLine ( int sx, int y, int ex ) : void

Draw a horizontal line.

DrawImage ( Vector2i position, Vector2i size, int data, int offset, int pitch, int maskIndex ) : void

Draw the image data.

DrawImageSilhouette ( Vector2i position, Vector2i size, int data, int offset, int pitch, int maskIndex ) : void

Draw the image data, using the currently assigned color indices for any non-transparent parts of the image.

DrawLineSci ( Vector2i a, Vector2i b ) : void

Draw a line using Sierra SCI's algorithm

DrawLineSci ( int sx, int sy, int ex, int ey ) : void

Draw a line using SCI-specific logic. Changing this logic in any way will break images.

DrawPixel ( Vector2i position ) : void

Draw a pixel in the Raster.

DrawPixel ( int x, int y ) : void

Draw a pixel, if it's within the clipping range.

DrawVerticalLine ( int x, int sy, int ey ) : void

Draw a vertical line.

GetPixel ( Vector2i position, int defaultValue ) : int

Get the index at a position, or return the default value if the position is out of range.

Lock ( ) : void

Start drawing to the bitmap.

Raster ( Vector2i size, IList palette, int colorBlend = null, byte sourceData = null ) : System

Initialize the Raster.

Raster ( int width, int height, IList palette, int colorBlendBaseCount = null, byte data = null ) : System

Initialize the Raster.

SetColor ( int color ) : void

Set the colour index to write.

SetColor ( int colorA, int colorB ) : void

Set a dithered colour index to write.

Unlock ( ) : void

Stop drawing to the bitmap, flushing the changes.

비공개 메소드들

메소드 설명
BlendColorIndex ( int a, int b ) : int
DirtyAll ( ) : void
DirtyArea ( int minX, int minY, int maxX, int maxY ) : void
DirtyPoint ( int x, int y ) : void

Ensure the point is within the dirty rectangle.

DrawFillAddToStackUnsafe ( Stack queue, int x, int y, int matchColor ) : void
DrawPixelUnsafe ( Vector2i position ) : void
DrawPixelUnsafe ( int x, int y ) : void

Draw a pixel without first checking whether it's within bounds.

Flush ( ) : void

Add the dirtied rectangle to the bitmap, then clear the dirtied area.

PointerTo ( Vector2i position ) : int
PointerTo ( int x, int y ) : int
ProcessColor ( int value ) : int
SetupDrawImage ( Vector2i &position, Vector2i &size, int &data, int &offset, int &pitch ) : void

메소드 상세

BlendColorIndex() 공개 정적인 메소드

Get the blend colour index in a blended palette.
public static BlendColorIndex ( int a, int b, int colorCount ) : int
a int
b int
colorCount int
리턴 int

BlendPalette() 공개 정적인 메소드

Create a blended palette, which blends colors from the perspective of either A and B or B and A, but unevenly (unless if blend is 0.5). The first colour has blend influence on the result; the second colour has (1 - blend) influence. BlendColorIndex(int,int,int) can be used to create proper indices.
public static BlendPalette ( IList original, double blend = 2.0/3.0 ) : Codex
original IList The original set of colours.
blend double The blending between colours used in a combination. Making this a value other than 0.5 puts more variety into the dithering.
리턴 Codex

Clamp() 공개 메소드

Clamp the value so that it is within the bounds of the Raster.
public Clamp ( Vector2i value ) : Vector2i
value Vector2i
리턴 Vector2i

ClampX() 공개 메소드

Clamp the X coordinate to be within the bounds of the Raster.
public ClampX ( int value ) : int
value int
리턴 int

ClampY() 공개 메소드

Clamp the Y coordinate to be within the bounds of the Raster.
public ClampY ( int value ) : int
value int
리턴 int

Clear() 공개 메소드

Clear the raster to a given index.
public Clear ( int value ) : void
value int
리턴 void

ColorAt() 공개 메소드

Get the colour index that will be used with dithering at the given position.
public ColorAt ( Vector2i position ) : int
position Vector2i
리턴 int

ColorAt() 공개 메소드

Get the colour index that will be used with dithering at the given position.
public ColorAt ( int x, int y ) : int
x int
y int
리턴 int

Contains() 공개 메소드

Get whehter the coordinates are within the Raster.
public Contains ( Vector2i position ) : bool
position Vector2i
리턴 bool

Contains() 공개 메소드

Get whether the coordinates are within the Raster.
public Contains ( int x, int y ) : bool
x int
y int
리턴 bool

ContainsX() 공개 메소드

Get whether the Raster contains this X coordinate.
public ContainsX ( int value ) : bool
value int
리턴 bool

ContainsY() 공개 메소드

Get whether the Raster contains this Y coordinate.
public ContainsY ( int value ) : bool
value int
리턴 bool

DrawFillSci() 공개 메소드

Floodfill drawing in such a way that specifically emulates SCI. Its logical cannot be changed without breaking things.
public DrawFillSci ( Vector2i at ) : void
at Vector2i
리턴 void

DrawFillSci() 공개 메소드

Perform a flood-fill in a way that Sierra's SCI engine does it.
public DrawFillSci ( Vector2i at, int matchColor ) : void
at Vector2i
matchColor int
리턴 void

DrawHorizontalLine() 공개 메소드

Draw a horizontal line.
public DrawHorizontalLine ( int sx, int y, int ex ) : void
sx int
y int
ex int
리턴 void

DrawImage() 공개 메소드

Draw the image data.
public DrawImage ( Vector2i position, Vector2i size, int data, int offset, int pitch, int maskIndex ) : void
position Vector2i
size Vector2i
data int
offset int
pitch int
maskIndex int
리턴 void

DrawImageSilhouette() 공개 메소드

Draw the image data, using the currently assigned color indices for any non-transparent parts of the image.
public DrawImageSilhouette ( Vector2i position, Vector2i size, int data, int offset, int pitch, int maskIndex ) : void
position Vector2i
size Vector2i
data int
offset int
pitch int
maskIndex int
리턴 void

DrawLineSci() 공개 메소드

Draw a line using Sierra SCI's algorithm
public DrawLineSci ( Vector2i a, Vector2i b ) : void
a Vector2i
b Vector2i
리턴 void

DrawLineSci() 공개 메소드

Draw a line using SCI-specific logic. Changing this logic in any way will break images.
public DrawLineSci ( int sx, int sy, int ex, int ey ) : void
sx int
sy int
ex int
ey int
리턴 void

DrawPixel() 공개 메소드

Draw a pixel in the Raster.
public DrawPixel ( Vector2i position ) : void
position Vector2i
리턴 void

DrawPixel() 공개 메소드

Draw a pixel, if it's within the clipping range.
public DrawPixel ( int x, int y ) : void
x int
y int
리턴 void

DrawVerticalLine() 공개 메소드

Draw a vertical line.
public DrawVerticalLine ( int x, int sy, int ey ) : void
x int
sy int
ey int
리턴 void

GetPixel() 공개 메소드

Get the index at a position, or return the default value if the position is out of range.
public GetPixel ( Vector2i position, int defaultValue ) : int
position Vector2i
defaultValue int The default value to return if th position is out of range.
리턴 int

Lock() 공개 메소드

Start drawing to the bitmap.
public Lock ( ) : void
리턴 void

Raster() 공개 메소드

Initialize the Raster.
public Raster ( Vector2i size, IList palette, int colorBlend = null, byte sourceData = null ) : System
size Vector2i The dimensions of the raster image.
palette IList The palette to use for colours. This may be a regular palette or a colour blend palette.
colorBlend int If non-negative this is the number of colours in the base palette for a colour-blended palette.
sourceData byte
리턴 System

Raster() 공개 메소드

Initialize the Raster.
public Raster ( int width, int height, IList palette, int colorBlendBaseCount = null, byte data = null ) : System
width int The width in pixels of the raster image.
height int The height in pixels of the raster image.
palette IList The palette to use for colours. This may be a regular palette or a colour blend palette.
colorBlendBaseCount int If non-negative this is the number of colours in the base palette for a colour-blended palette.
data byte The optional data for the raster.
리턴 System

SetColor() 공개 메소드

Set the colour index to write.
public SetColor ( int color ) : void
color int
리턴 void

SetColor() 공개 메소드

Set a dithered colour index to write.
public SetColor ( int colorA, int colorB ) : void
colorA int
colorB int
리턴 void

Unlock() 공개 메소드

Stop drawing to the bitmap, flushing the changes.
public Unlock ( ) : void
리턴 void