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
// | |
// UIImage+PDF.swift. Copyright © 2016 Nigel Timothy Barber (@mindbrix). All rights reserved. | |
// | |
import UIKit | |
extension UIImage { | |
static func PDFImageWith(_ url: URL, pageNumber: Int, width: CGFloat) -> UIImage? { | |
return PDFImageWith(url, pageNumber: pageNumber, constraints: CGSize(width: width, height: 0)) | |
} | |
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
// | |
// UIImage+Decompression.swift | |
// Contis Protocol | |
// | |
// Created by Nigel Barber on 01/03/2017. | |
// Copyright © 2017 @mindbrix. All rights reserved. | |
// | |
import CoreGraphics | |
import ImageIO |
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
// | |
// PDFImage.swift. Copyright © 2016 Nigel Timothy Barber (@mindbrix). All rights reserved. | |
// | |
import UIKit | |
extension UIImage { | |
static func PDFImageWith(url: NSURL, pageNumber: Int, width: CGFloat) -> UIImage? { | |
return PDFImageWith(url, pageNumber: pageNumber, constraints: CGSizeMake(width, 0)) | |
} | |
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
NSString *hexString = @"1F0A7"; | |
unsigned int character; | |
NSScanner* scanner = [NSScanner scannerWithString:hexString ]; | |
[ scanner scanHexInt:&character ]; | |
UTF32Char inputChar = NSSwapHostIntToLittle(character); // swap to little-endian if necessary | |
NSString *str = [[NSString alloc] initWithBytes:&inputChar length:4 encoding:NSUTF32LittleEndianStringEncoding]; |
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
#pragma once | |
#include "Vector.hpp" | |
template <typename T> | |
struct Matrix2 { | |
Matrix2() | |
{ | |
x.x = 1; x.y = 0; | |
y.x = 0; y.y = 1; | |
} |
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
// | |
// NTBFifoOperationQueue.h | |
// Timeline | |
// | |
// Created by Nigel Barber on 19/11/2013. | |
// Copyright (c) 2013 Nigel Barber. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
// | |
// UILabel+MultiLineSupport.h | |
// giffgaffIOS | |
// | |
// Created by Nigel Barber on 23/10/2013. | |
// Copyright (c) 2013 confidence. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
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
// | |
// UILabel+MultiLineSupport.h | |
// giffgaffIOS | |
// | |
// Created by Nigel Barber on 23/10/2013. | |
// Copyright (c) 2013 confidence. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
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
-(void)drawTimecodeUsingGCD | |
{ | |
if( dispatch_semaphore_wait( _timecodeSemaphore, DISPATCH_TIME_NOW ) != 0 ) | |
{ | |
return; | |
} | |
dispatch_async( _timecodeQueue, ^() | |
{ | |
float fontSize = ceilf( self.scrubberSize * 0.425f ); |
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
// | |
// NTBProxyImageView.h | |
// Vectoria Squared | |
// | |
// Created by Nigel Barber on 22/04/2013. | |
// Copyright (c) 2013 Nigel Barber. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
NewerOlder