石英2D / OpenGLES图像上的几何失真(最好使用CGImage) [英] Quartz 2D/OpenGLES geometric distortions on images (preferrably using CGImage)

查看:219
本文介绍了石英2D / OpenGLES图像上的几何失真(最好使用CGImage)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是实施诸如捏/鱼眼等几何变形的首选方法。使用iPhone SDK?我知道OSX的核心图像库有内置的所有这些类型的过滤器,但不是iPhone SDK。

我可以在特定位置创建位移贴图和半径给定的原始源位图数据,但我不知道如何将这个位图数据作为我的CGImage转换。



这不是一个仿射变换因为线不再平行在扭曲/等区域周围。

有可能使用CGImage或者我需要使用OpenGLES来做这个吗?



谢谢
实际上,Flash 8的DisplacementMapFilter条目描述了给定位移的一般位移贴图变换由像素分量(x,y)组成的映射如下:
$ b $ dstPixel [x,y] = srcPixel [
x +((componentX(x,y) ) - 128)* scaleX)/ 256,
y +((componentY(x,y) - 128)* scaleY)/ 256
]

What is the preferred method for implementing such geometric distortions as pinch/fisheye/etc. using the iPhone SDK? I know that the Core Image library for OSX has all these types of filters built in, but not for the iPhone SDK.

I can create a displacement map at a specific location and radius given the original source bitmap data, but I'm not sure how to apply this bitmap data as a transformation on my CGImage.

This isn't an affine transformation since lines are no longer parallel around the area of distortion/etc.

Is it possible using CGImage or would I need to do this using OpenGLES?

Thanks

解决方案

Actually, Flash 8's DisplacementMapFilter entry describes the general displacement map transformation given a displacement map made up of pixels component(x,y) as follows:

dstPixel[x, y] = srcPixel[ x + ((componentX(x, y) - 128) * scaleX) / 256, y + ((componentY(x, y) - 128) * scaleY) / 256 ]

这篇关于石英2D / OpenGLES图像上的几何失真(最好使用CGImage)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆