ImageInfo
public struct ImageInfo
Describes pixel dimensions and encoding. Bitmap, Image, Pixmap, and Surface
can be created from ImageInfo. ImageInfo can be retrieved from Bitmap and
Pixmap, but not from Image and Surface. For example, Image and Surface
implementations may defer pixel depth, so may not completely specify ImageInfo.
ImageInfo contains dimensions, the pixel integral width and height. It encodes
how pixel bits describe alpha, transparency; color components red, blue,
and green; and ColorSpace, the range and linearity of colors.
-
Returns pixel count in each row.
Declaration
Swift
public var width: Int32 -
Returns pixel row count (height)
Declaration
Swift
public var height: Int32 -
Returns the colortype for this ImageInfo
Declaration
Swift
public var colorType: ColorType -
Returns the alpha type
Declaration
Swift
public var alphaType: AlphaType -
Returns SkColorSpace, the range of colors - the returned value is immutable
Declaration
Swift
public var colorSpace: ColorSpace? -
Creates
ImageInfofrom integral dimensions width and height,ColorType,AlphaType, and optionally `ColorSpace.If
ColorSpacecs isnilandImageInfois part of drawing source:ColorSpacedefaults to sRGB, mapping intoSurfaceColorSpace.Parameters are not validated to see if their values are legal, or that the combination is supported.
Declaration
Swift
public init(width: Int32, height: Int32, colorType: ColorType, alphaType: AlphaType, colorSpace: ColorSpace? = nil)Parameters
widthpixel column count; must be zero or greater
heightpixel row count; must be zero or greater
colorTypethe colortype
alphaTypethe alpha type
colorSpacerange of colors; may be
nilReturn Value
created
ImageInfo -
Creates
ImageInfofrom integral dimensions width and height The returned imageInfo sets the colorType to the default platform color type (rgb8888) and thealphaTypeis set to.premuland the colorspace is set tonilParameters are not validated to see if their values are legal, or that the combination is supported.
Declaration
Swift
public init(_ width: Int32, _ height: Int32)Return Value
created
ImageInfo -
Number of bits used by the colorType (this is bytesPerPixel multiplied by 8)
Declaration
Swift
public var bitsPerPixel: Int32 { get } -
Returns the number of bytes necesary to allocate the image of the
widthxheightthat usesbytesPerPixelto store the data.Declaration
Swift
public var bytesSize: Int { get } -
Returns the number of bytes necessary to store one row of pixels
Declaration
Swift
public var rowBytes: Int { get } -
Returns true if
alphaTypeis set to hint that all pixels are opaque; their alpha value is implicitly or explicitly 1.0. If true, and all pixels are not opaque, Skia may draw incorrectly.Does not check if
colorTypeallows alpha, or if any pixel value has transparency.Declaration
Swift
public var isOpaque: Bool { get } -
Returns a new ImageInfo instance that has the width and height changed per the specified parameters
Declaration
Swift
public func withDimensions(width: Int32, height: Int32) -> ImageInfo -
Returns a new ImageInfo instance that has the colorType changed with the specified parameter
Declaration
Swift
public func withColorType(_ colorType: ColorType) -> ImageInfo -
Returns a new ImageInfo instance that has the colorSpace changed with the specified parameter
Declaration
Swift
public func withColorSpace(_ colorSpace: ColorSpace?) -> ImageInfo -
Returns a new ImageInfo instance that has the colorSpace changed with the specified parameter
Declaration
Swift
public func withAlphaType(_ alphaType: AlphaType) -> ImageInfo
View on GitHub
Install in Dash
ImageInfo Structure Reference