What exactly does System.Drawing.Imaging.PixelFormat.Alpha represent anyone? Look like this is similar to OpenGL.GL_APHA which is depreciated.
I am trying to convert a line of Java code that looks like this:
TextureData textureData = new TextureData(GL.GL_ALPHA, size, size, 0, GL.GL_ALPHA,
GL.GL_UNSIGNED_BYTE, false, false, false, textureBytes.rewind(), null);
to its C# represenation.
I have defined a class to encapsulate Pixel format to allow me go back and forth between DirectX and OpenGL as follows:
public class PixelFormat
{
public static readonly PixelFormat R8 = new PixelFormat(8, 0, DataType.UnsignedByte);
public static readonly PixelFormat R5G5B5A1 = new PixelFormat(5, 1, DataType.UnsignedShort);
public bool IsColorPremultipliedByAlpha { get; private set; }
public bool IsCompressed { get; private set; }
public int Format { get; set; }
public double Gamma { get; private set; }
public int BitsPerPixel { get { return NumberOfRedBits + NumberOfGreenBits + NumberOfBlueBits; }}
public ushort NumberOfRedBits { get; private set; }
public ushort NumberOfGreenBits { get; private set; }
public ushort NumberOfBlueBits { get; private set; }
public ushort NumberOfAlphaBits { get; private set; }
public int IndexIntoColorPallete { get; set; }
public bool IsIndexed { get; set; }
public DataType DataType { get; set; }
public IndexedColorFormat IndexedColorFormat { get; set; }
public OpenglPixelAttributes GetOpenglConstant()
{
return null;
}
}
I will like to represent System.Drawing.Imaging.PixelFormat.Alpha or its OpenGL cousin using an instance of my PixelFormat class.
Anyone ideas?