Skip to content

Instantly share code, notes, and snippets.

@jvcleave
jvcleave / build_cross_gcc.sh
Last active November 1, 2019 07:18
Stretch build
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
#pragma once
#include "ofMain.h"
#include "ofxImGui.h"
class ListBoxContent
{
public:
//--------------------------------------------------------------
void ofApp::setup() {
NSURL* videoUrl = [NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"hands" ofType:@"m4v"]];
AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoUrl options:nil];
AVAssetImageGenerator *generator = [[AVAssetImageGenerator alloc] initWithAsset:asset];
generator.requestedTimeToleranceAfter = kCMTimeZero;
generator.requestedTimeToleranceBefore = kCMTimeZero;
@jvcleave
jvcleave / libpng.sh
Created January 1, 2017 05:49 — forked from dulacp/libpng.sh
Download & Compile Libpng for iOS (all architectures)
# Builds a Libpng framework for the iPhone and the iPhone Simulator.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using libpng in Xcode
# less painful.
#
# To configure the script, define:
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
#
# Then go get the source tar.bz of the libpng you want to build, shove it in the
# same directory as this script, and run "./libpng.sh". Grab a cuppa. And voila.
fbo.allocate(256, 256);
fbo.begin();
ofClear(0);
int step = 16;
int numRows, numCols;
numRows = numCols = fbo.getWidth() / step;
ofColor color1 = ofColor::white;
ofColor color2= ofColor::black;
ofColor lastColor = color1;
@jvcleave
jvcleave / main.cpp
Last active July 27, 2016 19:25
modern geometryShaderExample
#include "ofMain.h"
#define STRINGIFY(x) #x
class ofApp : public ofBaseApp
{
public:
ofShader shader;
@jvcleave
jvcleave / ofApp.h
Created May 11, 2016 05:23
memcpy ofMesh
#pragma once
#include "ofMain.h"
class ofApp : public ofBaseApp{
public:
vector<ofVec3f>points;
vector<ofVec3f>outsidePoints;
@jvcleave
jvcleave / build.sh
Last active March 21, 2016 18:51
ARCH CROSS COMPILE FOR ARM7/RPI3
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@jvcleave
jvcleave / video.c
Created December 11, 2015 20:03
image_fx applied to hello_videocube
/*
Copyright (c) 2012, Broadcom Europe Ltd
Copyright (c) 2012, OtherCrashOverride
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
@jvcleave
jvcleave / gist:62dfe71378aa4df2bcf3
Created November 14, 2015 02:55
FFMPEG arm7/neon/RPI2
CFLAGS="-std=c++14 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -ffast-math -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST"
./configure --extra-cflags="-mfpu=neon-vfpv4 -mfloat-abi=hard -mno-apcs-stack-check -mstructure-size-boundary=32 -mno-sched-prolog" --enable-static --arch=arm --cpu=cortex-a7 --target-os=linux --disable-hwaccels --enable-parsers --disable-muxers --disable-filters --disable-encoders --disable-devices --disable-programs --enable-shared --disable-doc --disable-postproc --enable-gpl --enable-version3 --enable-protocols --enable-nonfree --enable-