Rupert  Beatty

Rupert Beatty

1675084165

PixelKit: Live Graphics in Swift & Metal

PixelKit

Live Graphics for iOS, macOS and tvOS

Runs on RenderKit, powered by Metal

PixelKit combines custom shaders, metal performance shaders, core image filters and vision to create tools for real-time rendering.

Examples: Camera Effects - Green Screen 
Info: Coordinate Space - Blend Operators - Effect Convenience Funcs - High Bit Mode

CameraPIXDepthCameraPIXImagePIXVideoPIXScreenCapturePIXStreamInPIXSlopePIX
ColorPIXCirclePIXRectanglePIXPolygonPIXArcPIXLinePIXGradientPIXStackPIX
NoisePIXTextPIXMetalPIXTwirlPIXFeedbackPIXDelayPIXSharpenPIXStreamOutPIX
LevelsPIXBlurPIXEdgePIXThresholdPIXQuantizePIXTransformPIXKaleidoscopePIX
ChannelMixPIXChromaKeyPIXCornerPinPIXColorShiftPIXFlipFlopPIXRangePIXStarPIX
SepiaPIXConvertPIXReducePIXClampPIXFreezePIXFlarePIXAirPlayPIXRecordPIX
BlendPIXCrossPIXLookupPIXDisplacePIXRemapPIXReorderPIXResolutionPIXCropPIX
BlendsPIXLumaLevelsPIXLumaBlurPIXLumaTransformPIXTimeMachinePIXArrayPIX

Install

Swift Package

.package(url: "https://github.com/heestand-xyz/PixelKit", from: "3.0.0")

Setup

SwiftUI

import SwiftUI
import PixelKit

struct ContentView: View {
    
    @StateObject var circlePix = CirclePIX()
    @StateObject var blurPix = BlurPIX()
    
    var body: some View {
        PixelView(pix: blurPix)
            .onAppear {
                blurPix.input = circlePix
                blurPix.radius = 0.25
            }
    }
}

UIKit

import UIKit
import PixelKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let circlePix = CirclePIX()

        let blurPix = BlurPIX()
        blurPix.input = circlePix
        blurPix.radius = 0.25

        let finalPix: PIX = blurPix
        finalPix.view.frame = view.bounds
        view.addSubview(finalPix.view)
    }
}

Resolution

In PixelKit all PIXs have a resolution. Some PIXs have defined resolutions (default to .auto) and some PIXs have derived resolutions.

The .auto resolution will fill up the view and get the correct resolution based on the view size. If a view is 100x100 points, the resolution will be 200x200 pixels on macOS and 300x300 pixels on iPhone.

Import the resolution package to work with resolutions:

import Resolution

You can multiply and divide resolutions with a CGFloat or Int.

There are predefined resolutions like ._1080p & ._4K.

Rendered Image

.renderedImage // UIImage or NSImage
.renderedTexture // MTLTexture

Example: Camera Effects

import SwiftUI
import PixelKit

class ViewModel: ObservableObject {
    
    let camera: CameraPIX
    let levels: LevelsPIX
    let colorShift: ColorShiftPIX
    let blur: BlurPIX
    let circle: CirclePIX
    
    let finalPix: PIX
    
    init() {
        
        camera = CameraPIX()
        camera.cameraResolution = ._1080p

        levels = LevelsPIX()
        levels.input = camera
        levels.brightness = 1.5
        levels.gamma = 0.5

        colorShift = ColorShiftPIX()
        colorShift.input = levels
        colorShift.saturation = 0.5

        blur = BlurPIX()
        blur.input = colorShift
        blur.radius = 0.25

        circle = CirclePIX(at: .square(1080))
        circle.radius = 0.45
        circle.backgroundColor = .clear

        finalPix = blur & (camera * circle)
    }
}

struct ContentView: View {
    
    @StateObject var viewModel = ViewModel()
    
    var body: some View {
        PixelView(pix: viewModel.finalPix)
    }
}

This can also be done with Effect Convenience Funcs:
 

let pix = CameraPIX().pixBrightness(1.5).pixGamma(0.5).pixSaturation(0.5).pixBlur(0.25)

Remeber to add NSCameraUsageDescription to your Info.plist

Example: Green Screen

import RenderKit import PixelKit

let cityImage = ImagePIX()
cityImage.image = UIImage(named: "city")

let supermanVideo = VideoPIX()
supermanVideo.load(fileNamed: "superman", withExtension: "mov")

let supermanKeyed = ChromaKeyPIX()
supermanKeyed.input = supermanVideo
supermanKeyed.keyColor = .green

let blendPix = BlendPIX()
blendPix.blendingMode = .over
blendPix.inputA = cityImage
blendPix.inputB = supermanKeyed

let finalPix: PIX = blendPix
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)

This can also be done with Blend Operators and Effect Convenience Funcs:
 

let pix = cityImage & supermanVideo.pixChromaKey(.green)

Example: Depth Camera

import RenderKit import PixelKit

let cameraPix = CameraPIX()
cameraPix.camera = .front

let depthCameraPix = DepthCameraPIX.setup(with: cameraPix)

let levelsPix = LevelsPIX()
levelsPix.input = depthCameraPix
levelsPix.inverted = true

let lumaBlurPix = cameraPix.pixLumaBlur(pix: levelsPix, radius: 0.1)

let finalPix: PIX = lumaBlurPix
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)

The DepthCameraPIX was added in PixelKit v0.8.4 and requires an iPhone X or newer.

Note to use the setup(with:filter:) method of DepthCameraPIX.
It will take care of orientation, color and enable depth on the CameraPIX.

To gain access to depth values ouside of the 0.0 and 1.0 bounds,
enable 16 bit mode like this: PixelKit.main.render.bits = ._16

Example: Multi Camera

let cameraPix = CameraPIX()
cameraPix.camera = .back

let multiCameraPix = MultiCameraPIX.setup(with: cameraPix, camera: .front)

let movedMultiCameraPix = multiCameraPix.pixScale(by: 0.25).pixTranslate(x: 0.375 * (9 / 16), y: 0.375)

let finalPix: PIX = camearPix & movedMultiCameraPix
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)

Note MultiCameraPIX requires iOS 13.

Coordinate Space

The PixelKit coordinate space is normailzed to the vertical axis (1.0 in height) with the origin (0.0, 0.0) in the center.
Note that compared to native UIKit and SwiftUI views the vertical axis is flipped and origin is moved, this is more convinent when working with graphics in PixelKit. A full rotation is defined by 1.0

Center: CGPoint(x: 0, y: 0)
Bottom Left: CGPoint(x: -0.5 * aspectRatio, y: -0.5)
Top Right: CGPoint(x: 0.5 * aspectRatio, y: 0.5)
 

Tip: Resolution has an .aspect property:
let aspectRatio: CGFloat = Resolution._1080p.aspect

Blend Operators

A quick and convenient way to blend PIXs
These are the supported BlendingMode operators:

&!&+-***!**%~°
.over.under.add.subtract.multiply.power.gamma.difference.averagecosine
<>><++--<->>-<+-+
.minimum.maximum.addWithAlpha.subtractWithAlphainsideoutsideexclusiveOr
let blendPix = (CameraPIX() !** NoisePIX(at: .fullHD(.portrait))) * CirclePIX(at: .fullHD(.portrait))

The default global blend operator fill mode is .fit, change it like this:
PIX.blendOperators.globalPlacement = .fill

Effect Convenience Funcs

  • .pixScaleResolution(to: ._1080p * 0.5) -> ResolutionPIX
  • .pixScaleResolution(by: 0.5) -> ResolutionPIX
  • .pixBrightness(0.5) -> LevelsPIX
  • .pixDarkness(0.5) -> LevelsPIX
  • .pixContrast(0.5) -> LevelsPIX
  • .pixGamma(0.5) -> LevelsPIX
  • .pixInvert() -> LevelsPIX
  • .pixOpacity(0.5) -> LevelsPIX
  • .pixBlur(0.5) -> BlurPIX
  • .pixEdge() -> EdgePIX
  • .pixThreshold(at: 0.5) -> ThresholdPIX
  • .pixQuantize(by: 0.5) -> QuantizePIX
  • .pixPosition(at: CGPoint(x: 0.5, y: 0.5)) -> TransformPIX
  • .pixRotatate(by: 0.5) -> TransformPIX
  • .pixRotatate(byRadians: .pi) -> TransformPIX
  • .pixRotatate(byDegrees: 180) -> TransformPIX
  • .pixScale(by: 0.5) -> TransformPIX
  • .pixKaleidoscope() -> KaleidoscopePIX
  • .pixTwirl(0.5) -> TwirlPIX
  • .pixSwap(.red, .blue) -> ChannelMixPIX
  • .pixChromaKey(.green) -> ChromaKeyPIX
  • .pixHue(0.5) -> ColorShiftPIX
  • .pixSaturation(0.5) -> ColorShiftPIX
  • .pixCrop(CGRect(x: 0.25, y 0.25, width: 0.5, height: 0.5)) -> CropPIX
  • .pixFlipX() -> FlipFlopPIX
  • .pixFlipY() -> FlipFlopPIX
  • .pixFlopLeft() -> FlipFlopPIX
  • .pixFlopRight() -> FlipFlopPIX
  • .pixRange(inLow: 0.0, inHigh: 0.5, outLow: 0.5, outHigh: 1.0) -> RangePIX
  • .pixRange(inLow: .clear, inHigh: .gray, outLow: .gray, outHigh: .white) -> RangePIX
  • .pixSharpen() -> SharpenPIX
  • .pixSlope() - > SlopePIX
  • .pixVignetting(radius: 0.5, inset: 0.25, gamma: 0.5) -> LumaLevelsPIX
  • .pixLookup(pix: pixB, axis: .x) -> LookupPIX
  • .pixLumaBlur(pix: pixB, radius: 0.5) -> LumaBlurPIX
  • .pixLumaLevels(pix: pixB, brightness: 2.0) -> LumaLevelsPIX
  • .pixDisplace(pix: pixB, distance: 0.5) -> DisplacePIX
  • .pixRemap(pix: pixB) -> RemapPIX

Keep in mind that these funcs will create new PIXs.
Be careful of overloading GPU memory, some funcs create several PIXs.

High Bit Mode

Some effects like DisplacePIX and SlopePIX can benefit from a higher bit depth.
The default is 8 bits. Change it like this: PixelKit.main.render.bits = ._16

Enable high bit mode before you create any PIXs.

Note resources do not support higher bits yet.
There is currently there is some gamma offset with resources.

MetalPIXs

let metalPix = MetalPIX(at: ._1080p, code:
    """
    pix = float4(u, v, 0.0, 1.0);
    """
)
let metalEffectPix = MetalEffectPIX(code:
    """
    float gamma = 0.25;
    pix = pow(input, 1.0 / gamma);
    """
)
metalEffectPix.input = CameraPIX()
let metalMergerEffectPix = MetalMergerEffectPIX(code:
    """
    pix = pow(inputA, 1.0 / inputB);
    """
)
metalMergerEffectPix.inputA = CameraPIX()
metalMergerEffectPix.inputB = ImagePIX("img_name")
let metalMultiEffectPix = MetalMultiEffectPIX(code:
    """
    float4 inPixA = inTexs.sample(s, uv, 0);
    float4 inPixB = inTexs.sample(s, uv, 1);
    float4 inPixC = inTexs.sample(s, uv, 2);
    pix = inPixA + inPixB + inPixC;
    """
)
metalMultiEffectPix.inputs = [ImagePIX("img_a"), ImagePIX("img_b"), ImagePIX("img_c")]

Uniforms:

var lumUniform = MetalUniform(name: "lum")
let metalPix = MetalPIX(at: ._1080p, code:
    """
    pix = float4(in.lum, in.lum, in.lum, 1.0);
    """,
    uniforms: [lumUniform]
)
lumUniform.value = 0.5

Notes:

  • To gain camera access, on macOS, check Camera in the App Sandbox in your Xcode project settings under Capabilities.

inspired by TouchDesigner created by Anton Heestand XYZ


Download Details:

Author: Heestand-xyz
Source Code: https://github.com/heestand-xyz/PixelKit 
License: MIT license

#swift #macos #ios #graphic 

What is GEEK

Buddha Community

PixelKit: Live Graphics in Swift & Metal
Houston  Sipes

Houston Sipes

1600430400

10 Free Online Resources To Learn Swift Language

Swift is a fast and efficient general-purpose programming language that provides real-time feedback and can be seamlessly incorporated into existing Objective-C code. This is why developers are able to write safer, more reliable code while saving time. It aims to be the best language that can be used for various purposes ranging from systems programming to mobile as well as desktop apps and scaling up to cloud services.

Below here, we list down the 10 best online resources to learn Swift language.

(The list is in no particular order)

#developers corner #free online resources to learn swift language #learn swift #learn swift free #learn swift online free #resources to learn swift #swift language #swift programming

Top Swift Development Companies | Top Swift Developers - TopDevelopers.co

A thoroughly researched list of top Swift developers with ratings & reviews to help find the best Swift development companies around the world.

#swift development service providers #best swift development companies #top swift development companies #swift development solutions #top swift developers #swift

Rupert  Beatty

Rupert Beatty

1675084165

PixelKit: Live Graphics in Swift & Metal

PixelKit

Live Graphics for iOS, macOS and tvOS

Runs on RenderKit, powered by Metal

PixelKit combines custom shaders, metal performance shaders, core image filters and vision to create tools for real-time rendering.

Examples: Camera Effects - Green Screen 
Info: Coordinate Space - Blend Operators - Effect Convenience Funcs - High Bit Mode

CameraPIXDepthCameraPIXImagePIXVideoPIXScreenCapturePIXStreamInPIXSlopePIX
ColorPIXCirclePIXRectanglePIXPolygonPIXArcPIXLinePIXGradientPIXStackPIX
NoisePIXTextPIXMetalPIXTwirlPIXFeedbackPIXDelayPIXSharpenPIXStreamOutPIX
LevelsPIXBlurPIXEdgePIXThresholdPIXQuantizePIXTransformPIXKaleidoscopePIX
ChannelMixPIXChromaKeyPIXCornerPinPIXColorShiftPIXFlipFlopPIXRangePIXStarPIX
SepiaPIXConvertPIXReducePIXClampPIXFreezePIXFlarePIXAirPlayPIXRecordPIX
BlendPIXCrossPIXLookupPIXDisplacePIXRemapPIXReorderPIXResolutionPIXCropPIX
BlendsPIXLumaLevelsPIXLumaBlurPIXLumaTransformPIXTimeMachinePIXArrayPIX

Install

Swift Package

.package(url: "https://github.com/heestand-xyz/PixelKit", from: "3.0.0")

Setup

SwiftUI

import SwiftUI
import PixelKit

struct ContentView: View {
    
    @StateObject var circlePix = CirclePIX()
    @StateObject var blurPix = BlurPIX()
    
    var body: some View {
        PixelView(pix: blurPix)
            .onAppear {
                blurPix.input = circlePix
                blurPix.radius = 0.25
            }
    }
}

UIKit

import UIKit
import PixelKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let circlePix = CirclePIX()

        let blurPix = BlurPIX()
        blurPix.input = circlePix
        blurPix.radius = 0.25

        let finalPix: PIX = blurPix
        finalPix.view.frame = view.bounds
        view.addSubview(finalPix.view)
    }
}

Resolution

In PixelKit all PIXs have a resolution. Some PIXs have defined resolutions (default to .auto) and some PIXs have derived resolutions.

The .auto resolution will fill up the view and get the correct resolution based on the view size. If a view is 100x100 points, the resolution will be 200x200 pixels on macOS and 300x300 pixels on iPhone.

Import the resolution package to work with resolutions:

import Resolution

You can multiply and divide resolutions with a CGFloat or Int.

There are predefined resolutions like ._1080p & ._4K.

Rendered Image

.renderedImage // UIImage or NSImage
.renderedTexture // MTLTexture

Example: Camera Effects

import SwiftUI
import PixelKit

class ViewModel: ObservableObject {
    
    let camera: CameraPIX
    let levels: LevelsPIX
    let colorShift: ColorShiftPIX
    let blur: BlurPIX
    let circle: CirclePIX
    
    let finalPix: PIX
    
    init() {
        
        camera = CameraPIX()
        camera.cameraResolution = ._1080p

        levels = LevelsPIX()
        levels.input = camera
        levels.brightness = 1.5
        levels.gamma = 0.5

        colorShift = ColorShiftPIX()
        colorShift.input = levels
        colorShift.saturation = 0.5

        blur = BlurPIX()
        blur.input = colorShift
        blur.radius = 0.25

        circle = CirclePIX(at: .square(1080))
        circle.radius = 0.45
        circle.backgroundColor = .clear

        finalPix = blur & (camera * circle)
    }
}

struct ContentView: View {
    
    @StateObject var viewModel = ViewModel()
    
    var body: some View {
        PixelView(pix: viewModel.finalPix)
    }
}

This can also be done with Effect Convenience Funcs:
 

let pix = CameraPIX().pixBrightness(1.5).pixGamma(0.5).pixSaturation(0.5).pixBlur(0.25)

Remeber to add NSCameraUsageDescription to your Info.plist

Example: Green Screen

import RenderKit import PixelKit

let cityImage = ImagePIX()
cityImage.image = UIImage(named: "city")

let supermanVideo = VideoPIX()
supermanVideo.load(fileNamed: "superman", withExtension: "mov")

let supermanKeyed = ChromaKeyPIX()
supermanKeyed.input = supermanVideo
supermanKeyed.keyColor = .green

let blendPix = BlendPIX()
blendPix.blendingMode = .over
blendPix.inputA = cityImage
blendPix.inputB = supermanKeyed

let finalPix: PIX = blendPix
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)

This can also be done with Blend Operators and Effect Convenience Funcs:
 

let pix = cityImage & supermanVideo.pixChromaKey(.green)

Example: Depth Camera

import RenderKit import PixelKit

let cameraPix = CameraPIX()
cameraPix.camera = .front

let depthCameraPix = DepthCameraPIX.setup(with: cameraPix)

let levelsPix = LevelsPIX()
levelsPix.input = depthCameraPix
levelsPix.inverted = true

let lumaBlurPix = cameraPix.pixLumaBlur(pix: levelsPix, radius: 0.1)

let finalPix: PIX = lumaBlurPix
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)

The DepthCameraPIX was added in PixelKit v0.8.4 and requires an iPhone X or newer.

Note to use the setup(with:filter:) method of DepthCameraPIX.
It will take care of orientation, color and enable depth on the CameraPIX.

To gain access to depth values ouside of the 0.0 and 1.0 bounds,
enable 16 bit mode like this: PixelKit.main.render.bits = ._16

Example: Multi Camera

let cameraPix = CameraPIX()
cameraPix.camera = .back

let multiCameraPix = MultiCameraPIX.setup(with: cameraPix, camera: .front)

let movedMultiCameraPix = multiCameraPix.pixScale(by: 0.25).pixTranslate(x: 0.375 * (9 / 16), y: 0.375)

let finalPix: PIX = camearPix & movedMultiCameraPix
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)

Note MultiCameraPIX requires iOS 13.

Coordinate Space

The PixelKit coordinate space is normailzed to the vertical axis (1.0 in height) with the origin (0.0, 0.0) in the center.
Note that compared to native UIKit and SwiftUI views the vertical axis is flipped and origin is moved, this is more convinent when working with graphics in PixelKit. A full rotation is defined by 1.0

Center: CGPoint(x: 0, y: 0)
Bottom Left: CGPoint(x: -0.5 * aspectRatio, y: -0.5)
Top Right: CGPoint(x: 0.5 * aspectRatio, y: 0.5)
 

Tip: Resolution has an .aspect property:
let aspectRatio: CGFloat = Resolution._1080p.aspect

Blend Operators

A quick and convenient way to blend PIXs
These are the supported BlendingMode operators:

&!&+-***!**%~°
.over.under.add.subtract.multiply.power.gamma.difference.averagecosine
<>><++--<->>-<+-+
.minimum.maximum.addWithAlpha.subtractWithAlphainsideoutsideexclusiveOr
let blendPix = (CameraPIX() !** NoisePIX(at: .fullHD(.portrait))) * CirclePIX(at: .fullHD(.portrait))

The default global blend operator fill mode is .fit, change it like this:
PIX.blendOperators.globalPlacement = .fill

Effect Convenience Funcs

  • .pixScaleResolution(to: ._1080p * 0.5) -> ResolutionPIX
  • .pixScaleResolution(by: 0.5) -> ResolutionPIX
  • .pixBrightness(0.5) -> LevelsPIX
  • .pixDarkness(0.5) -> LevelsPIX
  • .pixContrast(0.5) -> LevelsPIX
  • .pixGamma(0.5) -> LevelsPIX
  • .pixInvert() -> LevelsPIX
  • .pixOpacity(0.5) -> LevelsPIX
  • .pixBlur(0.5) -> BlurPIX
  • .pixEdge() -> EdgePIX
  • .pixThreshold(at: 0.5) -> ThresholdPIX
  • .pixQuantize(by: 0.5) -> QuantizePIX
  • .pixPosition(at: CGPoint(x: 0.5, y: 0.5)) -> TransformPIX
  • .pixRotatate(by: 0.5) -> TransformPIX
  • .pixRotatate(byRadians: .pi) -> TransformPIX
  • .pixRotatate(byDegrees: 180) -> TransformPIX
  • .pixScale(by: 0.5) -> TransformPIX
  • .pixKaleidoscope() -> KaleidoscopePIX
  • .pixTwirl(0.5) -> TwirlPIX
  • .pixSwap(.red, .blue) -> ChannelMixPIX
  • .pixChromaKey(.green) -> ChromaKeyPIX
  • .pixHue(0.5) -> ColorShiftPIX
  • .pixSaturation(0.5) -> ColorShiftPIX
  • .pixCrop(CGRect(x: 0.25, y 0.25, width: 0.5, height: 0.5)) -> CropPIX
  • .pixFlipX() -> FlipFlopPIX
  • .pixFlipY() -> FlipFlopPIX
  • .pixFlopLeft() -> FlipFlopPIX
  • .pixFlopRight() -> FlipFlopPIX
  • .pixRange(inLow: 0.0, inHigh: 0.5, outLow: 0.5, outHigh: 1.0) -> RangePIX
  • .pixRange(inLow: .clear, inHigh: .gray, outLow: .gray, outHigh: .white) -> RangePIX
  • .pixSharpen() -> SharpenPIX
  • .pixSlope() - > SlopePIX
  • .pixVignetting(radius: 0.5, inset: 0.25, gamma: 0.5) -> LumaLevelsPIX
  • .pixLookup(pix: pixB, axis: .x) -> LookupPIX
  • .pixLumaBlur(pix: pixB, radius: 0.5) -> LumaBlurPIX
  • .pixLumaLevels(pix: pixB, brightness: 2.0) -> LumaLevelsPIX
  • .pixDisplace(pix: pixB, distance: 0.5) -> DisplacePIX
  • .pixRemap(pix: pixB) -> RemapPIX

Keep in mind that these funcs will create new PIXs.
Be careful of overloading GPU memory, some funcs create several PIXs.

High Bit Mode

Some effects like DisplacePIX and SlopePIX can benefit from a higher bit depth.
The default is 8 bits. Change it like this: PixelKit.main.render.bits = ._16

Enable high bit mode before you create any PIXs.

Note resources do not support higher bits yet.
There is currently there is some gamma offset with resources.

MetalPIXs

let metalPix = MetalPIX(at: ._1080p, code:
    """
    pix = float4(u, v, 0.0, 1.0);
    """
)
let metalEffectPix = MetalEffectPIX(code:
    """
    float gamma = 0.25;
    pix = pow(input, 1.0 / gamma);
    """
)
metalEffectPix.input = CameraPIX()
let metalMergerEffectPix = MetalMergerEffectPIX(code:
    """
    pix = pow(inputA, 1.0 / inputB);
    """
)
metalMergerEffectPix.inputA = CameraPIX()
metalMergerEffectPix.inputB = ImagePIX("img_name")
let metalMultiEffectPix = MetalMultiEffectPIX(code:
    """
    float4 inPixA = inTexs.sample(s, uv, 0);
    float4 inPixB = inTexs.sample(s, uv, 1);
    float4 inPixC = inTexs.sample(s, uv, 2);
    pix = inPixA + inPixB + inPixC;
    """
)
metalMultiEffectPix.inputs = [ImagePIX("img_a"), ImagePIX("img_b"), ImagePIX("img_c")]

Uniforms:

var lumUniform = MetalUniform(name: "lum")
let metalPix = MetalPIX(at: ._1080p, code:
    """
    pix = float4(in.lum, in.lum, in.lum, 1.0);
    """,
    uniforms: [lumUniform]
)
lumUniform.value = 0.5

Notes:

  • To gain camera access, on macOS, check Camera in the App Sandbox in your Xcode project settings under Capabilities.

inspired by TouchDesigner created by Anton Heestand XYZ


Download Details:

Author: Heestand-xyz
Source Code: https://github.com/heestand-xyz/PixelKit 
License: MIT license

#swift #macos #ios #graphic 

Hire Dedicated Swift Developers

Want to create a native iOS application for your Startup?

Hire Dedicated Swift Developers for end-to-end services like development, migration, upgrade, testing, and support & maintenance. Trust HourlyDeveloper.io our Swift development team for iOS device apps that are high on performance and security.

Consult with experts:- https://bit.ly/2C5M6cz

#hire dedicated swift developers #swift developers #swift development company #swift development services #swift development #swift

Alex  Sam

Alex Sam

1593782362

Top Chat Software for Live Streaming & Broadcasting Web & Mobile Apps

Do you Increase your Website Engagment?

I analysed, ranked and reviewed best live video streaming chat APIs and SDKs for your web & mobile app based on client reviews and ratings. portfolio, usecases, cost, secure streaming, live chat features, cost, support, etc.

Turn your viewers into participatients with Live Streaming Chat Solutions. There are lot of Real-time chat apis & SDks Providers have in online market now. You can easily integrte and customize real time chat solutions into your new or existing live video streaming web and iOS & android applications. Below have mentioned best real time chat api & SDk Proivders.

Live video streaming chat api
Live video streaming chat apis

Here are The Most Popular Live Video Streaming Chat APIs & SDKs to be Considered for your Mobile App

1. CONTUS Fly - Real-time Messaging Platform for Live Streaming Apps & Webs

CONTUS Fly is one of the leading real time messaging software providers in the market for a decade. Their messaging platforms are completely customizable since they provide Chat APIs and SDKs to integrate real time chat feasibility on your live streaming applications irrespective of audience base. Engage your audience like a live concert, stadium like experience through digitally. Create channels for every live streaming event, sports or anything that would create buzz. Enable audience to interact with each other over voice, video chats and real-time text chats with engaging emojis. CONTUS Fly enables users to add emojis and stickers to captivate each audience and create fun.

Highlight Features of CONTUS Fly Live Video Streaming Platform Includes:

  1. Chat for Live Video Streaming
  2. Video & Audio Recording
  3. Video Calling
  4. Drawing whitebord
  5. Screen Sharing
  6. End to End Encryption

2. Apphitect -Instant chat for Live Streaming Platforms

To make every live streaming and broadcasting videos more engaging and entertaining, Apphitect’s instant messaging comes with exciting Instant messaging chat APIs to add chat into streaming applications. Apphitect is built with multiple real time communication features like video chat, voice chat and real-time chat to your streaming apps. Their solution surprisingly has a wide range of features to communicate, engage and increase subscription benefits.

Highlight Features of Apphitect Live Insterative Broadcasting Software Includes:

  1. Live Video Streaming Chat
  2. Cross Platform Support
  3. Audio & Video Recording
  4. Live Video Calling
  5. Emoji & Stickers

3. MirrorFly - Enterprise Real Time Chat for Streaming Websites

One of the enterprise-grade real-time chat solutions built to create virtual chat experience for live streaming events and websites for big brands and startups. Irrespective of audience base, category, MirrorFly provides customizable real time chat APIs to add virtual communication mediums on live streaming and broadcasting applications. Their solution comes with absolute moderation tools and open channels to talk and listen with your audience. MirrorFly’s server infrastructure has the potential to handle concurrent messages and users and to achieve maximum sales conversion.

Highlight Features of MirrorFly Live Streaming Chat API Includes:

  1. Face to Face Video Calling
  2. Live Interactive Broadcasting
  3. Call Recording
  4. Digital Whiteboard
  5. Group Video Calling

4. Applozic - Real-time Chat Plugin for Live Broadcasting & Video Streaming apps

When it comes to building a live streaming chat app software that covers the entire platforms and demand All-in-One package (features, Customization to any extent) with a one-time payment for lifetime performance, then undoubtedly Contus Fly makes the right choice to partner with. The company offers live broadcasting SDK for Android/iOS and chat APIs for customization.

Highlight Features of Applozic Chat Live Streaming Platform Includes:

  1. Real time Communication
  2. Cross Platform Support
  3. Live Audio Broadcasting
  4. Push Notifications
  5. Secure Image Sharing

5. Sendbird - Top Real time Chat for Live Video Streams

Being a leading real time chat platform provider in the market, Sendbird has its own hallmark of communication features to the world’s most prominent live streaming applications. Their real time chat solution enables broadcasting and streaming platform’ owners to create a physical equivalent digital chat experience for the audience during any live event streaming to interact, collaborate and cheer together within the same streaming screen. By creating open channels and groups, you can enable the audience to interact with each other during any streaming, engage them with polls, stickers, multiple communication channels and more.

Highlight Features of Sendbird Live Streaming Chat API Includes:

  1. Chat for Streaming website
  2. Messaging Data
  3. Multi Platforms
  4. Push Notifications
  5. End to End Encryption

6. Agora - Interactive Live Chat for Live Video Streaming

Agora, a deep integratable API available in the market to deliver live interactive streaming experience for workplace, enterprises, gaming, retail, telehealth and social live streaming websites. With easy-to-embed SDKs, Agora empowers businesses to add HD and low latency video and voice chat features into any streaming platforms and channels. Their easy-to-embed real time chat features encourage higher levels of user engagement and opportunity to drive more audience.

7. Enablex - A Redefined Communication APIs for In-app Chat

Their smart and secure chat APIs deliver real-time chat feasibility for live and on-demand video streaming websites. The real time chat features provides users to communicate and engage within the same streaming platform irrespective of interaction medium and audience count. Enablex offers platform-as-a-service communication solutions for real time messaging integration with APIs hosting possibility on public, private and cloud deployment. Their APIs are enriched with multiple communication features and engagement tools like live-polls, stickers and more.

8. Pubnub - In-app Chat Platforms for Live Event Streaming Websites

In order to increase user engagement with live and remote audiences, Pubnub offers real time messaging chat functionality with interactive features to drive event-based engagement with mass chat. Their in-app chat feature enhances live programs, event streaming and blogging content with live polling, multiple chats and more. It also enables live streaming websites to build community, channels and super groups during live streaming to bring the entire audience base to one place.

9. Vonage - Communication APIs for In-app Messagings

Vonage is a prime provider of communication APIs for major industrial sectors and enterprise workplaces. With its API, businesses such as live streaming applications can integrate in-app messaging features into any streaming platforms on Android, iOS and Web to empower user engagement. Their APIs are powered with scalable infrastructure and provide multiple communication mediums such as in-app voice, video and chat proactively engaging the audience.

10. Firekast - Live Chat Widget for Video Streaming Player

Firekast provides a customizable live chat widget with HTML code for streaming players to enable chat within any streaming or on-demand videos. The chat widget gives the ability for brands and content owners to make the audience to interact with each other for better engagement and proactivity during streaming. The Firekast Live chat comes with moderator tools that will allow administrators to delete or ban abusive content and users from the channel or groups. Firekast’s live chat comes with a private chat widget to create public or private chat rooms to make effective collaboration and discussions.
 

Conclusion
And this is all the real time chat providers in the market to implement chat functionality in any live streaming or broadcasting platforms. More than delivering entertaining live content, creating a massive engagement and buzz for every live event is the smarter way to turn every audience into a protiable subscriber. Picking up the right software provider is more important than just handling the integration process.

#live #live-streaming-solutions #live-streaming-chat-api #live-streaming-chat-sdk #chat-api-for-live-broadcasting