I hereby claim:
- I am randomsequence on github.
- I am mrwalker (https://keybase.io/mrwalker) on keybase.
- I have a public key ASD3MgjS87gY-zIZHwDSc4NFHchTH8etjXtHFArSk8gGVQo
To claim this, I am signing this object:
| import MetalPerformanceShaders | |
| struct Pixel { | |
| var red: UInt8 | |
| var green: UInt8 | |
| var blue: UInt8 | |
| var alpha: UInt8 | |
| } | |
| let count = 64 |
| /* | |
| The MIT License (MIT) | |
| Copyright (c) 2014-2015 Russel Lindsay | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is |
| #import <Foundation/Foundation.h> | |
| #include <pthread.h> | |
| @interface Getty : NSObject { | |
| @protected | |
| id _object; | |
| } | |
| @property (nonatomic, strong, readonly) id object; | |
| @end |
| // | |
| // Thanks Kevin! | |
| // https://gist.github.com/SheffieldKevin/566dc048dd6f36716bcd | |
| // | |
| import CoreGraphics | |
| import CoreImage | |
| extension CGImage { | |
I hereby claim:
To claim this, I am signing this object:
| import Cocoa | |
| struct Pixel { | |
| var alpha: UInt8 | |
| var red: UInt8 | |
| var green: UInt8 | |
| var blue: UInt8 | |
| init(red: UInt8, green: UInt8, blue: UInt8, alpha: UInt8) { | |
| self.alpha = alpha |
| import Cocoa | |
| // helper function which takes a size and a drawing function. | |
| // returns an image | |
| public func drawItems(bounds: CGRect, block: (bounds: CGRect, context: CGContextRef) -> () ) -> NSImage? { | |
| var outputImage: NSImage? = nil | |
| let insetSize = CGSizeMake(-20, -20) | |
| let insetBounds = CGRectInset(bounds, insetSize.width, insetSize.height) | |
| let colorSpace = CGColorSpaceCreateDeviceRGB() |
| //: Playground - noun: a place where people can play | |
| import Cocoa | |
| let bounds = CGRectMake(0, 0, 100, 100); | |
| func DrawImageInCGContext(#size: CGSize, #drawFunc: (context: CGContextRef) -> ()) -> NSImage { | |
| let colorSpace = CGColorSpaceCreateDeviceRGB() | |
| let bitmapInfo = CGBitmapInfo(CGImageAlphaInfo.PremultipliedLast.rawValue) | |
| let context = CGBitmapContextCreate( |
| @implementation CIContext (IntermediateImage) | |
| - (CIImage *)rsq_renderToIntermediateImage:(CIImage *)image { | |
| CIImage *intermediateImage = nil; | |
| CGSize size = image.extent.size; | |
| CVPixelBufferRef pixelBuffer = NULL; | |
| CVReturn status = CVPixelBufferCreate(kCFAllocatorDefault, | |
| size.width, | |
| size.height, | |
| kCVPixelFormatType_32ARGB, |
| // | |
| // UIImage+Scramble.m | |
| // | |
| // Created by Johnnie Walker on 24/04/2014. | |
| // | |
| #import "UIImage+Scramble.h" | |
| @import Accelerate; |