private TimPalettes(TimPalettesHeader palettesHeader, BitmapPalette[] palettes) { Exceptions.CheckArgumentNull(palettesHeader, "palettesHeader"); Exceptions.CheckArgumentNull(palettes, "palettes"); PalettesHeader = palettesHeader; Palettes = palettes; }
private static BitmapPalette ReadPalette(TimPalettesHeader palettesHeader, Stream input) { byte[] buff = new byte[2]; Color[] colors = new Color[palettesHeader.ColorsPerPalette]; for (int i = 0; i < colors.Length; i++) { colors[i] = ColorsHelper.ReadColor(input, buff); } return(new BitmapPalette(colors)); }
private static TimPalettes Read(TimHeader header, Stream input) { TimPalettesHeader palettesHeader = TimPalettesHeader.Read(input); BitmapPalette[] palettes = new BitmapPalette[palettesHeader.PalettesCount]; for (int i = 0; i < palettes.Length; i++) { palettes[i] = ReadPalette(palettesHeader, input); } return(new TimPalettes(palettesHeader, palettes)); }