(originalImage: UIImage)
| 664 | // Flipping the default coordinate system |
| 665 | // https://developer.apple.com/library/ios/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html |
| 666 | function _flipImage(originalImage: UIImage): UIImage { |
| 667 | UIGraphicsBeginImageContextWithOptions(originalImage.size, false, 0.0); |
| 668 | const context = UIGraphicsGetCurrentContext(); |
| 669 | CGContextSaveGState(context); |
| 670 | CGContextTranslateCTM(context, 0.0, originalImage.size.height); |
| 671 | CGContextScaleCTM(context, 1.0, -1.0); |
| 672 | originalImage.drawInRect(CGRectMake(0, 0, originalImage.size.width, originalImage.size.height)); |
| 673 | CGContextRestoreGState(context); |
| 674 | const flippedImage = UIGraphicsGetImageFromCurrentImageContext(); |
| 675 | UIGraphicsEndImageContext(); |
| 676 | |
| 677 | return flippedImage; |
| 678 | } |
| 679 | |
| 680 | function cssValueToDeviceIndependentPixels(source: string, total: number): number { |
| 681 | source = source.trim(); |
no outgoing calls
no test coverage detected