Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
#import <Cocoa/Cocoa.h> | |
@interface NSColor (Hex) | |
- (NSString *)hexadecimalValue; | |
+ (NSColor *)colorFromHexadecimalValue:(NSString *)hex; | |
@end | |
#import "NSColor+Hex.h" |
/* | |
To use: | |
1) Get path to file/folder using file selection dialog. | |
2) Pass path to secscopGetBookmarkFromURL in order to get bookmark data for it. | |
3) Store this bookmark data somehow. | |
4) Tell the OS you want access to the file using secscopInitializeURLFromBookmarkData(). Store security-scoped url returned for later. | |
5) When you are done using the file call secscopStopUsingURL. | |
You will need to do steps 4 and 5 every time you want to open a file across sessions. For example, if you have a recent files menu or a folder that a user selects once and you write data to across sessions. | |
*/ |
NSImage *CaptureScreen() { | |
// Get the Screen Rect | |
NSRect screenRect = [[NSScreen mainScreen] frame]; | |
// Create a CGImage with the screen contents | |
CGImageRef cgImage = CGWindowListCreateImage(screenRect, kCGWindowListOptionOnScreenOnly, kCGNullWindowID, kCGWindowImageDefault); | |
// Convert the CGImage into a NSBitmapImageRep | |
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage]; |
// Use OpenGL 3.0+, but don't use GLU | |
#define GLFW_INCLUDE_GL3 | |
#define GLFW_NO_GLU | |
#include <GL/glfw.h> | |
#include <glm/glm.hpp> | |
#include <glm/gtc/matrix_transform.hpp> | |
#include <glm/gtc/type_ptr.hpp> | |
extern "C" { |
static BOOL isKeyFrame(CMSampleBufferRef sample) | |
{ | |
auto a = CMSampleBufferGetSampleAttachmentsArray(sample, 0); | |
if (CFArrayGetCount(a) > 0) { | |
CFBooleanRef value; | |
auto b = CFDictionaryGetValueIfPresent | |
((CFDictionaryRef) CFArrayGetValueAtIndex(a, 0) | |
, kCMSampleAttachmentKey_NotSync | |
, reinterpret_cast<const void **>(&value)) | |
; |
# note these instructions are as of Dec 28, 2015 | |
# the vlc and vlckit repos are super complex and have thousands of dependencies from everywhere on the internet. | |
# so, you'll need to mess with things a bit | |
git clone http://code.videolan.org/videolan/VLCKit.git | |
cd VLCKit | |
./buildMobileVLCKit.sh -t |
@interface SREAGLContext : NSObject | |
+ (EAGLContext*)sharedContext; | |
+ (EAGLContext*)newContext: (EAGLRenderingAPI) api; | |
@end | |
@implementation SREAGLContext |
ffmpeg -i confettis1.mov -vf unpremultiply=inplace=1 -c:v libvpx-vp9 -b:v 0 -crf 31 -s 924x1008 confettis.webm |