Swiftpack.co - Shakshi3104/Espresso as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Shakshi3104.
Shakshi3104/Espresso 1.1.0
Package for getting a depth data image from a portrait image
⭐️ 0
🕓 2 years ago
iOS macOS
.package(url: "https://github.com/Shakshi3104/Espresso.git", from: "1.1.0")

Espresso

Espresso is a package for getting a depth data image from a portrait image taken by iPhone.

Usage

import AVFoundation
import Espresso

/// URL of a portrait image
let url = URL()

// get a depth data image as UIImage from URL
if let depthData = AVDepthData.fromURL(url) {
  let espresso = Espresso(depthData)
  let depthImage = espresso.uiImage(orientation: .right, depthType: .depth)
}

// get a depth data image as NSImage from URL
if let depthData = AVDepthData.fromURL(url) {
  let espresso = Espresso(depthData)
  let depthImage = espresso.nsImage(depthType: .depth)
}

Demo

See also DepthBrewer for examples using Espresso

Requirements

This package is compatible with iOS 12 or higher and macOS 10.15 or heigher.

Installation

Swift Package Manager

Add this Swift package in Xcode using its GitHub repository URL. (File > Add Packages...)

License

Espresso is available under the MIT licence. See the LICENSE file for more info.

GitHub

link
Stars: 0
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

v1.1.0
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics