示例#1
0
 public Mipmap(Resource resource, int layerId, int mipmapId)
 {
     Dll.image_info_mipmap(resource.Id, mipmapId, out var width, out var height, out var depth);
     Depth  = depth;
     Width  = width;
     Height = height;
     Bytes  = Dll.image_get_mipmap(resource.Id, layerId, mipmapId, out var size);
     Size   = size;
 }
示例#2
0
        public override MipInfo GetMipmap(LayerMipmapSlice lm)
        {
            var res = new MipInfo();

            Dll.image_info_mipmap(Resource.Id, lm.Mipmap, out res.Size.X, out res.Size.Y, out res.Size.Z);
#if DEBUG
            var expected = Size.GetMip(lm.Mipmap);
            Debug.Assert(expected.Width == res.Size.Width);
            Debug.Assert(expected.Height == res.Size.Height);
            Debug.Assert(expected.Depth == res.Size.Depth);
#endif

            res.Bytes = Dll.image_get_mipmap(Resource.Id, lm.Layer, lm.Mipmap, out res.ByteSize);

            return(res);
        }