Skip to content

Instantly share code, notes, and snippets.

View depthlove's full-sized avatar

depthlove depthlove

View GitHub Profile
@depthlove
depthlove / gist:0c67fdc94e3fc947cd05b2ae862daed9
Created October 11, 2017 17:21 — forked from rnaud/gist:5451319
[GPUImage] - Blend and Tone Curve filters GPUImageFilterGroup subclass
#import "GPUImageBlendTone.h"
#import "GPUImage.h"
@implementation GPUImageBlendTone
- (id)init;
{
if (!(self = [super init]))
{
@depthlove
depthlove / GPUImageiOSImageEffect.h
Created October 11, 2017 17:20 — forked from ahti/GPUImageiOSImageEffect.h
GPUImage iOS 7 Blur Effect Filter
#import "GPUImageFilterGroup.h"
@class GPUImageSaturationFilter;
@class GPUImageGaussianBlurFilter;
@class GPUImageSolidColorGenerator;
@class GPUImageAlphaBlendFilter;
typedef enum {
GPUImageIOSImageEffectTypeLight,
GPUImageIOSImageEffectTypeExtraLight,
@depthlove
depthlove / GPUImageLittlePlanetProjectionFilter.h
Created October 11, 2017 17:18 — forked from suzumura-ss/GPUImageLittlePlanetProjectionFilter.h
`LittlePlanet` projection with GPUImage.framework
//
// GPUImageLittlePlanetProjectionFilter.h
//
// Created by Toshiyuki Suzumura on 2013/07/02.
// Copyright (c) 2013 Toshiyuki Suzumura. All rights reserved.
//
#import "GPUImageFilter.h"
@interface GPUImageLittlePlanetProjectionFilter : GPUImageFilter
@depthlove
depthlove / GPUImageMirrorFilter.h
Created October 11, 2017 17:17 — forked from virasio/GPUImageMirrorFilter.h
Mirror filter for GPUImage
//
// GPUImageMirrorFilter.h
//
#import <GPUImage/GPUImageFilter.h>
@interface GPUImageMirrorFilter : GPUImageFilter {
GLint verticalMirrorUniform, horizontalMirrorUniform;
}
@depthlove
depthlove / GPUImageFourInputFilter.h
Created October 11, 2017 17:16 — forked from johnpaulmanoza/GPUImageFourInputFilter.h
GPUImage Add Four Input Filter
#import <GPUImageThreeInputFilter.h>
extern NSString *const kGPUImageFourInputTextureVertexShaderString;
@interface GPUImageFourInputFilter : GPUImageThreeInputFilter
{
GPUImageFramebuffer *fourthInputFramebuffer;
GLint filterFourthTextureCoordinateAttribute;
GLint filterInputTextureUniform4;
@depthlove
depthlove / GLSL-Noise.md
Created October 4, 2017 11:01 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@depthlove
depthlove / FuckingAVFoundation.m
Created September 19, 2017 02:51 — forked from maximveksler/FuckingAVFoundation.m
Fucking AV Foundation code with audio and video mixing
- (void)buildTransitionCompositionAUDIO:(AVMutableComposition *)composition andVideoComposition:(AVMutableVideoComposition *)videoComposition andAudioMix:(AVMutableAudioMix *)audioMix
{
CMTime nextClipStartTime = kCMTimeZero;
// Add two video tracks and two audio tracks.
AVMutableCompositionTrack *compositionVideoTracks[2];
AVMutableCompositionTrack *compositionAudioTracks[2];
compositionVideoTracks[0] = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];
compositionVideoTracks[1] = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];
@depthlove
depthlove / AVAsset+VideoOrientation.h
Created September 16, 2017 12:26 — forked from luca-bernardi/AVAsset+VideoOrientation.h
Find the video orientation of an AVAsset. (Useful if you need to send the video to a remote server)
//
// AVAsset+VideoOrientation.h
//
// Created by Luca Bernardi on 19/09/12.
// Copyright (c) 2012 Luca Bernardi. All rights reserved.
//
#import <AVFoundation/AVFoundation.h>
typedef enum {
LBVideoOrientationUp, //Device starts recording in Portrait
@depthlove
depthlove / YUV420PGrabber.cpp
Created September 15, 2016 21:59 — forked from roxlu/YUV420PGrabber.cpp
OpenGL RGB > YUV420P shader/class (doesn't do much more. implementation/usage is up to you)
#include <assert.h>
#include <roxlu/core/Utils.h>
#include <roxlu/core/Log.h>
#include "YUV420PGrabber.h"
YUV420PGrabber::YUV420PGrabber()
:y_prog(0)
,y_vert(0)
,y_frag(0)
,uv_prog(0)