/// <summary> /// Saves a document to a stream respecting the properties /// </summary> protected override void OnSaveT(Document input, Stream output, PropertyBasedSaveConfigToken token, Surface scratchSurface, ProgressEventHandler progressCallback) { int quality = token.GetProperty <Int32Property>(PropertyNames.Quality).Value; CompressionSpeed compressionSpeed = (CompressionSpeed)token.GetProperty(PropertyNames.CompressionSpeed).Value; YUVChromaSubsampling chromaSubsampling = (YUVChromaSubsampling)token.GetProperty(PropertyNames.YUVChromaSubsampling).Value; bool preserveExistingTileSize = token.GetProperty <BooleanProperty>(PropertyNames.PreserveExistingTileSize).Value; AvifFile.Save(input, output, quality, compressionSpeed, chromaSubsampling, preserveExistingTileSize, this.maxEncoderThreadsOverride, scratchSurface, progressCallback, this.byteArrayPool.Value); }
/// <summary> /// Creates a document from a stream /// </summary> protected override Document OnLoad(Stream input) { return(AvifFile.Load(input, this.byteArrayPool.Value)); }