Skip to content

Instantly share code, notes, and snippets.

View SheffieldKevin's full-sized avatar

Kevin Meaney SheffieldKevin

View GitHub Profile
@SheffieldKevin
SheffieldKevin / main.m
Last active November 26, 2018 18:22
I had far more difficulty getting the generation of gif animations working correctly using ImageIO and Core-Graphics aka Quartz on MacOS/iOS than should have reasonably been expected.
// main.m
// creategif
//
// Created by Kevin Meaney on 21/10/2013.
// I've briefly blogged about it here:
// http://blog.yvs.eu.com/2013/10/creating-gif-animations-using-coreimagequartz
// The following code is all that is all the code needed for a creating a command line tool to generate
// a gif animation from image files.
// The main limitation with this code is that apart from the frame delay time of 0.1 second, every
@SheffieldKevin
SheffieldKevin / Compare images not working
Last active August 29, 2015 13:56
The CIAreaMaximum filter is not working.
// main.m
// compareimages
//
// Created by Kevin Meaney on 25/02/2014.
// Copyright (c) 2014 Kevin Meaney. All rights reserved.
@import Foundation;
@import QuartzCore;
// ---------------------------------------------------------------------------
@SheffieldKevin
SheffieldKevin / main.m
Last active July 1, 2022 06:43
Code to demonstrate that the backside image option for the CIPageCurlTransition filter doesn't work.
// main.m
// pagecurlbacksidetest
//
// Created by Kevin Meaney on 30/03/2014.
@import Foundation;
@import QuartzCore;
size_t const kWidth = 600;
size_t const kHeight = 400;
@SheffieldKevin
SheffieldKevin / MPO image meta
Created April 24, 2014 14:16
MPO image meta
{
"{TIFF}": {
"ResolutionUnit": 2,
"Software": "NEX-5N v1.01",
"DateTime": "2013:07:28 13:50:35",
"XResolution": 350,
"ImageDescription": " ",
"Orientation": 1,
"Model": "NEX-5N",
"Make": "SONY",
@SheffieldKevin
SheffieldKevin / BaseDerivedClassMethods
Last active August 29, 2015 14:01
Calling derived class methods from the base class. What do you think this code outputs.
#import <Foundation/Foundation.h>
@interface BaseClass : NSObject
+(void)callDerivedClassMethod;
@end
@interface DerivedClass : BaseClass
+(void)derivedClassMethod;
@end
@SheffieldKevin
SheffieldKevin / coda_runscript.rb
Last active August 29, 2015 14:05
Coda run the current document in ruby plugin script
#!/usr/bin/env ruby
# This is the script code to run. It runs the script based on the file path to the script not text passed in.
# In Panic's "Coda Plug-in Creator" I've set the following options:
# Command is: Run Document
# Keyboard shortcut: Command-Option-R
# On Run: Save
# On Success: Nothing
# STDIN None
# STDOUT New Document
@SheffieldKevin
SheffieldKevin / scaleandwatermark
Created October 12, 2014 22:04
ruby/applescript display select folder dialog script for Paul
#!/usr/bin/env ruby
# Scale and add a text water mark to images.
require 'moving_images'
include MovingImages
# The folder where the water marked images will be saved.
output_dir = "~/Desktop/watermarkedfiles"
@SheffieldKevin
SheffieldKevin / CreateImageProtocol.h
Created October 17, 2014 16:38
Objective-C properties of protocols that take blocks/closures and accessing them in Swift
//
// CreateImageProtocol.h
// test
//
// Created by Kevin Meaney on 17/10/2014.
// Copyright (c) 2014 Kevin Meaney. All rights reserved.
//
#import <Foundation/Foundation.h>
@SheffieldKevin
SheffieldKevin / movietransitions.swift
Last active June 25, 2021 16:58
Make a movie with transitions with AVFoundation and swift
//
// main.swift
// mutablecomposition
//
// Created by Kevin Meaney on 24/08/2015.
// Copyright (c) 2015 Kevin Meaney. All rights reserved.
//
import Foundation
@SheffieldKevin
SheffieldKevin / movietracks.swift
Last active November 7, 2020 14:47
Playing with movie tracks using AVFoundation in Swift (command line version)
#!/usr/bin/env swift
import Foundation
import AVFoundation
if Process.arguments.count != 2 {
println("The first and only argument should be a full path to a movie or music file.")
exit(1)
}