Exemplo n.º 1
0
        /// <inheritdoc />
        public override UncompressedVolume CreatePreview(ushort minification, IProgress <VolumeSliceDefinition> progress = null, CancellationToken ct = default(CancellationToken))
        {
            if (_CompressedData[Direction.Z] == null)
            {
                throw new NotSupportedException(Resources.GetResource <Volume>("CompressedDataMissing_ErrorText"));
            }

            using (var input = new MemoryStream(_CompressedData[Direction.Z], false))
            {
                var inputWrapper   = new StreamWrapper(input);
                var previewCreator = new PreviewCreator(Metadata, minification, progress, ct);

                var error = ( VolumeError )DecompressVolume(inputWrapper.Interop, previewCreator.Interop);
                if (error != VolumeError.Success)
                {
                    throw new VolumeException(error, Resources.FormatResource <Volume>("Decompression_ErrorText", error));
                }

                return(previewCreator.GetPreview());
            }
        }
Exemplo n.º 2
0
 /// <inheritdoc />
 public override UncompressedVolume CreatePreview(ushort minification, IProgress <VolumeSliceDefinition> progress = null, CancellationToken ct = default(CancellationToken))
 {
     return(PreviewCreator.CreatePreview(Data, Metadata, minification));
 }