コード例 #1
0
        public ulong GetTotalSize()
        {
            ulong totalSize = 0;

            for (int mipLevel = 0; mipLevel < Header.NumberOfMipmapLevels; mipLevel++)
            {
                for (int face = 0; face < Header.NumberOfFaces; face++)
                {
                    KtxMipmap mipmap = Faces[face].Mipmaps[mipLevel];
                    totalSize += mipmap.SizeInBytes;
                }
            }

            return(totalSize);
        }
コード例 #2
0
        public byte[] GetAllTextureData()
        {
            byte[] result = new byte[GetTotalSize()];
            uint   start  = 0;

            for (int face = 0; face < Header.NumberOfFaces; face++)
            {
                for (int mipLevel = 0; mipLevel < Header.NumberOfMipmapLevels; mipLevel++)
                {
                    KtxMipmap mipmap = Faces[face].Mipmaps[mipLevel];
                    mipmap.Data.CopyTo(result, (int)start);
                    start += mipmap.SizeInBytes;
                }
            }

            return(result);
        }