mercator

Member

Last active 11 months ago

  1. 11 months ago
    Mon Mar 28 17:01:35 2016
    mercator started the conversation Resize CIImage.

    Good afternoon,
    I try to resize a CIImage to be exactly VECTORSIZE times VECTORSIZE bits.

    var width = (Int(image!.extent.size.width))
        var height = (Int(image!.extent.size.height))
        
        let imgScale = Double(VECTORSIZE) / Double(height)
        
        let scaleTransform = CIFilter(name: "CILanczosScaleTransform")
        scaleTransform!.setValue(grey!.valueForKey("outputImage") as! CIImage, forKey: kCIInputImageKey)
        scaleTransform!.setValue(imgScale, forKey: kCIInputScaleKey)
        scaleTransform!.setValue(Double(height)/Double(width), forKey: "inputAspectRatio")


    However, sometimes the I get VECTORSIZE+1 sized images. Is there a another CIFilter I can use to specify the exact size of the resulting CIImage? If you have a function at hand including the parameters, I'd be really thankful.
    Regards,
    Mercator

  2. Mon Mar 28 15:45:52 2016
    mercator joined the forum.