diff --git a/Sources/PNG/ColorTargets/PNG.Data.Rectangular (ext).swift b/Sources/PNG/ColorTargets/PNG.Data.Rectangular (ext).swift index 84146079..db715135 100644 --- a/Sources/PNG/ColorTargets/PNG.Data.Rectangular (ext).swift +++ b/Sources/PNG/ColorTargets/PNG.Data.Rectangular (ext).swift @@ -171,10 +171,10 @@ extension PNG.Data.Rectangular /// Unpacks this image to a pixel array, using a custom deindexing /// function. /// - _ : Color.Type - /// A color target type. This type provides the ``(Color).unpack(_:of:deindexer:)`` + /// A color target type. This type provides the ``Color/unpack(_:of:deindexer:)`` /// implementation used to unpack the image data. /// - deindexer : ([(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)]) -> (Swift.Int) -> Color.Aggregate - /// A function which uses the palette entries in the color ``(Layout).format`` to + /// A function which uses the palette entries in the color ``Layout/format`` to /// generate a dereferencing function. This function is only expected to /// be invoked if [`layout``(Layout).format`] is an indexed format. /// @@ -201,29 +201,29 @@ extension PNG.Data.Rectangular /// Unpacks this image to a scalar pixel array, using a custom deindexing /// function. /// - /// For an image with a grayscale-alpha color ``(Layout).format``, + /// For an image with a grayscale-alpha color ``Layout/format``, /// this function selects the *v* component from pixels of the form (*v*, *a*) /// - /// For an image with an RGB color ``(Layout).format``, + /// For an image with an RGB color ``Layout/format``, /// this function selects the *r* component from pixels of the form (*r*, *g*, *b*). /// - /// For an image with an RGBA color ``(Layout).format``, this function selects the *r* component from + /// For an image with an RGBA color ``Layout/format``, this function selects the *r* component from /// pixels of the form (*r*, *g*, *b*, *a*). /// - /// For an image with a BGR color ``(Layout).format``, + /// For an image with a BGR color ``Layout/format``, /// this function selects the *r* component from pixels of the form (*b*, *g*, *r*). /// - /// For an image with a BGRA color ``(Layout).format``, + /// For an image with a BGRA color ``Layout/format``, /// this function selects the *r* component from pixels of the form (*b*, *g*, *r*, *a*). /// /// This function ignores chroma keys, as its scalar color target is not /// capable of representing transparency. The unpacked components /// are scaled to fill the range of `T`, according to the color depth - /// computed from the color ``(Layout).format``. + /// computed from the color ``Layout/format``. /// - _ : T.Type /// A scalar color target type. /// - deindexer : ([(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)]) -> (Swift.Int) -> Swift.UInt8 - /// A function which uses the palette entries in the color ``(Layout).format`` to + /// A function which uses the palette entries in the color ``Layout/format`` to /// generate a dereferencing function. This function will only /// be invoked if [`layout``(Layout).format`] is an indexed format. /// @@ -251,7 +251,7 @@ extension PNG.Data.Rectangular /// - pixels : [Color] /// A pixel array. Its elements are arranged in row-major order. The /// first pixel in this array corresponds to the top-left corner of - /// the image. The `Color` type provides the ``(Color).pack(_:as:indexer:)`` + /// the image. The `Color` type provides the ``Color/pack(_:as:indexer:)`` /// implementation used to pack the image data. /// /// The length of this array must match `size.x * size.y`. Passing an @@ -264,9 +264,9 @@ extension PNG.Data.Rectangular /// - metadata : Metadata /// A metadata structure. The default value is an empty metadata structure. /// - indexer : ([(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)]) -> (Color.Aggregate) -> Swift.Int - /// A function which uses the palette entries in the color ``(Layout).format`` to + /// A function which uses the palette entries in the color ``Layout/format`` to /// generate a referencing function. This function is only expected to - /// be invoked if the image color ``(Layout).format`` is an indexed format. + /// be invoked if the image color ``Layout/format`` is an indexed format. /// /// See the [indexed color tutorial](https://github.com/tayloraswift/swift-png/tree/master/examples#using-indexed-images) /// for more about the semantics of this function. @@ -292,15 +292,15 @@ extension PNG.Data.Rectangular /// Creates an image from a scalar pixel array, using a custom indexing /// function. /// - /// For an image with a grayscale-alpha color ``(Layout).format``, + /// For an image with a grayscale-alpha color ``Layout/format``, /// this function assigns the gray channel to the given scalars, and /// sets the alpha channel to `T.max`. /// - /// For an image with an RGB or BGR color ``(Layout).format``, + /// For an image with an RGB or BGR color ``Layout/format``, /// this function assigns all channels to the given scalars, replicating /// each scalar three times. /// - /// For an image with an RGBA or BGRA color ``(Layout).format``, this + /// For an image with an RGBA or BGRA color ``Layout/format``, this /// function assigns all opaque channels to the given scalars, replicating /// each scalar three times, and sets the alpha channel to `T.max`. /// @@ -320,9 +320,9 @@ extension PNG.Data.Rectangular /// - metadata : Metadata /// A metadata structure. The default value is an empty metadata structure. /// - indexer : ([(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)]) -> (Swift.UInt8) -> Swift.Int - /// A function which uses the palette entries in the color ``(Layout).format`` to + /// A function which uses the palette entries in the color ``Layout/format`` to /// generate a referencing function. This function will only - /// be invoked if the image color ``(Layout).format`` is an indexed format. + /// be invoked if the image color ``Layout/format`` is an indexed format. /// /// See the [indexed color tutorial](https://github.com/tayloraswift/swift-png/tree/master/examples#using-indexed-images) /// for more about the semantics of this function. @@ -350,7 +350,7 @@ extension PNG.Data.Rectangular /// @ inlinable /// Unpacks this image to a pixel array. /// - _ : Color.Type - /// A color target type. This type provides the ``(Color).unpack(_:of:)`` + /// A color target type. This type provides the ``Color/unpack(_:of:)`` /// implementation used to unpack the image data. /// - -> : [Color] /// A pixel array. Its elements are arranged in row-major order. The @@ -371,7 +371,7 @@ extension PNG.Data.Rectangular /// - pixels : [Color] /// A pixel array. Its elements are arranged in row-major order. The /// first pixel in this array corresponds to the top-left corner of - /// the image. The `Color` type provides the ``(Color).pack(_:as:)`` + /// the image. The `Color` type provides the ``Color/pack(_:as:)`` /// implementation used to pack the image data. /// /// The length of this array must match `size.x * size.y`. Passing an @@ -403,30 +403,30 @@ extension PNG.Data.Rectangular /// @ inlinable /// Unpacks this image to a scalar pixel array. /// - /// For an image with a grayscale-alpha color ``(Layout).format``, + /// For an image with a grayscale-alpha color ``Layout/format``, /// this function selects the *v* component from pixels of the form (*v*, *a*) /// - /// For an image with an RGB color ``(Layout).format``, + /// For an image with an RGB color ``Layout/format``, /// this function selects the *r* component from pixels of the form (*r*, *g*, *b*). /// - /// For an image with an indexed color ``(Layout).format``, + /// For an image with an indexed color ``Layout/format``, /// this function selects the *r* component from palette entries of the /// form (*r*, *g*, *b*, *a*). The palette entry is chosen by taking the /// *i*th element in the palette, from pixels of the form (*i*). /// - /// For an image with an RGBA color ``(Layout).format``, this function + /// For an image with an RGBA color ``Layout/format``, this function /// selects the *r* component from pixels of the form (*r*, *g*, *b*, *a*). /// - /// For an image with a BGR color ``(Layout).format``, + /// For an image with a BGR color ``Layout/format``, /// this function selects the *r* component from pixels of the form (*b*, *g*, *r*). /// - /// For an image with a BGRA color ``(Layout).format``, + /// For an image with a BGRA color ``Layout/format``, /// this function selects the *r* component from pixels of the form (*b*, *g*, *r*, *a*). /// /// This function ignores chroma keys, as its scalar color target is not /// capable of representing transparency. The unpacked components /// are scaled to fill the range of `T`, according to the color depth - /// computed from the color ``(Layout).format``. + /// computed from the color ``Layout/format``. /// - _ : T.Type /// A scalar color target type. /// - -> : [T] @@ -452,22 +452,22 @@ extension PNG.Data.Rectangular /// @ inlinable /// Creates an image from a scalar pixel array. /// - /// For an image with a grayscale-alpha color ``(Layout).format``, + /// For an image with a grayscale-alpha color ``Layout/format``, /// this function assigns the gray channel to the given scalars, and /// sets the alpha channel to `T.max`. /// - /// For an image with an indexed color ``(Layout).format``, + /// For an image with an indexed color ``Layout/format``, /// this function expands the given scalars, each of the form (*v*), to /// RGBA quadruplets (*v*, *v*, *v*, `T.max`), and assigns the index /// channel to the index of a matching palette entry. If more than one /// palette entry matches, the matching entry is chosen arbitrarily. /// If no palette entries match, the first palette entry is chosen. /// - /// For an image with an RGB or BGR color ``(Layout).format``, + /// For an image with an RGB or BGR color ``Layout/format``, /// this function assigns all channels to the given scalars, replicating /// each scalar three times. /// - /// For an image with an RGBA or BGRA color ``(Layout).format``, this + /// For an image with an RGBA or BGRA color ``Layout/format``, this /// function assigns all opaque channels to the given scalars, replicating /// each scalar three times, and sets the alpha channel to `T.max`. /// diff --git a/Sources/PNG/ColorTargets/PNG.RGBA.swift b/Sources/PNG/ColorTargets/PNG.RGBA.swift index e28e0fc6..b723ec6b 100644 --- a/Sources/PNG/ColorTargets/PNG.RGBA.swift +++ b/Sources/PNG/ColorTargets/PNG.RGBA.swift @@ -123,7 +123,7 @@ extension PNG.RGBA /// Creates an RGBA color from a grayscale-alpha color. /// /// This function is equivalent to calling ``init(_:_:)`` with - /// the ``(VA).v`` and ``(VA).a`` components of `va`. + /// the ``VA/v`` and ``VA/a`` components of `va`. /// - va : VA /// A grayscale-alpha color. @inlinable @@ -284,13 +284,13 @@ extension PNG.RGBA:PNG.Color /// computed from the color `format`. /// - interleaved : [Swift.UInt8] /// An image data buffer. It is expected to be obtained from the - /// ``(Data.Rectangular).storage`` property of a ``(Data).Rectangular`` + /// ``Data.Rectangular/storage`` property of a ``Data/Rectangular`` /// image. /// - format : Format /// The color format associated with the given data buffer. /// It is expected to be obtained from the the /// [`(Data.Rectangular).layout``(Layout).format`] property of a - /// ``(Data).Rectangular`` image. + /// ``Data/Rectangular`` image. /// - deindexer : ([(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)]) -> (Swift.Int) -> Aggregate /// A function which uses the palette entries in the color `format` to /// generate a dereferencing function. This function is only invoked @@ -441,7 +441,7 @@ extension PNG.RGBA:PNG.Color /// The color format to pack the given pixels as in the returned data buffer. /// /// When the library uses an implementation of this function to construct - /// a ``(Data).Rectangular`` image, this color format will be stored in + /// a ``Data/Rectangular`` image, this color format will be stored in /// its [`(Data.Rectangular).layout``(Layout).format`] property. /// - indexer : ([(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)]) -> (Aggregate) -> Swift.Int /// A function which uses the palette entries in the color `format` to @@ -457,8 +457,8 @@ extension PNG.RGBA:PNG.Color /// necessarily in the same order within each individual pixel.) /// /// When the library uses an implementation of this function to construct - /// a ``(Data).Rectangular`` image, this data buffer will be stored in - /// its ``(Data.Rectangular).storage`` property. + /// a ``Data/Rectangular`` image, this data buffer will be stored in + /// its ``Data.Rectangular/storage`` property. @_specialize(where T == UInt8) @_specialize(where T == UInt16) @_specialize(where T == UInt32) diff --git a/Sources/PNG/ColorTargets/PNG.VA.swift b/Sources/PNG/ColorTargets/PNG.VA.swift index d424820e..4606a91c 100644 --- a/Sources/PNG/ColorTargets/PNG.VA.swift +++ b/Sources/PNG/ColorTargets/PNG.VA.swift @@ -195,13 +195,13 @@ extension PNG.VA:PNG.Color /// computed from the color `format`. /// - interleaved : [Swift.UInt8] /// An image data buffer. It is expected to be obtained from the - /// ``(Data.Rectangular).storage`` property of a ``(Data).Rectangular`` + /// ``Data.Rectangular/storage`` property of a ``Data/Rectangular`` /// image. /// - format : Format /// The color format associated with the given data buffer. /// It is expected to be obtained from the the /// [`(Data.Rectangular).layout``(Layout).format`] property of a - /// ``(Data).Rectangular`` image. + /// ``Data/Rectangular`` image. /// - deindexer : ([(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)]) -> (Swift.Int) -> Aggregate /// A function which uses the palette entries in the color `format` to /// generate a dereferencing function. This function is only invoked @@ -353,7 +353,7 @@ extension PNG.VA:PNG.Color /// The color format to pack the given pixels as in the returned data buffer. /// /// When the library uses an implementation of this function to construct - /// a ``(Data).Rectangular`` image, this color format will be stored in + /// a ``Data/Rectangular`` image, this color format will be stored in /// its [`(Data.Rectangular).layout``(Layout).format`] property. /// - indexer : ([(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)]) -> (Aggregate) -> Swift.Int /// A function which uses the palette entries in the color `format` to @@ -368,8 +368,8 @@ extension PNG.VA:PNG.Color /// in the same order as the pixels in the `pixels` array. /// /// When the library uses an implementation of this function to construct - /// a ``(Data).Rectangular`` image, this data buffer will be stored in - /// its ``(Data.Rectangular).storage`` property. + /// a ``Data/Rectangular`` image, this data buffer will be stored in + /// its ``Data.Rectangular/storage`` property. @_specialize(where T == UInt8) @_specialize(where T == UInt16) @_specialize(where T == UInt32) diff --git a/Sources/PNG/Decoding/PNG.Context.swift b/Sources/PNG/Decoding/PNG.Context.swift index 79b92f2b..0f781c03 100644 --- a/Sources/PNG/Decoding/PNG.Context.swift +++ b/Sources/PNG/Decoding/PNG.Context.swift @@ -27,8 +27,8 @@ extension PNG.Context /// It is expected that client applications will initialize a decoding /// context upon encountering the first ``Chunk/IDAT`` chunk in the image. /// - standard : Standard - /// The PNG standard of the image being decoded. This should be ``(Standard).ios`` - /// if the image began with a ``Chunk/CgBI`` chunk, and ``(Standard).common`` + /// The PNG standard of the image being decoded. This should be ``Standard/ios`` + /// if the image began with a ``Chunk/CgBI`` chunk, and ``Standard/common`` /// otherwise. /// - header : Header /// The header of the image being decoded. This is expected to have been @@ -50,7 +50,7 @@ extension PNG.Context /// previously-encountered ancillary chunks, with the exception of /// ``Chunk/bKGD`` and ``Chunk/tRNS``. /// - uninitialized : Swift.Bool - /// Specifies if the ``image`` ``(Data.Rectangular).storage`` should + /// Specifies if the ``image`` ``Data.Rectangular/storage`` should /// be initialized. If `false`, the storage buffer will be initialized /// to all zeros. This can be safely set to `true` if there is no need /// to access the image while it is in a partially-decoded state. @@ -87,7 +87,7 @@ extension PNG.Context /// - overdraw : Swift.Bool /// If `true`, pixels that are not yet available will be filled-in /// with values from nearby available pixels. This option only has an - /// effect for ``(Layout).interlaced`` images. + /// effect for ``Layout/interlaced`` images. /// /// The default value is `false`. /// ## () @@ -110,7 +110,7 @@ extension PNG.Context /// mutating func PNG.Context.push(ancillary:) /// throws /// Parses an ancillary chunk appearing after the last ``Chunk/IDAT`` - /// chunk, and adds it to the ``image`` ``(Data.Rectangular).metadata``. + /// chunk, and adds it to the ``image`` ``Data.Rectangular/metadata``. /// /// This function validates the multiplicity of the given `chunk`, and /// its chunk ordering with respect to the ``Chunk/IDAT`` chunks. The diff --git a/Sources/PNG/Layout/PNG.Data.Rectangular.swift b/Sources/PNG/Layout/PNG.Data.Rectangular.swift index 79456506..e95f5301 100644 --- a/Sources/PNG/Layout/PNG.Data.Rectangular.swift +++ b/Sources/PNG/Layout/PNG.Data.Rectangular.swift @@ -67,7 +67,7 @@ extension PNG.Data /// samples. The pixels are arranged in row-major order, where the /// beginning of the storage array corresponds to the visual top-left /// corner of the image, regardless of whether the ``layout`` is - /// ``(Layout).interlaced`` or not. + /// ``Layout/interlaced`` or not. public private(set) var storage:[UInt8] @@ -129,8 +129,8 @@ extension PNG.Data.Rectangular /// - layout : Layout /// The new image layout. /// - /// Both the original color ``(Layout).format`` and the new - /// color ``(Layout).format`` must be of the same enumeration case, though the fields + /// Both the original color ``Layout/format`` and the new + /// color ``Layout/format`` must be of the same enumeration case, though the fields /// may differ. The exceptions are the indexed color formats, which require /// the lengths of their `palette` payloads to match exactly. /// - -> : Self diff --git a/Sources/PNG/Lexing/_PNGBytestreamDestination.swift b/Sources/PNG/Lexing/_PNGBytestreamDestination.swift index 7295a779..ffeb1bd4 100644 --- a/Sources/PNG/Lexing/_PNGBytestreamDestination.swift +++ b/Sources/PNG/Lexing/_PNGBytestreamDestination.swift @@ -4,7 +4,7 @@ import CRC /// A destination bytestream. /// /// To implement a custom data destination type, conform it to this protocol by -/// implementing ``(Destination).write(_:)``. It can +/// implementing ``Destination/write(_:)``. It can /// then be used with the library’s core compression interfaces. /// # [Stream interface](file-io-destination-interface) /// # [See also](file-io-protocols, system-file-destination) diff --git a/Sources/PNG/Lexing/_PNGBytestreamSource.swift b/Sources/PNG/Lexing/_PNGBytestreamSource.swift index 7f4ba07f..b1d7accf 100644 --- a/Sources/PNG/Lexing/_PNGBytestreamSource.swift +++ b/Sources/PNG/Lexing/_PNGBytestreamSource.swift @@ -4,7 +4,7 @@ import CRC /// A source bytestream. /// /// To implement a custom data source type, conform it to this protocol by -/// implementing ``(Source).read(count:)``. It can +/// implementing ``Source/read(count:)``. It can /// then be used with the library’s core decompression interfaces. /// # [Stream interface](file-io-source-interface) /// # [See also](file-io-protocols, system-file-source) diff --git a/Sources/PNG/Parsing/PNG.Background.swift b/Sources/PNG/Parsing/PNG.Background.swift index 7348a7da..6cac6447 100644 --- a/Sources/PNG/Parsing/PNG.Background.swift +++ b/Sources/PNG/Parsing/PNG.Background.swift @@ -7,7 +7,7 @@ extension PNG /// This information is used to populate the `fill` field in /// an image color ``Format``. /// - /// The value of this descriptor is stored in the ``(PNG.Background).case`` + /// The value of this descriptor is stored in the ``PNG.Background/case`` /// property, after validation. /// # [Parsing and serialization](background-parsing-and-serialization) /// # [See also](parsed-chunk-types) @@ -65,7 +65,7 @@ extension PNG.Background /// - case : Case /// A background descriptor value. /// - /// If this parameter is a ``(Case).v(_:)`` or ``(Case).rgb(_:)`` case, + /// If this parameter is a ``Case/v(_:)`` or ``Case/rgb(_:)`` case, /// the samples in its background color payload must fall within the /// range determined by the image color depth. Passing an enumeration /// case with an invalid background sample will result in a precondition @@ -78,13 +78,13 @@ extension PNG.Background /// The palette of the image this background descriptor is to be /// used for. /// - /// If `case` is a ``(Case).palette(index:)`` case, this palette must + /// If `case` is a ``Case/palette(index:)`` case, this palette must /// not be `nil`, and the number of entries in it must be at least `1` - /// greater than the value of the ``(Case).palette(index:)`` payload. + /// greater than the value of the ``Case/palette(index:)`` payload. /// If the index payload is out of range, this function will suffer a /// precondition failure. /// - /// If `case` is a ``(Case).v(_:)`` or ``(Case).rgb(_:)`` case, + /// If `case` is a ``Case/v(_:)`` or ``Case/rgb(_:)`` case, /// this parameter is ignored. public init(case:Case, pixel:PNG.Format.Pixel, palette:PNG.Palette?) diff --git a/Sources/PNG/Parsing/PNG.Format.swift b/Sources/PNG/Parsing/PNG.Format.swift index 010c01af..7ae5cb36 100644 --- a/Sources/PNG/Parsing/PNG.Format.swift +++ b/Sources/PNG/Parsing/PNG.Format.swift @@ -33,11 +33,11 @@ extension PNG /// A pixel format specifies the color model and bit depth used by an /// image. They do not specify the ordering of the color samples within /// the internal representation of a PNG image. For example, the color formats - /// ``(Format).rgba8(palette:fill:)`` and ``(Format).bgra8(palette:fill:)`` - /// both correspond to the pixel format ``(Pixel).rgba8``. + /// ``Format/rgba8(palette:fill:)`` and ``Format/bgra8(palette:fill:)`` + /// both correspond to the pixel format ``Pixel/rgba8``. /// /// The pixel format associated with a color format can be accessed - /// through the ``(Format).pixel`` instance property. + /// through the ``Format/pixel`` instance property. /// # [Pixel formats](pixel-formats) /// # [See also](color-formats) /// ## (0:color-formats) @@ -168,7 +168,7 @@ extension PNG /// case PNG.Format.v1(fill:key:) /// A 1-bit grayscale color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).v1``. + /// This color format has a ``pixel`` format of ``Pixel/v1``. /// - fill : Swift.UInt8? /// An optional background color. The sample is unscaled, and must /// be in the range `0 ... 1`. Most PNG viewers ignore this field. @@ -181,7 +181,7 @@ extension PNG /// case PNG.Format.v2(fill:key:) /// A 2-bit grayscale color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).v2``. + /// This color format has a ``pixel`` format of ``Pixel/v2``. /// - fill : Swift.UInt8? /// An optional background color. The sample is unscaled, and must /// be in the range `0 ... 3`. Most PNG viewers ignore this field. @@ -194,7 +194,7 @@ extension PNG /// case PNG.Format.v4(fill:key:) /// A 4-bit grayscale color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).v4``. + /// This color format has a ``pixel`` format of ``Pixel/v4``. /// - fill : Swift.UInt8? /// An optional background color. The sample is unscaled, and must /// be in the range `0 ... 15`. Most PNG viewers ignore this field. @@ -207,7 +207,7 @@ extension PNG /// case PNG.Format.v8(fill:key:) /// An 8-bit grayscale color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).v8``. + /// This color format has a ``pixel`` format of ``Pixel/v8``. /// - fill : Swift.UInt8? /// An optional background color. Most PNG viewers ignore this field. /// - key : Swift.UInt8? @@ -218,7 +218,7 @@ extension PNG /// case PNG.Format.v16(fill:key:) /// A 16-bit grayscale color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).v16``. + /// This color format has a ``pixel`` format of ``Pixel/v16``. /// - fill : Swift.UInt16? /// An optional background color. Most PNG viewers ignore this field. /// - key : Swift.UInt16? @@ -230,7 +230,7 @@ extension PNG /// An 8-bit BGR color format. /// /// This color format is an iphone-optimized format. - /// It has a ``pixel`` format of ``(Pixel).rgb8``. + /// It has a ``pixel`` format of ``Pixel/rgb8``. /// - palette : [(b:Swift.UInt8, g:Swift.UInt8, r:Swift.UInt8)] /// An palette of suggested posterization values. Most PNG viewers /// ignore this field. @@ -247,7 +247,7 @@ extension PNG /// case PNG.Format.rgb8(palette:fill:key:) /// An 8-bit RGB color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).rgb8``. + /// This color format has a ``pixel`` format of ``Pixel/rgb8``. /// - palette : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8)] /// An palette of suggested posterization values. Most PNG viewers /// ignore this field. @@ -264,7 +264,7 @@ extension PNG /// case PNG.Format.rgb16(palette:fill:key:) /// A 16-bit RGB color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).rgb16``. + /// This color format has a ``pixel`` format of ``Pixel/rgb16``. /// - palette : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8)] /// An palette of suggested posterization values. Most PNG viewers /// ignore this field. Although the image color depth is `16`, the @@ -282,7 +282,7 @@ extension PNG /// case PNG.Format.indexed1(palette:fill:) /// A 1-bit indexed color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).indexed1``. + /// This color format has a ``pixel`` format of ``Pixel/indexed1``. /// - palette : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)] /// The palette values referenced by an image with this color format. /// This palette must be non-empty, and can have at most `2` entries. @@ -296,7 +296,7 @@ extension PNG /// case PNG.Format.indexed2(palette:fill:) /// A 2-bit indexed color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).indexed2``. + /// This color format has a ``pixel`` format of ``Pixel/indexed2``. /// - palette : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)] /// The palette values referenced by an image with this color format. /// This palette must be non-empty, and can have at most `4` entries. @@ -310,7 +310,7 @@ extension PNG /// case PNG.Format.indexed4(palette:fill:) /// A 4-bit indexed color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).indexed4``. + /// This color format has a ``pixel`` format of ``Pixel/indexed4``. /// - palette : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)] /// The palette values referenced by an image with this color format. /// This palette must be non-empty, and can have at most `16` entries. @@ -324,7 +324,7 @@ extension PNG /// case PNG.Format.indexed8(palette:fill:) /// An 8-bit indexed color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).indexed8``. + /// This color format has a ``pixel`` format of ``Pixel/indexed8``. /// - palette : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8, a:Swift.UInt8)] /// The palette values referenced by an image with this color format. /// This palette must be non-empty, and can have at most `256` entries. @@ -338,7 +338,7 @@ extension PNG /// case PNG.Format.va8(fill:) /// An 8-bit grayscale-alpha color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).va8``. + /// This color format has a ``pixel`` format of ``Pixel/va8``. /// - fill : Swift.UInt8? /// An optional background color. Most PNG viewers ignore this field. /// ## (grayscale-alpha-color-formats) @@ -346,7 +346,7 @@ extension PNG /// case PNG.Format.va16(fill:) /// A 16-bit grayscale-alpha color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).va16``. + /// This color format has a ``pixel`` format of ``Pixel/va16``. /// - fill : Swift.UInt16? /// An optional background color. Most PNG viewers ignore this field. /// ## (grayscale-alpha-color-formats) @@ -355,7 +355,7 @@ extension PNG /// An 8-bit BGRA color format. /// /// This color format is an iphone-optimized format. - /// It has a ``pixel`` format of ``(Pixel).rgba8``. + /// It has a ``pixel`` format of ``Pixel/rgba8``. /// - palette : [(b:Swift.UInt8, g:Swift.UInt8, r:Swift.UInt8)] /// An palette of suggested posterization values. Most PNG viewers /// ignore this field. @@ -369,7 +369,7 @@ extension PNG /// case PNG.Format.rgba8(palette:fill:) /// An 8-bit RGBA color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).rgba8``. + /// This color format has a ``pixel`` format of ``Pixel/rgba8``. /// - palette : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8)] /// An palette of suggested posterization values. Most PNG viewers /// ignore this field. @@ -383,7 +383,7 @@ extension PNG /// case PNG.Format.rgba16(palette:fill:) /// A 16-bit RGBA color format. /// - /// This color format has a ``pixel`` format of ``(Pixel).rgba16``. + /// This color format has a ``pixel`` format of ``Pixel/rgba16``. /// - palette : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8)] /// An palette of suggested posterization values. Most PNG viewers /// ignore this field. Although the image color depth is `16`, the diff --git a/Sources/PNG/Parsing/PNG.Header.swift b/Sources/PNG/Parsing/PNG.Header.swift index 890ee6ba..d8971900 100644 --- a/Sources/PNG/Parsing/PNG.Header.swift +++ b/Sources/PNG/Parsing/PNG.Header.swift @@ -39,8 +39,8 @@ extension PNG /// Specifies if the header is for a standard image, /// or an iphone-optimized image. /// - /// If `standard` is ``(Standard).ios``, then the `pixel` format - /// must be either ``(Format.Pixel).rgb8`` or ``(Format.Pixel).rgba8``. + /// If `standard` is ``Standard/ios``, then the `pixel` format + /// must be either ``Format.Pixel/rgb8`` or ``Format.Pixel/rgba8``. /// Otherwise, this initializer will suffer a precondition failure. public init(size:(x:Int, y:Int), pixel:PNG.Format.Pixel, interlaced:Bool, diff --git a/Sources/PNG/Parsing/PNG.Palette.swift b/Sources/PNG/Parsing/PNG.Palette.swift index d25220d6..b76b6d3d 100644 --- a/Sources/PNG/Parsing/PNG.Palette.swift +++ b/Sources/PNG/Parsing/PNG.Palette.swift @@ -27,7 +27,7 @@ extension PNG.Palette /// `pixel` format. /// - entries : [(r:Swift.UInt8, g:Swift.UInt8, b:Swift.UInt8)] /// An array of palette entries. This array must be non-empty, and can - /// contain at most `256`, or `1 << pixel.```(Format.Pixel).depth`` elements, + /// contain at most `256`, or `1 << pixel.```Format.Pixel/depth`` elements, /// whichever is lower. /// - pixel : Format.Pixel /// The pixel format of the image this palette is to be used for. diff --git a/Sources/PNG/Parsing/PNG.ParsingError.swift b/Sources/PNG/Parsing/PNG.ParsingError.swift index 705105f2..39e6ccf6 100644 --- a/Sources/PNG/Parsing/PNG.ParsingError.swift +++ b/Sources/PNG/Parsing/PNG.ParsingError.swift @@ -41,14 +41,14 @@ extension PNG /// according to the PNG standard used by the image. /// /// This error gets thrown when an iphone-optimized image - /// (``(Standard).ios``) has a pixel format that is not - /// ``(Format.Pixel).rgb8`` or ``(Format.Pixel).rgba8``. + /// (``Standard/ios``) has a pixel format that is not + /// ``Format.Pixel/rgb8`` or ``Format.Pixel/rgba8``. /// - _ : Format.Pixel /// The invalid pixel format. /// - standard : Standard /// The PNG standard. This error is only relevant for iphone-optimized /// images, so library-generated instances of this error case always have - /// this field set to ``(Standard).ios``. + /// this field set to ``Standard/ios``. /// ## (IHDR-parsing-errors) /// case PNG.ParsingError.invalidHeaderCompressionMethodCode(_:) diff --git a/Sources/PNG/Parsing/PNG.SignificantBits.swift b/Sources/PNG/Parsing/PNG.SignificantBits.swift index c29facf8..e366f144 100644 --- a/Sources/PNG/Parsing/PNG.SignificantBits.swift +++ b/Sources/PNG/Parsing/PNG.SignificantBits.swift @@ -48,7 +48,7 @@ extension PNG /// /// The meaning of a color precision descriptor is /// poorly-defined for BGR images. It is strongly recommended that - /// iphone-optimized images use ``(PNG).SignificantBits`` only if all + /// iphone-optimized images use ``PNG/SignificantBits`` only if all /// samples have the same precision. /// /// Each precision value must be greater than zero, and none of them @@ -63,7 +63,7 @@ extension PNG /// /// The meaning of a color precision descriptor is /// poorly-defined for BGRA images. It is strongly recommended that - /// iphone-optimized images use ``(PNG).SignificantBits`` only if all + /// iphone-optimized images use ``PNG/SignificantBits`` only if all /// samples have the same precision. /// /// Each precision value must be greater than zero, and none of them diff --git a/Sources/PNG/Parsing/PNG.Transparency.swift b/Sources/PNG/Parsing/PNG.Transparency.swift index 6739ee49..0079d78f 100644 --- a/Sources/PNG/Parsing/PNG.Transparency.swift +++ b/Sources/PNG/Parsing/PNG.Transparency.swift @@ -7,7 +7,7 @@ extension PNG /// This information either used to populate the `key` field in /// an image color ``Format``, or augment its `palette` field, when appropriate. /// - /// The value of this descriptor is stored in the ``(PNG.Transparency).case`` + /// The value of this descriptor is stored in the ``PNG.Transparency/case`` /// property, after validation. /// # [Parsing and serialization](transparency-parsing-and-serialization) /// # [See also](parsed-chunk-types) @@ -72,7 +72,7 @@ extension PNG.Transparency /// - case : Case /// A transparency descriptor value. /// - /// If this parameter is a ``(Case).v(key:)`` or ``(Case).rgb(key:)`` case, + /// If this parameter is a ``Case/v(key:)`` or ``Case/rgb(key:)`` case, /// the samples in its chroma key payload must fall within the /// range determined by the image color depth. Passing an enumeration /// case with an invalid chroma key sample will result in a precondition @@ -89,12 +89,12 @@ extension PNG.Transparency /// The palette of the image this transparency descriptor is to be /// used for. /// - /// If `case` is a ``(Case).palette(alpha:)`` case, this palette must + /// If `case` is a ``Case/palette(alpha:)`` case, this palette must /// not be `nil`, and must contain at least as many entries as the - /// number of alpha samples in the ``(Case).palette(alpha:)`` payload. + /// number of alpha samples in the ``Case/palette(alpha:)`` payload. /// Otherwise, this initializer will suffer a precondition failure. /// - /// If `case` is a ``(Case).v(key:)`` or ``(Case).rgb(key:)`` case, + /// If `case` is a ``Case/v(key:)`` or ``Case/rgb(key:)`` case, /// this parameter is ignored. public init(case:Case, pixel:PNG.Format.Pixel, palette:PNG.Palette?) diff --git a/Sources/PNG/_.docc/BasicDecoding/BasicDecoding.md b/Sources/PNG/_.docc/BasicDecoding/BasicDecoding.md index 757c90ca..daada2e5 100644 --- a/Sources/PNG/_.docc/BasicDecoding/BasicDecoding.md +++ b/Sources/PNG/_.docc/BasicDecoding/BasicDecoding.md @@ -8,11 +8,12 @@ Learn how to decompress a png file to its rectangular image representation, and @Snippet(id: "BasicDecoding", slice: "RGBA") -@Image(source: "BasicDecoding.png", alt: "output png") -{ - The example image, decoded to an rgba data file, and re-encoded as a png (for display purposes). +@Image(source: "BasicDecoding.png", alt: "output png") { + +The example image, decoded to an rgba data file, and re-encoded as a png (for display purposes). + +> source: [wikimedia commons](https://commons.wikimedia.org/wiki/File:Ada_Lovelace_portrait.jpg) - > source: [wikimedia commons](https://commons.wikimedia.org/wiki/File:Ada_Lovelace_portrait.jpg) } The element type of the output array, [`PNG.RGBA`](/PNG/RGBA), is called a **color target**. The pixels in the array are arranged in row-major order. The pixel in the top-left corner of the image is the first element of the array. @@ -21,9 +22,10 @@ We could also have unpacked the image pixels to the [`PNG.VA`](/PNG/VA) b @Snippet(id: "BasicDecoding", slice: "VA") -@Image(source: "BasicDecoding.png.va.png", alt: "output png") -{ - > The example image, decoded to an grayscale-alpha data file, and re-encoded as a png. +@Image(source: "BasicDecoding.png.va", alt: "output png") { + +> The example image, decoded to an grayscale-alpha data file, and re-encoded as a png. + }