Initializerswift-png 4.4.5PNG
init(density:)
Creates a physical dimensions descriptor.
PNG.PhysicalDimensions.swift:35init(density: (x: Int, y: Int, unit: Unit?))
Parameters
- density
The number of pixels in each dimension per the given
unit
of measurement.If
unit
isnil
, the pixel density is unknown, and thex
andy
values specify the pixel aspect ratio only.
Other members in extension
Types
enum Unit
A unit of measurement.
Type members
init(parsing: [UInt8]
) throws Creates a physical dimensions descriptor by parsing the given chunk data.
Instance members
let density: (x: Int, y: Int, unit: Unit?)
The number of pixels in each dimension per the given
unit
of measurement.var description: String
var serialized: [UInt8]
Encodes this physical dimensions descriptor as the contents of a
pHYs
chunk.