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
// yMap is the Y texture, uvMap is the CrCb texture | |
vec4 capturedImageTextureY = texture2D(yMap, uv); | |
vec4 capturedImageTextureCbCr = texture2D(uvMap, uv); | |
mat4 transform = mat4( | |
1.0000, 1.0000, 1.0000, 0.0000, | |
0.0000, -0.3441, 1.7720, 0.0000, | |
1.4020, -0.7141, 0.0000, 0.0000, | |
-0.7010, 0.5291, -0.8860, 1.0000 | |
); |
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
// do this | |
vector<ARAnchor> mats; | |
for(int i = 0; i < session.currentFrame.anchors.count; ++i){ | |
mats.push_back(session.currentFrame.anchors[i]); | |
} | |
// then access transforms from the "mats" variable. | |
// if you grab a transform from "mats", you shouldn't run into an out of bounds error because |
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
#include "ofApp.h" | |
//! vertex data to render the camera image | |
float kImagePlaneVertexData[8] = { | |
-1.0, -1.0, | |
1.0, -1.0, | |
-1.0, 1.0, | |
1.0, 1.0 | |
}; | |
float verts[16] = { |

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
#include <emscripten/bind.h> | |
using namespace emscripten; | |
// note - assuming you're including your own javascript | |
auto window = val::global("window"); | |
// come up with a function to create a video element. |
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
// Helps to scale image uvs to fit variable surfaces. | |
// Note - still need to test but sounds promising and basic idea appeared to work based on case study. | |
// adapted from description by @lhbzr | |
// https://tympanus.net/codrops/2019/12/18/case-study-portfolio-of-bruno-arizio/ | |
vec2 scaleToFit(vec2 resolution,vec2 imageResolution){ | |
vec2 ratio = vec2( | |
min((resolution.x / resolution.y) / (imageResolution.x / imageResolution.y), 1.0), | |
min((resolution.y / resolution.x) / (imageResolution.y / imageResolution.x), 1.0) | |
); |
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
vec2 uv = gl_FragCoord.xy; | |
//uv = fragCoord.xy / iResolution.xy; | |
uv.y -= u_RenderSize.y / 2.0; | |
uv.x -= u_RenderSize.x / 2.0; | |
vec2 coords = uv; | |
vec4 color = vec4(1.0,1.0,0.0,1.0); | |
float radius = 20.0; |
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
precision highp float; | |
// note - assuming OpenGL ES 2.0 - adjust as needed | |
// the number of items total you want to write out on each row | |
#define NUM 100 | |
// the row of pixels to store, in this example positions | |
#define POSITION_ROW 2 |
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
// | |
// ViewController.h | |
// metal.test | |
// | |
// Created by josephchow on 12/10/19. | |
// Copyright © 2019 josephchow. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
#import <Metal/Metal.h> |
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
int __stdcall WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nCmdShow*/)\ | |
{ | |
HMODULE livepp = lpp::lppLoadAndRegister(L"../../../LivePP","project"); | |
lpp::lppEnableAllCallingModulesSync(livepp); | |
lpp::lppInstallExceptionHandler(livepp); | |
cinder::app::RendererRef renderer(new ci::app::RendererGl); |