cikernel

Metal: vertexFunction defined in .metal file becomes nil once setting Compiler and Linker Options for MSL cikernel

亡梦爱人 提交于 2020-02-23 07:14:48
问题 VertexFunction and FragmentFunction defined in .metal file worked nicely, but they became nil once I specified Compiler and Linker Options following Apple's doc: -fcikernel flag in the Other Metal Compiler Flags option, and -cikernel flat in MTLLINKER_FLAGS in User-Defined setting. I need the settings above for cikernel with MSL (metal shading language). Indeed, cikernel with Core Image Kernel Language deprecated in 12.0. How could I use both vertex/fragment Metal shader and MSL cikernel

Adaptive Threshold CIKernel/CIFilter iOS

試著忘記壹切 提交于 2019-12-21 01:06:32
问题 I have researched all over in order to find a kernel that performs adaptive thresholding on iOS. Unfortunately I do not understand the kernel language or the logic behind it. Below, I have found a routine that performs thresholding (https://gist.github.com/xhruso00/a3f8a9c8ae7e33b8b23d) static NSString * const kKernelSource = @"kernel vec4 thresholdKernel(sampler image)\n" "{\n" " float inputThreshold = 0.05;\n" " float pass = 1.0;\n" " float fail = 0.0;\n" " const vec4 vec_Y = vec4( 0.299, 0

Metal - Resize video buffer before passing to custom Kernel filter

余生颓废 提交于 2019-11-28 02:17:39
Within our iOS app, we are using custom filters using Metal (CIKernel/CIColorKernel wrappers). Let's assume we have a 4K video and a custom video composition with a 1080p output size, that applies an advanced filter on the video buffers. Obviously, we don't need to filter the video in its original size, doing so we'll probably terminate the app with a memory warning (true story). This is the video-filtering pipeline: Getting the buffer in 4K (as CIImage ) --> Apply filter on the CIImage --> the filter applies the CIKernel Metal filter function on the CIImage --> Return the filtered CIImage to

Metal - Resize video buffer before passing to custom Kernel filter

限于喜欢 提交于 2019-11-26 23:40:41
问题 Within our iOS app, we are using custom filters using Metal (CIKernel/CIColorKernel wrappers). Let's assume we have a 4K video and a custom video composition with a 1080p output size, that applies an advanced filter on the video buffers. Obviously, we don't need to filter the video in its original size, doing so we'll probably terminate the app with a memory warning (true story). This is the video-filtering pipeline: Getting the buffer in 4K (as CIImage ) --> Apply filter on the CIImage -->