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 SceneKit | |
class ARQLThumbnailGenerator { | |
private let device = MTLCreateSystemDefaultDevice()! | |
/// Create a thumbnail image of the asset with the specified URL at the specified | |
/// animation time. Supports loading of .scn, .usd, .usdz, .obj, and .abc files, | |
/// and other formats supported by ModelIO. |
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
// | |
// Copyright 2018 Warren Moore | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// |
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
MBE_INLINE simd_float3 MBE_OVERLOAD project(simd_float3 object, simd_float4x4 model, simd_float4x4 projection, int *viewport); | |
MBE_INLINE simd_float3 MBE_OVERLOAD unproject(simd_float3 window, simd_float4x4 model, simd_float4x4 projection, int *viewport, bool *success); | |
MBE_INLINE float MBE_OVERLOAD distance(simd_float2, simd_float2); | |
MBE_INLINE simd_float2 MBE_OVERLOAD lerp(simd_float2, simd_float2, float); | |
MBE_INLINE simd_float2 MBE_OVERLOAD project(simd_float2, simd_float2); | |
MBE_INLINE float MBE_OVERLOAD distance(simd_float3, simd_float3); | |
MBE_INLINE simd_float3 MBE_OVERLOAD lerp(simd_float3, simd_float3, float); | |
MBE_INLINE simd_float3 MBE_OVERLOAD project(simd_float3, simd_float3); |
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
NSUInteger width = 1024; | |
NSUInteger height = 768; | |
OSType pixelFormat = kCVPixelFormatType_422YpCbCr8BiPlanarFullRange; | |
NSUInteger plane0BytesPerPixel = 1; | |
NSUInteger plane1BytesPerPixel = 1; | |
NSUInteger plane0BytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, plane0BytesPerPixel * width); | |
NSUInteger plane0AllocSize = IOSurfaceAlignProperty(kIOSurfaceAllocSize, plane0BytesPerRow * height); | |
NSUInteger plane1BytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, plane1BytesPerPixel * width); | |
NSUInteger plane1AllocSize = IOSurfaceAlignProperty(kIOSurfaceAllocSize, plane1BytesPerRow * height); |
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 <UIKit/UIKit.h> | |
#import <QuartzCore/CAMetalLayer.h> | |
#import <Metal/Metal.h> | |
@class MetalView; | |
@protocol MetalViewDelegate | |
- (void)drawInView:(MetalView *)view; | |
@end |