gpuimage

How do I modify a GPUImageGaussianSelectiveBlurFilter to operate over a rectangle instead of a circle?

依然范特西╮ 提交于 2019-12-18 07:15:24
问题 I have used the GPUImage framework for a blur effect similar to that of the Instagram application, where I have made a view for getting a picture from the photo library and then I put an effect on it. One of the effects is a selective blur effect in which only a small part of the image is clear the rest is blurred. The GPUImageGaussianSelectiveBlurFilter chooses the circular part of the image to not be blurred. How can I alter this to make the sharp region be rectangular in shape instead? 回答1

How do I animate in/out a gaussian blur effect in iOS?

廉价感情. 提交于 2019-12-17 22:33:45
问题 For the whole iOS 7 feel, I want to apply a blur effect to a specific portion of the screen to obfuscate it, but I don't want to just throw the blur on instantly, I want to animate it in and animate it out so the user almost sees the blur effect being applied. Almost as if in Photoshop you changed the gaussian blur value bit by bit from 0 to 10, instead of 0 to 10 in one go. I've tried a few solutions to this, the most popular suggestion being to simply put the blurred view on top of a non

Are the GPUImageBilateralFilter parameters of the GPUImage iOS Library the equivilent of Photoshop Surface Blur parameters?

折月煮酒 提交于 2019-12-13 19:08:18
问题 I understand that a Surface Blur in Photoshop is a bilateral filter. In the iOS Library GPUImage there is a filter GPUImageBilateralFilter with parameters of texelSpacingMultiplier and distanceNormalizationFactor. Would these match up directly to the Photoshop Surface Blur options of radius and threshold (respectively)? And would the values to these parameters be the same? Thanks! 回答1: Not exactly. With your standard Gaussian blurs, you typically specify a pixel radius (or sigma value in

Incompatible block pointer types sending 'int (^)(__strong id, __strong id)' to parameter of type 'NSComparator'

时间秒杀一切 提交于 2019-12-13 14:40:54
问题 Getting below error in GPUImage Library when moved from xcode 5.0 to 5.1. After searching on google i found that i need to send int like this [NSNumber numberWithInt:number] but issue is that i dont have control on the value getting passed to sortedArrayUsingComparator in below given code. Error Log: Incompatible block pointer types sending 'int (^)(__strong id, _ strong id)' to parameter of type 'NSComparator' (aka 'NSComparisonResult (^)( _strong id, __strong id)') Error on this line :

GPUImage Grayscale and contarst filter generating memory warning

折月煮酒 提交于 2019-12-13 05:50:29
问题 I am creating an app that convert image to binary image. For that i am using GPUimage framework. First it will convert it to grayscale than change contarst and than conevrt it to Binarize image. When i use grayscale and contrast filter it will generate memory warning and some time if i try to convert multiple image (lets say 10) at one by one app crashes. Here is my code : - (UIImage *) doBinarize:(UIImage *)sourceImage { UIImage * grayScaledImg = [self grayImage:sourceImage]; grayScaledImg =

Using GPUImage to filter a view live

自古美人都是妖i 提交于 2019-12-12 19:24:02
问题 I am trying to use GPUImage to filter a view as it is updated in a kind of iOS 7 style overlay. To do this I am running the following code on an NSTimer, however my NSLog is showing that [self.backgroundUIImage imageFromCurrentlyProcessedOutput] is returning (null) I know that the view self.background is working properly as it is also added to the view (self.finalImageView has also already been added to the view). I am not sure whether I'm going about this the right way at all as there is no

Getting the right coordinates of the visible part of a UIImage inside of UIScrollView

本秂侑毒 提交于 2019-12-12 01:09:25
问题 I have a UIImage which is inside a UIScrollView so I can zoom-in and zoom-out, crop, move around, etc. How do I get the coordinates of the visible part of the UIImage inside the UIScrollView. I want to crop the image in it's native resolution (using GPUIImage) but I need to x, y, width and height for the rectangle. 回答1: I use a scrollview to enable zoom of a UIImage. A cropping button presents an overlaid resizable cropping view. The following is the code I use to ensure the user defined crop

Check Device Type For GPUImage

雨燕双飞 提交于 2019-12-12 00:44:14
问题 GPUImage requires, for iPhone 4 and below, images smaller than 2048 pixels. The 4S and above can handle much larger. How can I check to see which device my app is currently running on? I haven't found anything in UIDevice that does what I'm looking for. Any suggestions/workarounds? 回答1: For this, you don't need to check device type, you simply need to read the maximum texture size supported by the device. Luckily, there is a built-in method within GPUImage that does this for you: GLint

Blending with GPUImage: How to control the position of the second image on top of the first

纵饮孤独 提交于 2019-12-11 23:34:49
问题 I use the following code to blend two images using GPUImage framework by Brad Larson. Is there a way to control the position of the topImage relatively to the baseImage? Now, it places topImage on the middle of baseImage. GPUImageMultiplyBlendFilter *overlayBlendFilter = [[GPUImageMultiplyBlendFilter alloc] init]; GPUImagePicture *pic1 = [[GPUImagePicture alloc] initWithImage:baseImage]; GPUImagePicture *pic2 = [[GPUImagePicture alloc] initWithImage:topImage]; [pic1 addTarget

function with bool return type in OpenGL ES shader using GPUImage

房东的猫 提交于 2019-12-11 14:33:35
问题 I'm working on an iOS project, using GPUImage framework. I cannot get my shader complied. There's a function in my fragment shader: const vec2 boundMin = vec2(0.0, 0.0); const vec2 boundMax = vec2(1.0, 1.0); bool inBounds (vec2 p) { return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)); } Shader compile log: ERROR: 0:1: '_Bool' : syntax error syntax error When I replace all the calls to function inBounds(vec2 p) with all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)) it works