public BitmapV5Header(BinaryReader rdr) { bV5Size = rdr.ReadUInt32(); bV5Width = rdr.ReadInt32(); bV5Height = rdr.ReadInt32(); bV5Planes = rdr.ReadUInt16(); bV5BitCount = rdr.ReadUInt16(); bV5Compression = (BiCompression)rdr.ReadUInt32(); bV5SizeImage = rdr.ReadUInt32(); bV5XPelsPerMeter = rdr.ReadInt32(); bV5YPelsPerMeter = rdr.ReadInt32(); bV5ClrUsed = rdr.ReadUInt32(); bV5ClrImportant = rdr.ReadUInt32(); bV5RedMask = rdr.ReadUInt32(); bV5GreenMask = rdr.ReadUInt32(); bV5BlueMask = rdr.ReadUInt32(); bV5AlphaMask = rdr.ReadUInt32(); bV5CSType = rdr.ReadUInt32(); bV5Endpoints = new CieXyzTriple(rdr); bV5GammaRed = rdr.ReadUInt32(); bV5GammaGreen = rdr.ReadUInt32(); bV5GammaBlue = rdr.ReadUInt32(); bV5Intent = rdr.ReadUInt32(); bV5ProfileData = rdr.ReadUInt32(); bV5ProfileSize = rdr.ReadUInt32(); bV5Reserved = rdr.ReadUInt32(); }
private static uint GetColorTableSize(ushort nofColors, BiCompression compression) { if (compression == BiCompression.BiBitFields) // C Original: // return (sizeof(DWORD) * 3) + (DIBNumColors (lpbih) * sizeof (RGBQUAD)); // return (4 * 3) + (nofColors * 4) { return(12 + nofColors * (uint)Marshal.SizeOf(typeof(RgbQuad))); } return(nofColors * (uint)Marshal.SizeOf(typeof(RgbQuad))); }
public BitmapInfoHeader(BinaryReader rdr) { biSize = rdr.ReadUInt32(); biWidth = rdr.ReadInt32(); biHeight = rdr.ReadInt32(); biPlanes = rdr.ReadUInt16(); biBitCount = rdr.ReadUInt16(); biCompression = (BiCompression)rdr.ReadUInt32(); biSizeImage = rdr.ReadUInt32(); biXPelsPerMeter = rdr.ReadInt32(); biYPelsPerMeter = rdr.ReadInt32(); biClrUsed = rdr.ReadUInt32(); biClrImportant = rdr.ReadUInt32(); }
private static UInt32 GetColorTableSize(UInt16 nofColors, BiCompression compression) { if (compression == BiCompression.BiBitFields) { // C Original: // return (sizeof(DWORD) * 3) + (DIBNumColors (lpbih) * sizeof (RGBQUAD)); // return (4 * 3) + (nofColors * 4) return(12 + nofColors * (uint)Marshal.SizeOf(typeof(RgbQuad))); } else // what about RLE, PNG, and JPEG compression? { return(nofColors * (uint)Marshal.SizeOf(typeof(RgbQuad))); } }
public BitmapV4Header(BinaryReader rdr) { bV4Size = rdr.ReadUInt32(); bV4Width = rdr.ReadInt32(); bV4Height = rdr.ReadInt32(); bV4Planes = rdr.ReadUInt16(); bV4BitCount = rdr.ReadUInt16(); bV4Compression = (BiCompression)rdr.ReadUInt32(); bV4SizeImage = rdr.ReadUInt32(); bV4XPelsPerMeter = rdr.ReadInt32(); bV4YPelsPerMeter = rdr.ReadInt32(); bV4ClrUsed = rdr.ReadUInt32(); bV4ClrImportant = rdr.ReadUInt32(); bV4RedMask = rdr.ReadUInt32(); bV4GreenMask = rdr.ReadUInt32(); bV4BlueMask = rdr.ReadUInt32(); bV4AlphaMask = rdr.ReadUInt32(); bV4CSType = rdr.ReadUInt32(); bV4Endpoints = new CieXyzTriple(rdr); bV4GammaRed = rdr.ReadUInt32(); bV4GammaGreen = rdr.ReadUInt32(); bV4GammaBlue = rdr.ReadUInt32(); }