Skip to content

Instantly share code, notes, and snippets.

@aditiswaroop
aditiswaroop / CVPixelBufferPixelFormatNames.swift
Created Jul 17, 2020 — forked from skyebook/CVPixelBufferPixelFormatNames.swift
Easily get the pixel format name of a CVPixelBuffer
View CVPixelBufferPixelFormatNames.swift
public func CVPixelBufferGetPixelFormatName(pixelBuffer: CVPixelBuffer) -> String {
let p = CVPixelBufferGetPixelFormatType(pixelBuffer)
switch p {
case kCVPixelFormatType_1Monochrome: return "kCVPixelFormatType_1Monochrome"
case kCVPixelFormatType_2Indexed: return "kCVPixelFormatType_2Indexed"
case kCVPixelFormatType_4Indexed: return "kCVPixelFormatType_4Indexed"
case kCVPixelFormatType_8Indexed: return "kCVPixelFormatType_8Indexed"
case kCVPixelFormatType_1IndexedGray_WhiteIsZero: return "kCVPixelFormatType_1IndexedGray_WhiteIsZero"
case kCVPixelFormatType_2IndexedGray_WhiteIsZero: return "kCVPixelFormatType_2IndexedGray_WhiteIsZero"
case kCVPixelFormatType_4IndexedGray_WhiteIsZero: return "kCVPixelFormatType_4IndexedGray_WhiteIsZero"
@aditiswaroop
aditiswaroop / CapturedImageSampler.swift
Created Jul 17, 2020 — forked from JoshuaSullivan/CapturedImageSampler.swift
The source code for an object that helps you sample RGB values from ARFrames.
View CapturedImageSampler.swift
//
// CapturedImageSampler.swift
// ARKitTest
//
// Created by Joshua Sullivan on 9/22/17.
// Copyright © 2017 Joshua Sullivan. All rights reserved.
//
import UIKit
import ARKit
You can’t perform that action at this time.