public MemoryBitmap ToBitmap() { var mbmp = new MemoryBitmap(Width, Height); mbmp.Lock(); for (uint y = 0; y < Height; y++) { for (uint x = 0; x < Width; x++) { byte val = Data[y * Width + x]; var color = new RGB888(Palette[val]); mbmp[x, y] = color; } } return mbmp; }
public static ushort PackValueFromColor888(RGB888 Color) { return PackValueFromRGB888(Color.R, Color.G, Color.B); }
public static RGB565 ToRGB565(RGB888 Color) { return new RGB565((byte)(Color.R >> 3), (byte)(Color.G >> 2), (byte)(Color.B >> 3)); }
public static int SquareDifference(RGB888 Color0, RGB888 Color1) { return SquareDifference(Color0.R, Color0.G, Color0.B, Color1.R, Color1.G, Color1.B); }
public int SquareDifference(RGB888 Color) { return SquareDifference(this, Color); }
public static RGB888 Multiply(RGB888 Color, float Multiplier) { byte r, g, b; Multiply(Color.R, Color.G, Color.B, Multiplier, out r, out g, out b); return new RGB888(r, g, b, Color.Transparent); }
public static RGB888 Subtract(RGB888 Color0, RGB888 Color1) { byte r, g, b; Subtract(Color0.R, Color0.G, Color0.B, Color1.R, Color1.G, Color1.B, out r, out g, out b); return new RGB888(r, g, b, Color0.Transparent || Color1.Transparent); }
public RGB888 Subtract(RGB888 Color) { return Subtract(this, Color); }
public RGB888 Add(RGB888 Color) { return Add(this, Color); }