Skip to content

Instantly share code, notes, and snippets.

Ralf Ebert ralfebert

Block or report user

Report or block ralfebert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ralfebert
ralfebert / CompareImages.swift
Last active Feb 28, 2018 — forked from SheffieldKevin/compareimages.swift
A couple of swift functions for comparing two CGImage using CIImage in OS X
View CompareImages.swift
import CoreGraphics
import CoreImage
func imageMetadataString(image: CGImage) -> String {
return "\(image.width)x\(image.height) bitsPerComponent:\(image.bitsPerComponent) bytesPerRow:\(image.bytesPerRow) bitsPerPixel:\(image.bitsPerPixel)"
}
/**
@brief Returns the maximum difference of pixel values in the image.
@discussion Assumes doImagesHaveSameMeta has already returned true on
@ralfebert
ralfebert / swift-kvo-example.swift
Last active Mar 10, 2016 — forked from correia/swift-kvo-example.swift
Swift 1.1: dynamic for observable properties neccessary, observeValueForKeyPath signature changed
View swift-kvo-example.swift
//
// Swift-KVO
//
// Created by Jim Correia on 6/5/14.
// Copyright (c) Jim Correia. All rights reserved.
//
// Update: 6/17/2014
//
// KVOContext has gone away; use the same idiom you'd use from Objective-C for the context
You can’t perform that action at this time.