This file contains hidden or 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
// The Y plane represents the luminance component, and the UV plane represents the Cb and Cr chroma components. | |
// In the case of kCVPixelFormatType_420YpCbCr8BiPlanarFullRange format, you will find the luma plane is 8bpp with the same dimensions as your video, your chroma plane will be 16bpp, but only a quarter of the size of the original video. You will have one Cb and one Cr component per pixel on this plane. | |
// so if your input video is 352x288, your Y plane will be 352x288 8bpp, and your CbCr 176x144 16bpp. This works out to be about the same amount of data as a 12bpp 352x288 image, half what would be required for RGB888 and still less than RGB565. | |
// So in the buffer, Y will look like this [YYYYY . . . ] and UV [UVUVUVUVUV . . .] | |
// vs RGB being, of course, [RGBRGBRGB . . . ] | |
// https://stackoverflow.com/questions/13429456/how-seperate-y-planar-u-planar-and-uv-planar-from-yuv-bi-planar-in-ios | |
#pragma ARSessionDelegate | |
- (void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame{ | |
CVPixelBuff |
This file contains hidden or 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
// | |
// CapturedImageSampler.swift | |
// ARKitTest | |
// | |
// Created by Joshua Sullivan on 9/22/17. | |
// Copyright © 2017 Joshua Sullivan. All rights reserved. | |
// | |
import UIKit | |
import ARKit |
This file contains hidden or 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
NSString *path = [[NSBundle mainBundle] pathForResource:@"Assets.scnassets/vangoghroom/vg" ofType:@"obj"]; | |
NSURL *url = [NSURL fileURLWithPath:path]; | |
MDLAsset *asset = [[MDLAsset alloc] initWithURL:url]; | |
MDLObject *obj = [asset objectAtIndex:0]; | |
SCNNode *n = [SCNNode nodeWithMDLObject:obj]; | |
This file contains hidden or 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
s$(this).ajaxSubmit({ | |
error: function(xhr) { | |
status('Error: ' + xhr.status); | |
}, | |
success: function(response) { | |
if(response.error) { | |
status('Opps, something bad happened'); |
This file contains hidden or 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
app.post('/api/photos', function(req, res) { | |
var serverPath = '/images/' + req.files.userPhoto.name; | |
require('fs').rename( | |
req.files.userPhoto.path, | |
'/Users/mark/code/examples/file-upload/upload-example-app/public' + serverPath, | |
function(error) { | |
if(error) { | |
res.send({ |
This file contains hidden or 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
$(document).ready(function() { | |
status('Choose a file :)'); | |
// Check to see when a user has selected a file | |
var timerId; | |
timerId = setInterval(function() { | |
if($('#userPhotoInput').val() !== '') { | |
clearInterval(timerId); |
This file contains hidden or 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
<html> | |
<head> | |
<title>Upload Example</title> | |
</head> | |
<body> | |
<form id="uploadForm" | |
enctype="multipart/form-data" | |
action="/api/photos" | |
method="post"> |
This file contains hidden or 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
<html> | |
<head> | |
<title> | |
File Upload Example | |
</title> | |
</head> | |
<body> | |
<form> | |
<input type="file" name="userPhoto" /> |
This file contains hidden or 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
function runTestCase3() { | |
createServer('127.0.0.1', PORT_BASE); | |
createServer('127.0.0.1', PORT_BASE + 1); | |
http.globalAgent.maxSockets = 10; | |
for(var i=0;i<100; ++i) { | |
http.request({ | |
host: '127.0.0.1', | |
port: PORT_BASE, |
This file contains hidden or 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
function runTestCase2() { | |
createServer('127.0.0.1', 1337); | |
http.globalAgent.maxSockets = 10; | |
for(var i=0; i<100; ++i) { | |
http.request({ | |
host: '127.0.0.1', | |
port: 1337, | |
method: 'GET' |
NewerOlder