Skip to content

Commit e5537b0

Browse files
committed
update docs
1 parent 7005f53 commit e5537b0

File tree

10 files changed

+147
-27
lines changed

10 files changed

+147
-27
lines changed

building.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ git submodule update --remote
2121
The projects can then be built as normal with Visual Studio or dotnet CLI. The NuGet packages are built only under the `Dist` build configuration.
2222

2323
```
24-
dotnet build -c Dist
24+
dotnet build src\MagicScaler -c Dist
2525
```

license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2015-2019 Clinton Ingram and Contributors
3+
Copyright (c) 2015-2020 Clinton Ingram and Contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/MagicScaler/Core/Enums.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public enum HybridScaleMode
5050
/// <summary>Defines the modes that control <a href="http://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/">gamma correction</a> in pixel blending.</summary>
5151
public enum GammaMode
5252
{
53-
/// <summary>Convert values to linear RGB before blending.</summary>
53+
/// <summary>Convert values to linear RGB before blending. This is more mathematically correct and more visually pleasing in most cases.</summary>
5454
Linear,
55-
/// <summary>Blend gamma-companded R'G'B' values directly.</summary>
55+
/// <summary>Blend gamma-companded R'G'B' values directly. This is usually a poor choice but may be used for compatibility with other software or where speed is more important than image quality.</summary>
5656
Companded,
5757
/// <summary>Same as <see cref="Companded" />.</summary>
5858
[Obsolete("Replaced by " + nameof(GammaMode) + "." + nameof(Companded), true), EditorBrowsable(EditorBrowsableState.Never)]
@@ -86,6 +86,7 @@ public enum ColorProfileMode
8686
/// <summary>Convert the input image to the <a href="https://en.wikipedia.org/wiki/SRGB">sRGB color space</a> during processing. Output an untagged sRGB image.</summary>
8787
Normalize,
8888
/// <summary>Convert the input image to the <a href="https://en.wikipedia.org/wiki/SRGB">sRGB color space</a> during processing. Embed a compact sRGB profile in the output.</summary>
89+
/// <remarks>This option ensures maximum compatibility with web browsers and other software but results in slightly larger (+456 bytes) output files.</remarks>
8990
NormalizeAndEmbed,
9091
/// <summary>Preserve the input image color space during processing. Embed the ICC profile in the output image. If the output format does not support embedded profiles, it will be discarded.</summary>
9192
Preserve,
@@ -117,11 +118,11 @@ public enum Orientation
117118
/// <summary>Defines the modes that control <a href="https://magnushoff.com/jpeg-orientation.html">Exif Orientation</a> correction.</summary>
118119
public enum OrientationMode
119120
{
120-
/// <summary>Correct the image orientation according to the Exif tag on load. Save the output in normal orientation.</summary>
121+
/// <summary>Correct the image orientation according to the Exif tag on load. Save the output in normal orientation. This option ensures maximum compatibility with viewer software.</summary>
121122
Normalize,
122123
/// <summary>Preserve the orientation of the input image and tag the output image to reflect the orientation. If the output format does not support orientation tagging, it will be discarded.</summary>
123124
Preserve,
124-
/// <summary>Ignore any orientation tag and treat the image as if its stored orientation is normal. Do not tag the output image.</summary>
125+
/// <summary>Ignore any orientation tag and treat the image as if its stored orientation is normal. Do not tag the output image. This option should only be used if the Exif orientation of the input image is known to be incorrect.</summary>
125126
Ignore = 0xff
126127
}
127128

src/MagicScaler/Core/Interfaces.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,35 @@ public interface IPixelSource
2626
/// <summary>A single image frame within an <see cref="IImageContainer" /></summary>
2727
public interface IImageFrame : IDisposable
2828
{
29-
/// <summary>The horizontal resolution of the image frame, in dots/pixels per inch. If the frame source has no resolution information, a default value of 72 or 96 is suitable.</summary>
29+
/// <summary>The horizontal resolution of the image frame, in dots/pixels per inch.</summary>
30+
/// <remarks>Implementation note: If the frame source has no resolution information, a default value of 72 or 96 is suitable.</remarks>
3031
double DpiX { get; }
3132

32-
/// <summary>The vertical resolution of the image frame, in dots/pixels per inch. If the frame source has no resolution information, a default value of 72 or 96 is suitable.</summary>
33+
/// <summary>The vertical resolution of the image frame, in dots/pixels per inch.</summary>
34+
/// <remarks>Implementation note: If the frame source has no resolution information, a default value of 72 or 96 is suitable.</remarks>
3335
double DpiY { get; }
3436

35-
/// <summary>The <see cref="Orientation"/> of the image frame. If the frame source has no orientation information, a default value of <see cref="Orientation.Normal"/> is suitable.</summary>
37+
/// <summary>The <see cref="Orientation"/> of the image frame.</summary>
38+
/// <remarks>Implementation note: If the frame source has no orientation information, a default value of <see cref="Orientation.Normal"/> is suitable.</remarks>
3639
Orientation ExifOrientation { get; }
3740

38-
/// <summary>The <a href="https://en.wikipedia.org/wiki/ICC_profile">ICC color profile</a> that describes the color space of the image frame. If this value is <see cref="ReadOnlySpan{T}.Empty" />, colors will be interpreted as <a href="https://en.wikipedia.org/wiki/SRGB">sRGB or sYCC</a>.</summary>
41+
/// <summary>The <a href="https://en.wikipedia.org/wiki/ICC_profile">ICC color profile</a> that describes the color space of the image frame.</summary>
42+
/// <remarks>If this value is <see cref="ReadOnlySpan{T}.Empty" />, colors will be interpreted as <a href="https://en.wikipedia.org/wiki/SRGB">sRGB or sYCC</a>.</remarks>
3943
ReadOnlySpan<byte> IccProfile { get; }
4044

4145
/// <summary>The <see cref="IPixelSource" /> to retrieve pixels from this image frame.</summary>
4246
IPixelSource PixelSource { get; }
4347
}
4448

4549
/// <summary>An image frame within an <see cref="IImageContainer" />. The frame exposes 3 <see cref="IPixelSource" /> values, representing the Y', Cb, and Cr planes.</summary>
50+
/// <remarks>Implementation note: The <see cref="PixelSource" /> property should return the Y (luma) plane.</remarks>
4651
public interface IYccImageFrame : IImageFrame
4752
{
4853
/// <summary>The position of subsampled chroma components relative to their associated luma components.</summary>
4954
ChromaPosition ChromaPosition { get; }
5055

51-
/// <summary>A 3x3 matrix containing the coefficients for converting from R'G'B' to the Y'CbCr format of this image frame. The fourth row and column will be ignored. See <see cref="YccMatrix" /> for standard values.</summary>
56+
/// <summary>A 3x3 matrix containing the coefficients for converting from R'G'B' to the Y'CbCr format of this image frame.</summary>
57+
/// <remarks>The fourth row and column will be ignored. See <see cref="YccMatrix" /> for standard values.</remarks>
5258
Matrix4x4 RgbYccMatrix { get; }
5359

5460
/// <summary>True if the encoding uses the full 0-255 range for pixel values, false if it uses video range (16-235 luma and 16-240 chroma).</summary>

src/MagicScaler/Core/PixelFormats.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,20 +348,26 @@ private static ReadOnlyDictionary<Guid, PixelFormat> getFormatCache()
348348
public static class PixelFormats
349349
{
350350
/// <summary>Greyscale data with 1 byte per pixel.</summary>
351+
/// <value>6FDDC324-4E03-4BFE-B185-3D77768DC908</value>
351352
public static readonly Guid Grey8bpp = Consts.GUID_WICPixelFormat8bppGray;
352353
/// <summary>RGB data with 1 byte per channel in BGR byte order.</summary>
354+
/// <value>6FDDC324-4E03-4BFE-B185-3D77768DC90C</value>
353355
public static readonly Guid Bgr24bpp = Consts.GUID_WICPixelFormat24bppBGR;
354356
/// <summary>RGBA data with 1 byte per channel in BGRA byte order.</summary>
357+
/// <value>6FDDC324-4E03-4BFE-B185-3D77768DC90F</value>
355358
public static readonly Guid Bgra32bpp = Consts.GUID_WICPixelFormat32bppBGRA;
356359

357360
/// <summary>Contains standard pixel formats for <see cref="IYccImageFrame"/> implementations.</summary>
358361
public static class Planar
359362
{
360363
/// <summary>Planar luma data with 1 byte per pixel.</summary>
364+
/// <value>91B4DB54-2DF9-42F0-B449-2909BB3DF88E</value>
361365
public static readonly Guid Y8bpp = Consts.GUID_WICPixelFormat8bppY;
362366
/// <summary>Planar blue-yellow chroma data with 1 byte per pixel.</summary>
367+
/// <value>1339F224-6BFE-4C3E-9302E4F3A6D0CA2A</value>
363368
public static readonly Guid Cb8bpp = Consts.GUID_WICPixelFormat8bppCb;
364369
/// <summary>Planar red-green chroma data with 1 byte per pixel.</summary>
370+
/// <value>B8145053-2116-49F0-8835ED844B205C51</value>
365371
public static readonly Guid Cr8bpp = Consts.GUID_WICPixelFormat8bppCr;
366372
}
367373
}

src/MagicScaler/Core/ProcessImageResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public ProcessingPipeline AddTransform(IPixelTransform transform)
139139
}
140140

141141
/// <summary>Completes processing of the pipeline, writing the output image to <paramref name="outStream" />.</summary>
142-
/// <param name="outStream">The stream to which the output image will be written.</param>
142+
/// <param name="outStream">The stream to which the output image will be written. The stream must allow Seek and Write.</param>
143143
/// <returns>A <see cref="ProcessImageResult" /> containing the settings used and basic instrumentation for the pipeline.</returns>
144144
public ProcessImageResult WriteOutput(Stream outStream) => MagicImageProcessor.WriteOutput(Context, outStream);
145145

0 commit comments

Comments
 (0)