This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" = "-l" ] || [ "$1" = "--line" ] ; then | |
line=$2 | |
file=$3 | |
else | |
line=1 | |
file=$1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseImageProcessor { | |
func createARGBBitmapContext(image: CGImage) -> CGContext? { | |
let pixelWidth = image.width | |
let pixelHeight = image.height | |
let bitmapBytesPerRow = pixelWidth * 4 | |
let bitmapByteCount = bitmapBytesPerRow * pixelHeight | |
let bitmapData: UnsafeMutableRawPointer = malloc(bitmapByteCount) | |
let colorSpace: CGColorSpace = CGColorSpaceCreateDeviceRGB() |