protected override void ReadChunkData(DjvuReader reader) { Width = reader.ReadInt16MSB(); Height = reader.ReadInt16MSB(); MinorVersion = reader.ReadSByte(); MajorVersion = reader.ReadSByte(); DPI = reader.ReadInt16(); // LSB Gamma = (float)reader.ReadByte() / 10; sbyte flag = reader.ReadSByte(); // B[3..0] PageRotation = (PageRotations)(flag & 0x07); }
protected override void ReadChunkData(DjvuReader reader) { sbyte flagByte = reader.ReadSByte(); // B[7] IsBundled = (flagByte >> 7) == 1; // B[6..0] Version = flagByte & 127; int count = reader.ReadInt16MSB(); ReadComponentData(reader, count); }
/// <summary> /// Decodes the palette data /// </summary> /// <param name="reader"></param> private void ReadPaletteData(DjvuReader reader) { sbyte header = reader.ReadSByte(); bool isShapeTable = (header >> 7) == 1; _version = header & 127; int paletteSize = reader.ReadInt16MSB(); // Read in the palette colors List <Pixel> paletteColors = new List <Pixel>(); for (int x = 0; x < paletteSize; x++) { sbyte b = reader.ReadSByte(); sbyte g = reader.ReadSByte(); sbyte r = reader.ReadSByte(); paletteColors.Add(new Pixel(b, g, r)); } _paletteColors = paletteColors.ToArray(); if (isShapeTable == true) { int totalBlits = reader.ReadInt24MSB(); DjvuReader compressed = reader.GetBZZEncodedReader(); // Read in the blit colors List <int> blitColors = new List <int>(); for (int x = 0; x < totalBlits; x++) { int index = compressed.ReadInt16MSB(); blitColors.Add(index); } _blitColors = blitColors.ToArray(); } }
/// <summary> /// Decodes the palette data /// </summary> /// <param name="reader"></param> private void ReadPaletteData(DjvuReader reader) { sbyte header = reader.ReadSByte(); bool isShapeTable = (header >> 7) == 1; _version = header & 127; int paletteSize = reader.ReadInt16MSB(); // Read in the palette colors List<Pixel> paletteColors = new List<Pixel>(); for (int x = 0; x < paletteSize; x++) { sbyte b = reader.ReadSByte(); sbyte g = reader.ReadSByte(); sbyte r = reader.ReadSByte(); paletteColors.Add(new Pixel(b, g, r)); } _paletteColors = paletteColors.ToArray(); if (isShapeTable == true) { int totalBlits = reader.ReadInt24MSB(); DjvuReader compressed = reader.GetBZZEncodedReader(); // Read in the blit colors List<int> blitColors = new List<int>(); for (int x = 0; x < totalBlits; x++) { int index = compressed.ReadInt16MSB(); blitColors.Add(index); } _blitColors = blitColors.ToArray(); } }