|
3 | 3 |
|
4 | 4 | using System.Buffers.Binary; |
5 | 5 | using SixLabors.ImageSharp.Formats.Webp.Lossy; |
6 | | -using SixLabors.ImageSharp.Metadata.Profiles.Exif; |
7 | | -using SixLabors.ImageSharp.Metadata.Profiles.Icc; |
8 | | -using SixLabors.ImageSharp.Metadata.Profiles.Xmp; |
9 | 6 |
|
10 | 7 | namespace SixLabors.ImageSharp.Formats.Webp.BitWriter; |
11 | 8 |
|
@@ -394,56 +391,8 @@ private void Flush() |
394 | 391 | } |
395 | 392 | } |
396 | 393 |
|
397 | | - /// <summary> |
398 | | - /// Write the trunks before data trunk. |
399 | | - /// </summary> |
400 | | - /// <remarks>Think of it as a static method — none of the other members are called except for <see cref="BitWriterBase.scratchBuffer"/></remarks> |
401 | | - /// <param name="stream">The stream to write to.</param> |
402 | | - /// <param name="width">The width of the image.</param> |
403 | | - /// <param name="height">The height of the image.</param> |
404 | | - /// <param name="exifProfile">The exif profile.</param> |
405 | | - /// <param name="xmpProfile">The XMP profile.</param> |
406 | | - /// <param name="iccProfile">The color profile.</param> |
407 | | - /// <param name="hasAlpha">Flag indicating, if a alpha channel is present.</param> |
408 | | - /// <param name="alphaData">The alpha channel data.</param> |
409 | | - /// <param name="alphaDataIsCompressed">Indicates, if the alpha data is compressed.</param> |
410 | | - public void WriteTrunksBeforeData( |
411 | | - Stream stream, |
412 | | - uint width, |
413 | | - uint height, |
414 | | - ExifProfile? exifProfile, |
415 | | - XmpProfile? xmpProfile, |
416 | | - IccProfile? iccProfile, |
417 | | - bool hasAlpha, |
418 | | - Span<byte> alphaData, |
419 | | - bool alphaDataIsCompressed) |
420 | | - { |
421 | | - // Write file size later |
422 | | - this.WriteRiffHeader(stream, 0); |
423 | | - |
424 | | - // Write VP8X, header if necessary. |
425 | | - bool isVp8X = exifProfile != null || xmpProfile != null || iccProfile != null || hasAlpha; |
426 | | - if (isVp8X) |
427 | | - { |
428 | | - this.WriteVp8XHeader(stream, exifProfile, xmpProfile, iccProfile, width, height, hasAlpha); |
429 | | - |
430 | | - if (iccProfile != null) |
431 | | - { |
432 | | - this.WriteColorProfile(stream, iccProfile.ToByteArray()); |
433 | | - } |
434 | | - |
435 | | - if (hasAlpha) |
436 | | - { |
437 | | - this.WriteAlphaChunk(stream, alphaData, alphaDataIsCompressed); |
438 | | - } |
439 | | - } |
440 | | - } |
441 | | - |
442 | | - /// <summary> |
443 | | - /// Writes the encoded image to the stream. |
444 | | - /// </summary> |
445 | | - /// <param name="stream">The stream to write to.</param> |
446 | | - public void WriteEncodedImageToStream(Stream stream) |
| 394 | + /// <inheritdoc /> |
| 395 | + public override void WriteEncodedImageToStream(Stream stream) |
447 | 396 | { |
448 | 397 | uint numBytes = (uint)this.NumBytes; |
449 | 398 |
|
@@ -474,31 +423,6 @@ public void WriteEncodedImageToStream(Stream stream) |
474 | 423 | } |
475 | 424 | } |
476 | 425 |
|
477 | | - /// <summary> |
478 | | - /// Write the trunks after data trunk. |
479 | | - /// </summary> |
480 | | - /// <remarks>Think of it as a static method — none of the other members are called except for <see cref="BitWriterBase.scratchBuffer"/></remarks> |
481 | | - /// <param name="stream">The stream to write to.</param> |
482 | | - /// <param name="exifProfile">The exif profile.</param> |
483 | | - /// <param name="xmpProfile">The XMP profile.</param> |
484 | | - public void WriteTrunksAfterData( |
485 | | - Stream stream, |
486 | | - ExifProfile? exifProfile, |
487 | | - XmpProfile? xmpProfile) |
488 | | - { |
489 | | - if (exifProfile != null) |
490 | | - { |
491 | | - this.WriteMetadataProfile(stream, exifProfile.ToByteArray(), WebpChunkType.Exif); |
492 | | - } |
493 | | - |
494 | | - if (xmpProfile != null) |
495 | | - { |
496 | | - this.WriteMetadataProfile(stream, xmpProfile.Data, WebpChunkType.Xmp); |
497 | | - } |
498 | | - |
499 | | - OverwriteFileSize(stream); |
500 | | - } |
501 | | - |
502 | 426 | private uint GeneratePartition0() |
503 | 427 | { |
504 | 428 | this.PutBitUniform(0); // colorspace |
|
0 commit comments