C# Класс Alexandria.Raster

An indexed raster image that can be useful for a variety of systems.
Показать файл Открыть проект

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