Quartz 2D/OpenGLES geometric distortions on images (preferrably using CGImage)

前端 未结 1 613
太阳男子
太阳男子 2021-02-04 21:11

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 ty

相关标签:
1条回答
  • 2021-02-04 21:50

    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 ]

    0 讨论(0)
提交回复
热议问题