示例#1
0
        /// <summary>
        /// Reads the dds file header from the stream.
        /// </summary>
        /// <param name="stream">The <see cref="Stream"/> containing texture data.</param>
        private void ReadFileHeader(Stream stream)
        {
            // Discard the magic bytes, we already know at this point its a ktx2 file.
            stream.Position += Ktx2Constants.MagicBytes.Length;

            byte[] ktxHeaderBuffer = new byte[Ktx2Constants.KtxHeaderSize];
            stream.Read(ktxHeaderBuffer, 0, Ktx2Constants.KtxHeaderSize);

            this.ktxHeader = Ktx2Header.Parse(ktxHeaderBuffer);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="Ktx2Processor" /> class.
 /// </summary>
 /// <param name="ktxHeader">The KTX header.</param>
 public Ktx2Processor(Ktx2Header ktxHeader) => this.KtxHeader = ktxHeader;