Structs

The following structs are available globally.

  • Softens edges and applies a pleasant glow to an image.

    See more

    Declaration

    Swift

    public struct Bloom: Filter
  • Generates a checkerboard pattern

    let image = Image(frame: canvas.frame)
    image.generate(Checkerboard())
    canvas.add(image)
    
    See more

    Declaration

    Swift

    public struct Checkerboard: Generator
  • Darkens the background image samples to reflect the source image samples.

    The following example uses an image to burn itself. let logo = Image("logo") var colorburn = ColorBurn() colorburn.background = logo logo.apply(colorburn) canvas.add(logo)

    See more

    Declaration

    Swift

    public struct ColorBurn: Filter
  • Simulates the dot patterns of a halftone screen.

    let logo = Image("logo")
    logo.apply(DotScreen())
    canvas.add(logo)
    
    See more

    Declaration

    Swift

    public struct DotScreen: Filter
  • Spreads source pixels by an amount specified by a Gaussian distribution.

    let logo = Image("logo")
    logo.apply(GaussianBlur())
    canvas.add(logo)
    
    See more

    Declaration

    Swift

    public struct GaussianBlur: Filter
  • Hue

    Changes the overall hue, or tint, of the source pixels.

    See more

    Declaration

    Swift

    public struct Hue: Filter
  • Generates a gradient that varies along a linear axis between two defined endpoints.

    let logo = Image(frame: canvas.frame)
    var gradient = LinearGradient()
    gradient.points = [logo.origin,logo.frame.max]
    logo.generate(gradient)
    canvas.add(logo)
    
    See more

    Declaration

    Swift

    public struct LinearGradient: Generator
  • A structure of 4 8-bit values that represent r, g, b, a values of a single point (i.e. a pixel)

    See more

    Declaration

    Swift

    public struct Pixel
  • A structure that contains a point in a two-dimensional coordinate system.

    See more

    Declaration

    Swift

    public struct Point: Equatable, CustomStringConvertible
  • A structure that contains the location and dimensions of a rectangle.

    See more

    Declaration

    Swift

    public struct Rect: Equatable, CustomStringConvertible
  • Maps the colors of an image to various shades of brown.

    let logo = Image("logo")
    logo.apply(Sepia())
    canvas.add(logo)
    
    See more

    Declaration

    Swift

    public struct Sepia: Filter
  • Increases image detail by sharpening.

    See more

    Declaration

    Swift

    public struct Sharpen: Filter
  • A structure that contains width and height values. Values stored as Double, otherwise synonymous with CGSize.

    See more

    Declaration

    Swift

    public struct Size: Equatable, Comparable, CustomStringConvertible
  • A structure for holding a transform matrix.

    Transform can translate, rotate, scale.

    See more

    Declaration

    Swift

    public struct Transform: Equatable
  • Rotates pixels around a point to give a twirling effect.

    let logo = Image("logo")
    logo.apply(Twirl())
    canvas.add(logo)
    
    See more

    Declaration

    Swift

    public struct Twirl: Filter
  • The Vector class is used for coordinate values and direction vectors.

    See more

    Declaration

    Swift

    public struct Vector: Equatable, CustomStringConvertible
  • Defines a structure representing the border of a View.

    See more

    Declaration

    Swift

    public struct Border
  • Defines a structure representing the border of a View.

    See more

    Declaration

    Swift

    public struct Shadow
  • A structure representing the characteristics of spring motion.

    See more

    Declaration

    Swift

    public struct Spring