Initializerswift-png 4.4.5PNG
init(frequencies:palette:)
Creates a palette histogram.
PNG.Histogram.swift:32init(frequencies: [UInt16], palette: PNG.Palette)
Parameters
- frequencies
The frequency of each palette entry in the image. The ith frequency value corresponds to the ith palette entry. This array must have the the exact same number of elements as entries in the image palette. Passing an array of the wrong length will result in a precondition failure.
- palette
The image palette this histogram provides frequency information for.
This initializer validates the background information against the given image palette.
Other members in extension
Type members
init(parsing: [UInt8], palette: PNG.Palette
) throws Creates a palette histogram by parsing the given chunk data, validating it according to the given image
palette
.
Instance members
var description: String
let frequencies: [UInt16]
The frequency values of this histogram.
var serialized: [UInt8]
Encodes this histogram as the contents of a
hIST
chunk.