  */
 
 import Foundation
+//import UIKit // for iOS use
+//import CoreGraphics // possibly needed for iOS use
 
 func rgb2hsv_pixel(R:Double, G:Double, B:Double)->(Double, Double, Double){
     // tested against wikipedia/HSL_and_HSV. returns (H, S_hsv, V)

//    var colorSpace = CGColorSpaceCreateDeviceRGB()
//    var bitsPerComponent = 8
//    var bytesPerRow = ((bitsPerComponent * width) / 8) * componentsPerPixel
//    var bitmapInfo = CGBitmapInfo.fromRaw(CGImageAlphaInfo.PremultipliedLast.toRaw())!
//    var context = CGBitmapContextCreate(&pixelData, UInt(width), UInt(height), UInt(bitsPerComponent), UInt(bytesPerRow), colorSpace, bitmapInfo)
//    
//    // creating the image
//    var toCGImage = CGBitmapContextCreateImage(context)
//    var image:UIImage = UIImage.init(CGImage:toCGImage)
//    return image
//}
//func resizeImage(image:UIImage, shape:(Int, Int)) -> UIImage{
//    // nice variables
//    var (height, width) = shape
//    var cgSize = CGSizeMake(width, height)
//    
//    // draw on new CGSize
//    UIGraphicsBeginImageContextWithOptions(cgSize, false, 0.0)
//    image.drawInRect(CGRectMake(0, 0, width, height))
//    var newImage = UIGraphicsGetImageFromCurrentImageContext()
//    UIGraphicsEndImageContext()
//    return newImage

//    return (r, g, b, a)
//}
//func RGBAToUIImage(r:matrix, g:matrix, b:matrix, a:matrix)->UIImage{
//    // might be useful! [1]
//    // [1]:http://stackoverflow.com/questions/30958427/pixel-array-to-uiimage-in-swift
//    // setup
//    var height = r.shape.0
//    var width = r.shape.1
