Standard for US Driver's Licenses defines 9 different barcode standards (AAMVA versions) with over 80 different fields encoded inside a barcode. Some fields exist on all barcode standards, other exist only on some. To standardize the API, we have structured the fields in the following sections:
This file contains 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
extension UIImage | |
{ | |
func tint(color: UIColor, blendMode: CGBlendMode) -> UIImage | |
{ | |
let drawRect = CGRectMake(0.0, 0.0, size.width, size.height) | |
UIGraphicsBeginImageContextWithOptions(size, false, scale) | |
let context = UIGraphicsGetCurrentContext() | |
CGContextClipToMask(context, drawRect, CGImage) | |
color.setFill() | |
UIRectFill(drawRect) |
This file contains 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
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Shader; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; |
This file contains 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
// | |
// UIColor+RGB.swift | |
// Copyright (c) 2014 Massimiliano Bigatti. All rights reserved. | |
// | |
import Foundation | |
import UIKit | |
/** | |
UIColor extension that add a whole bunch of utility functions like: |
This file contains 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 *)imageByShiftingFromColor:(UIColor *)startColor toColor:(UIColor *)endColor | |
{ | |
CGFloat startHue, startSaturation, startBrightness, startAlpha; | |
BOOL parsedStartColor = [startColor getHue:&startHue saturation:&startSaturation brightness:&startBrightness alpha:&startAlpha]; | |
NSLog(@"start success: %i hue: %0.2f, saturation: %0.2f, brightness: %0.2f, alpha: %0.2f", parsedStartColor, startHue, startSaturation, startBrightness, startAlpha); | |
CGFloat endHue, endSaturation, endBrightness, endAlpha; | |
BOOL parsedEndColor = [endColor getHue:&endHue saturation:&endSaturation brightness:&endBrightness alpha:&endAlpha]; | |
NSLog(@"end success: %i hue: %0.2f, saturation: %0.2f, brightness: %0.2f, alpha: %0.2f", parsedEndColor, endHue, endSaturation, endBrightness, endAlpha); |
This file contains 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
The Colorize option changes the nature of the Hue/Saturation control. | |
When checked, it removes the color from an image and overlays the image with a tint of a single hue and saturation. | |
Each pixel's luminosity remains unchanged (actually, it is changed, but very little). | |
With the Colorize option, the Hue and Saturation values are no longer relative numbers based on an offset from a starting point. | |
Instead, they are absolute numbers. | |
The Hue value ranges from 0° to 360° and represents an absolute position on the color wheel (0° and 360° are the same color; red) | |
The Saturation value ranges from 0% to 100%. | |
If Saturation is changed to 0%, color will be negated and the pixels will go gray. | |
Using Hue/Saturation to colorize an image is not the same as making a duo tone. |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
This file contains 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
<!doctype html> | |
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]--> | |
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]--> | |
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]--> | |
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name='description' content='{MetaDescription}'> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
This file contains 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
using System; | |
using System.IO; | |
using System.Net; | |
using System.Runtime.Serialization.Json; | |
using System.Text; | |
/// <summary> | |
/// Strongly typed GET and POST utility enum. | |
/// </summary> | |
public enum HTTPMethod |