Skip to content

Instantly share code, notes, and snippets.

@jvcleave
jvcleave / drm_info.txt
Last active February 2, 2020 03:50
modetest
pi@RPI4:~/TEMP/drm_info/build $ ./drm_info
drmModeGetResources: Invalid argument
Node: /dev/dri/card1
├───Driver: vc4 (Broadcom VC4 graphics) version 0.0.0 (20140616)
│ ├───DRM_CLIENT_CAP_STEREO_3D supported
│ ├───DRM_CLIENT_CAP_UNIVERSAL_PLANES supported
│ ├───DRM_CLIENT_CAP_ATOMIC supported
│ ├───DRM_CLIENT_CAP_ASPECT_RATIO supported
│ ├───DRM_CLIENT_CAP_WRITEBACK_CONNECTORS supported
│ ├───DRM_CAP_DUMB_BUFFER = 1
#include "ofAppEGLWindow.h"
#include "ofGraphics.h" // used in runAppViaInfiniteLoop()
#include "ofAppRunner.h"
#include "ofUtils.h"
#include "ofFileUtils.h"
#include "ofGLProgrammableRenderer.h"
#include "ofGLRenderer.h"
#include "ofVectorMath.h"
#include <assert.h>
@jvcleave
jvcleave / ofApp.cpp
Last active January 26, 2020 19:24
createEGL
/*
ADDED
PLATFORM_DEFINES += GLFW_EXPOSE_NATIVE_EGL
PLATFORM_DEFINES += GLFW_EXPOSE_NATIVE_X11
TO
openFrameworks/libs/openFrameworksCompiled/project/linuxarmv6l/config.linuxarmv6l.default.mk
Adapted from https://wiki.maemo.org/SimpleGL_example
*/
string filePath = “data.csv”;
ofFile file(filePath);
if(!file.exists()){
ofLogError(“The file ” + filePath + ” is missing”);
}
ofBuffer buffer(file);
vector<string> lines;
import UIKit
class Content
{
var name:String = "DEFAULT"
func setup(_ name:String)
{
self.name = name
@jvcleave
jvcleave / openframeworks jetson nano.txt
Last active March 1, 2023 10:10
openframeworks jetson nano instructions
Nightly required - get link from the bottom of this page (e.g. https://openframeworks.cc/ci_server/versions/nightly/of_v20190324_linuxarmv7l_nightly.tar.gz)
https://openframeworks.cc/download/
Download OF and unpack:
wget https://openframeworks.cc/ci_server/versions/nightly/of_v20190324_linuxarmv7l_nightly.tar.gz
tar -zxvf of_v20190324_linuxarmv7l_nightly.tar.gz
mv of_v20190324_linuxarmv7l_nightly openFrameworks
#include "ofMain.h"
#include "AvFoundationH264DecoderListener.h"
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <Accelerate/Accelerate.h>
#import <CoreMedia/CoreMedia.h>
#import <AVFoundation/AVPlayer.h>
#import <VideoToolbox/VideoToolbox.h>
@jvcleave
jvcleave / getFitAspectRatioSize
Created December 26, 2018 19:49
aspect ratio
static ofVec2f getFitAspectRatioSize(float maxWidth, float maxHeight, float imgWidth, float imgHeight)
{
ofVec2f result;
float widthRatio = maxWidth / imgWidth;
float heightRatio = maxHeight / imgHeight;
float bestRatio = min(widthRatio, heightRatio);
result.x = imgWidth * bestRatio;
result.y = imgHeight * bestRatio;
return result;
@jvcleave
jvcleave / ofApp.cpp
Last active February 8, 2025 21:35
videocore fast pixel access
#pragma once
#include "ofMain.h"
#include "ofAppEGLWindow.h"
#include "user-vcsm.h"
#include "ofxOMXPlayer.h"
#include "TerminalListener.h"
class ofApp : public ofBaseApp, public KeyListener{
OMX_ImageFilterColourBalance
Number of Params: 4
Value Range: 0-255
Description: first value unknown or maybe not 0-255, 1-3 seem to be RGB.
OMX_ImageFilterColourSwap
Number of Params: 1
Value Range: 0-1
Description: Switches a mode - possibly an enum?