Public Member Functions | Static Public Member Functions | Public Attributes | Properties

Romulus.Nes.CompositePalette Struct Reference

Represents a 16-color composite of four 4-color palettes. This acts as a complete background or sprite palette. More...

List of all members.

Public Member Functions

 CompositePalette (byte[] data, int offset)
 Creates a palette object backed a ROM image or another existing buffer.
 CompositePalette (byte[] data, pHRom offset)
 Creates a ROM-backed palette object.
void SetPalette (SinglePalette pal, int index)
 Copies the specified single palette into this composite palette.
SinglePalette GetPaletteData (int index)
 Gets a copy of a section of this palette as a SinglePalette. Changes made to the copy will not be reflected in the original palette or ROM image.
SinglePalette GetPalette (int index)
 Gets a SinglePalette that references this composite palette. Modifications to the returned object will be reflected in this CompositePalette.
CompositePalette CreateCopy ()
 Creates an indepentant copy of this palette with its own buffer.
void Overwrite (CompositePalette data)
 Copies the specified palette into this palette.
void ApplyToBitmap (Bitmap b, int index)
 Applies this palette to an 8-bit paletted bitmap.
void ApplyToBitmap (Bitmap b, int index, ColorFilter filter)
 Applies this palette to an 8-bit paletted bitmap.

Static Public Member Functions

static CompositePalette CreateNewPalette ()
 Returns a new palette with its own buffer.

Public Attributes

const int Size = 16
 The number of colors in a composite palette.
const int SinglePaletteCount = 4
 The number of single palettes in a composite palette.
readonly byte[] data
 The buffer the palette data is stored in. This can be either a ROM image or a local buffer.
readonly int offset
 The location within the buffer of the palette data.

Properties

bool IsEmpty [get]
 Returns true if this object is not initialized.
int this [int index] [get, set]
 Gets/sets an individual color entry from one of the four palettes.
bool UsesLocalBuffer [get]
 Returns true if this palette is backed by its own private buffer. A return value of false indigates that this palette references the buffer of a ROM image or a CompositePalette.

Detailed Description

Represents a 16-color composite of four 4-color palettes. This acts as a complete background or sprite palette.


Constructor & Destructor Documentation

Romulus.Nes.CompositePalette.CompositePalette ( byte[]  data,
int  offset 
)

Creates a palette object backed a ROM image or another existing buffer.

Parameters:
data Rom image or buffer.
offset Offset within the buffer.
Romulus.Nes.CompositePalette.CompositePalette ( byte[]  data,
pHRom  offset 
)

Creates a ROM-backed palette object.

Parameters:
data Rom image or buffer.
offset Offset within the buffer.

Member Function Documentation

void Romulus.Nes.CompositePalette.ApplyToBitmap ( Bitmap  b,
int  index 
)

Applies this palette to an 8-bit paletted bitmap.

Parameters:
b The bitmap to apply the palette to.
index The palette index of the target bitmap that specifies where in the color table this palette will be written to.
void Romulus.Nes.CompositePalette.ApplyToBitmap ( Bitmap  b,
int  index,
ColorFilter  filter 
)

Applies this palette to an 8-bit paletted bitmap.

Parameters:
b The bitmap to apply the palette to.
index The palette index of the target bitmap that specifies where in the color table this palette will be written to.
filter A function that modifies the colors applied to the bitmap.
CompositePalette Romulus.Nes.CompositePalette.CreateCopy (  ) 

Creates an indepentant copy of this palette with its own buffer.

static CompositePalette Romulus.Nes.CompositePalette.CreateNewPalette (  )  [static]

Returns a new palette with its own buffer.

Returns:
A new palette with its own buffer.
SinglePalette Romulus.Nes.CompositePalette.GetPalette ( int  index  ) 

Gets a SinglePalette that references this composite palette. Modifications to the returned object will be reflected in this CompositePalette.

Parameters:
index The index of the palette to get.
Returns:
A SinglePalette that references this palette.
SinglePalette Romulus.Nes.CompositePalette.GetPaletteData ( int  index  ) 

Gets a copy of a section of this palette as a SinglePalette. Changes made to the copy will not be reflected in the original palette or ROM image.

Parameters:
index The index of the palette to get.
Returns:
A SinglePalette with its own buffer.
void Romulus.Nes.CompositePalette.Overwrite ( CompositePalette  data  ) 

Copies the specified palette into this palette.

Parameters:
data The palette data to copy.
void Romulus.Nes.CompositePalette.SetPalette ( SinglePalette  pal,
int  index 
)

Copies the specified single palette into this composite palette.

Parameters:
pal The palette to copy data from.
index An index, from 0 to 3, that specifies which palette should be overwritten.

Member Data Documentation

The buffer the palette data is stored in. This can be either a ROM image or a local buffer.

The location within the buffer of the palette data.

The number of single palettes in a composite palette.

The number of colors in a composite palette.


Property Documentation

bool Romulus.Nes.CompositePalette.IsEmpty [get]

Returns true if this object is not initialized.

int Romulus.Nes.CompositePalette.this[int index] [get, set]

Gets/sets an individual color entry from one of the four palettes.

Parameters:
index An index from 0 to 15 identifying one of the entries in the palette.
Returns:
The color index specified by one of the palette's entries.
bool Romulus.Nes.CompositePalette.UsesLocalBuffer [get]

Returns true if this palette is backed by its own private buffer. A return value of false indigates that this palette references the buffer of a ROM image or a CompositePalette.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events