public override ImageData Read(IBinaryStream file, ImageMetaData info) { var meta = (G24MetaData)info; file.Position = 0x30; var reader = new G24Reader(file); var pixels = reader.Unpack(); if ('a' == meta.Type) { byte p = pixels[pixels.Length - 1]; for (int i = pixels.Length - 2; i >= 0; --i) { p += pixels[i]; pixels[i] = p; } } return(ImageData.CreateFlipped(info, PixelFormats.Gray8, null, pixels, (int)info.Width)); }
public override ImageData Read(IBinaryStream file, ImageMetaData info) { file.Position = 0x2C; var reader = new G24Reader(file); var pixels = reader.Unpack(); byte b = pixels[0]; byte g = pixels[1]; byte r = pixels[2]; for (int i = 3; i < pixels.Length; i += 3) { pixels[i] += b; pixels[i + 1] += g; pixels[i + 2] += r; b = pixels[i]; g = pixels[i + 1]; r = pixels[i + 2]; } return(ImageData.CreateFlipped(info, PixelFormats.Bgr24, null, pixels, (int)info.Width * 3)); }