2012-06-01 19:53:14 +00:00
|
|
|
#region === Copyright (c) 2010 Pascal van der Heiden ===
|
|
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer
|
|
|
|
{
|
|
|
|
internal class Palette
|
|
|
|
{
|
|
|
|
// Members
|
2014-09-11 11:51:02 +00:00
|
|
|
private readonly int[] colors;
|
2012-06-01 19:53:14 +00:00
|
|
|
|
|
|
|
// Properties
|
|
|
|
public int[] Colors { get { return colors; } }
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
public Palette(Bitmap bmp)
|
|
|
|
{
|
|
|
|
// Initialize
|
|
|
|
colors = new int[bmp.Size.Width];
|
|
|
|
for(int x = 0; x < bmp.Size.Width; x++)
|
2014-09-11 11:51:02 +00:00
|
|
|
colors[x] = bmp.GetPixel(x, 0).ToArgb();
|
2012-06-01 19:53:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This overrides a color
|
|
|
|
public void SetColor(int index, int color)
|
|
|
|
{
|
|
|
|
colors[index] = color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|