This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//self.inputVideoData is an instanace of RawDataOutput | |
if let rawData = self.inputVideoData { | |
rawData.dataAvailableCallbackWithSize = {[weak self] dataArray, frameSize in | |
let numberOfBytesPerRow = frameSize.width; | |
let data = Data.init(bytes: dataArray) | |
data.withUnsafeBytes { (u8Ptr: UnsafePointer<UInt8>) -> Void in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// VideoMediaInput.swift | |
// GenerateMetal-iOS | |
// | |
// Created by Omar Juarez Ortiz on 2018-11-28. | |
// Copyright © 2018 All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var thePixelBuffer : CVPixelBuffer? | |
let testImage : UIImage = UIImage.init(named: "twdEnds.png")! | |
self.thePixelBuffer = self.pixelBufferFromImage(image: testImage) | |
func pixelBufferFromImage(image: UIImage) -> CVPixelBuffer { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myPixelBuffy = [self pixelBufferFromCGImage:[[UIImage imageNamed:@"myImage.png"] CGImage]]; | |
- (CVPixelBufferRef)pixelBufferFromCGImage:(CGImageRef)image | |
{ | |
CGSize frameSize = CGSizeMake(CGImageGetWidth(image), CGImageGetHeight(image)); | |
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: | |
[NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey, | |
[NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey, | |
nil]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// G8AspectRatio.swift | |
// GenerateMetal-iOS | |
// | |
// Created by Omar Juarez Ortiz on 2019-12-12. | |
// Copyright © 2019 Generate Software Inc. All rights reserved. | |
// | |
import Foundation | |
import MetalPetal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import AuthenticationServices | |
@available(iOS 13.0, *) | |
class G8AppleLogin: NSObject{ | |
var authController: ASAuthorizationController! | |
override init(){ | |
super.init() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pausePixelBuffer = CVPixelBuffer? | |
func pauseTheStream(){ | |
//Create your Pause Image | |
createOncePixelBuffer() | |
//Push your Pause Image into the stream | |
pushPixelBufferToStream(self.pausePixelBuffer) | |
//Pause the stream, the video should stop in the last frame, which is your image | |
rtmpStream.togglePause() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ----------- API ------------- | |
const D = require('Diagnostics'); | |
const Scene = require('Scene'); | |
const FT = require('FaceTracking'); | |
const FGestures = require('FaceGestures'); | |
const A = require('Animation'); | |
const R = require('Reactive'); | |
const Time = require('Time'); | |
var objToAnimate = Scene.root.find("plane0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varying vec2 textureCoordinate; | |
uniform sampler2D inputImageTexture; | |
uniform float contrast; | |
void main() | |
{ | |
vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); | |
gl_FragColor = vec4(((textureColor.rgb - vec3(0.5)) * contrast + vec3(0.5)), textureColor.w); |
NewerOlder