Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
327 lines (304 sloc) 10.3 KB

Docs

README.md

Pixels

static let main: Pixels
weak var delegate: PixelsDelegate?
var fps: Int { get }
var fpsMax: Int { get }
var frame: Int { get }
var seconds: CGFloat { get }
var logLevel: LogLevel = .debug
var logLoopLimitActive = true
var logLoopLimitFrameCount = 10
var bits: PIX.Color.Bits = ._8
var colorSpace: PIX.Color.Space = .sRGB

PixelsDelegate

func pixelsFrameLoop()

PIX

var id = UUID()
var name: String?
weak var delegate: PIXDelegate?
let view: PIXView
var interpolate: InterpolateMode = .linear
var extend: ExtendMode = .zero
var renderedTexture: MTLTexture? { get }
var renderedImage: UIImage? { get }
var renderedPixels: PixelPack? { get }

PIXDelegate

func pixWillRender(_ pix: PIX)
func pixDidRender(_ pix: PIX)

PIXContent: PIX, PIXOut

PIXResource: PIXContent

CameraPIX

var camera: Camera = .back

ImagePIX

var image: UIImage?

VideoPIX

var url: URL?
var volume: CGFloat = 1
func load(fileNamed: String, withExtension: String)
func play()
func pause()
func seek(toTime: CMTime)
func seek(toFraction: CGFloat)
func restart()
func reset()

ScreenCapturePIX

var screenIndex: Int = 0

VectorPIX (coming soon)

TextPIX (coming soon)

PaintPIX (coming soon)

PIXGenerator: PIXContent

var res: Res
static var globalResMultiplier: CGFloat = 1
var premultiply: Bool = true

ColorPIX

var color: UIColor = .white

CirclePIX

var radius: CGFloat
var position: CGPoint = .zero
var edgeRadius: CGFloat = 0.0
var color: UIColor = .white
var edgeColor: UIColor = .gray
var bgColor: UIColor = .black

RectanglePIX

var size: CGSize
var position: CGPoint = .zero
var color: UIColor = .white
var bgColor: UIColor = .black

PolygonPIX

var radius: CGFloat = 0.25
var position: CGPoint = .zero
var rotation: CGFloat = 0.0
var vertexCount: Int = 6
var color: UIColor = .white
var bgColor: UIColor = .black

GradientPIX

var style: Style = .horizontal
var scale: CGFloat = 1.0
var offset: CGFloat = 0.0
var colorFirst: UIColor = .black
var colorLast: UIColor = .white
var extendGradient: ExtendMode = .repeat

NoisePIX

var seed: Int = 0
var octaves: Int = 7
var position: CGPoint = .zero
var zPosition: CGFloat = 0.0
var zoom: CGFloat = 1.0
var colored: Bool = false
var random: Bool = false

MetalPIX

var metalUniforms: [MetalUniform] = []

PIXSprite: PIXContent

var res: Res
var bgColor: UIColor

TextPIX

var text: String = "Pixels"
var textColor: UIColor = .white
var font: UIFont = UIFont.systemFont(ofSize: 100)
var position: CGPoint = .zero

PIXEffect: PIX, PIXIn, PIXOut

PIXSingleEffect: PIXEffect

var inPix: (PIX & PIXOut)?

NilPIX

ResPIX

var res: Res
var resMultiplier: CGFloat = 1.0
var inheritInRes: Bool = false
var placement: Placement = .aspectFit

PIXOut convenience funcs:
func reRes(to: PIX.Res) -> ResPIX
func reRes(by: CGFloat) -> ResPIX

LevelsPIX

var brightness: CGFloat = 1.0
var darkness: CGFloat = 0.0
var contrast: CGFloat = 0.0
var gamma: CGFloat = 1.0
var inverted: Bool = false
var opacity: CGFloat = 1.0

PIXOut convenience funcs:
func brightness(_: CGFloat) -> LevelsPIX
func darkness(_: CGFloat) -> LevelsPIX
func contrast(_: CGFloat) -> LevelsPIX
func gamma(_: CGFloat) -> LevelsPIX
func invert() -> LevelsPIX
func opacity(_: CGFloat) -> LevelsPIX

BlurPIX

var style: Style = .guassian
var radius: CGFloat = 0.5
var quality: SampleQualityMode = .mid
var angle: CGFloat = 0.0
var position: CGPoint = .zero

PIXOut convenience funcs:
func blur(_: CGFloat) -> BlurPIX

EdgePIX

var strength: CGFloat = 4.0
var distance: CGFloat = 1.0

PIXOut convenience funcs:
func edge() -> EdgePIX

ThresholdPIX

var threshold: CGFloat = 0.5
var smoothness: CGFloat = 0

PIXOut convenience funcs:
func threshold(at: CGFloat) -> ThresholdPIX

QuantizePIX

var fraction: CGFloat = 0.125

PIXOut convenience funcs:
func quantize(by: CGFloat) -> QuantizePIX

TransformPIX

var position: CGPoint = .zero
var rotation: CGFloat = 0.0
var scale: CGFloat = 1.0
var size: CGSize = CGSize(width: 1.0, height: 1.0)

PIXOut convenience funcs:
func position(at: CGPoint) -> TransformPIX
func rotatate(to: CGFloat) -> TransformPIX
func scale(by: CGFloat) -> TransformPIX

KaleidoscopePIX

var divisions: Int = 12
var mirror: Bool = true
var rotation: CGFloat = 0
var position: CGPoint = .zero

PIXOut convenience funcs:
func kaleidoscope(divisions: Int = 12, mirror: Bool = true) -> KaleidoscopePIX

TwirlPIX

var strength: CGFloat = 1

PIXOut convenience funcs:
func twirl(_: CGFloat) -> TwirlPIX

FeedbackPIX

var feedActive: Bool = true
var feedPix: (PIX & PIXOut)?

ChannelMixPIX

var red: PIX.Color = PIX.Color(pure: .red)
var green: PIX.Color = PIX.Color(pure: .green)
var blue: PIX.Color = PIX.Color(pure: .blue)
var alpha: PIX.Color = PIX.Color(pure: .alpha)

PIXOut convenience funcs:
func swap(_: PIX.Color.Pure, _: PIX.Color.Pure) -> ChannelMixPIX

ChromaKeyPIX

var keyColor: UIColor = .green
var range: CGFloat = 0.1
var softness: CGFloat = 0.1
var edgeDesaturation: CGFloat = 0.5

PIXOut convenience funcs:
func chromaKey(_: UIColor) -> ChromaKeyPIX

CornerPinPIX

var corners: Corners
var perspective: Bool = false
var divisions: Int = 16

HueSatPIX

var hue: CGFloat = 0.0
var saturation: CGFloat = 1.0

PIXOut convenience funcs:
func hue(_: CGFloat) -> HueSatPIX
func saturation(_: CGFloat) -> HueSatPIX

CropPIX

var cropFrame: CGRect = CGRect(x: 0, y: 0, width: 1, height: 1)

PIXOut convenience funcs:
func crop(_: CGRect) -> CropPIX

FlipFlopPIX

var flip: Flip? = nil
var flop: Flop? = nil

PIXOut convenience funcs:
func flipX() -> FlipFlopPIX
func flipY() -> FlipFlopPIX
func flopLeft() -> FlipFlopPIX
func flopRight() -> FlipFlopPIX

RangePIX

var inLow: CGFloat = 0.0
var inHigh: CGFloat = 1.0
var outLow: CGFloat = 0.0
var outHigh: CGFloat = 1.0
var inLowColor: UIColor = .clear
var inHighColor: UIColor = .white
var outLowColor: UIColor = .clear
var outHighColor: UIColor = .white
var ignoreAlpha: Bool = true

PIXOut convenience funcs:
func range(inLow: CGFloat = 0.0, inHigh: CGFloat = 1.0, outLow: CGFloat = 0.0, outHigh: CGFloat = 1.0) -> RangePIX
func range(inLow: UIColor = .clear, inHigh: UIColor = .white, outLow: UIColor = .clear, outHigh: UIColor = .white) -> RangePIX

SharpenPIX

var contrast: CGFloat = 1.0

PIXOut convenience funcs:
func sharpen(_: CGFloat = 1.0) -> SharpenPIX

SlopePIX

var amplitude: CGFloat = 1.0

PIXOut convenience funcs:
func slope(_: CGFloat = 1.0) - > SlopePIX

DelayPIX (coming soon)

MetalEffectPIX

var metalUniforms: [MetalUniform] = []

PIXMergerEffect: PIXEffect

var inPixA: (PIX & PIXOut)?
var inPixB: (PIX & PIXOut)?
var placement: Placement = .aspectFit

CrossPIX

var lerp: CGFloat = 0.5

BlendPIX

var blendingMode: BlendingMode = .add
var bypassTransform: Bool = false
var position: CGPoint = .zero
var rotation: CGFloat = 0.0
var scale: CGFloat = 1.0
var size: CGSize

LookupPIX

var axis: Axis = .x
var holdEdge: Bool = true

PIXOut convenience funcs:
func lookup(pix: PIX, axis: Axis) -> LookupPIX

LumaBlurPIX

var style: Style = .box
var radius: CGFloat = 0.5
var quality: SampleQualityMode = .mid
var angle: CGFloat = 0
var position: CGPoint = .zero

PIXOut convenience funcs:
func lumaBlur(pix: PIX, radius: CGFloat) -> LumaBlurPIX

DisplacePIX

var distance: CGFloat = 1.0
var origin: CGPoint = CGPoint(x: 0.5, y: 0.5)

PIXOut convenience funcs:
func displace(pix: PIX, distance: CGFloat) -> DisplacePIX

RemapPIX

PIXOut convenience funcs:
func remap(pix: PIX) -> RemapPIX

ReorderPIX

var redInput: Input = .a
var redChannel: Channel = .red
var greenInput: Input = .a
var greenChannel: Channel = .green
var blueInput: Input = .a
var blueChannel: Channel = .blue
var alphaInput: Input = .a
var alphaChannel: Channel = .alpha
var premultiply: Bool = true

TimeMachinePIX (coming soon)

MetalMergerEffectPIX

var metalUniforms: [MetalUniform] = []

PIXMultiEffect: PIXEffect

var inPixs: [PIX & PIXOut] = []

BlendsPIX

var blendingMode: BlendingMode = .add

MetalMultiEffectPIX

var metalUniforms: [MetalUniform] = []

You can’t perform that action at this time.