dpvv37755
2014-05-14 13:19
浏览 55
已采纳

在Imagick中双线性失真中的参数是什么意思

I was referring example of Imagick::distortImage

Now look at Example 1 which generates following image

enter image description here

I got confused while looking at below part of code.

/* Control points for the distortion */
$controlPoints = array( 10, 10, 
                        10, 5,

                        10, $im->getImageHeight() - 20,
                        10, $im->getImageHeight() - 5,

                        $im->getImageWidth() - 10, 10,
                        $im->getImageWidth() - 10, 20,

                        $im->getImageWidth() - 10, $im->getImageHeight() - 10,
                        $im->getImageWidth() - 10, $im->getImageHeight() - 30);

Now can anybody tell me what this 16 points exactly means ?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douxiandiyo58855 2014-05-14 13:29
    已采纳

    The control point arguments are helpfully organised into this layout:

    x1  , y1  ,
    x1' , y1' ,
    
    x2  , y2  ,
    x2' , y2' ,
    
    x3  , y3  ,
    x3' , y3' ,
    
    x4  , y4  ,
    x4' , y4'
    

    For each set of coordinates, x_ and y_ are the source points, and x_' and y_' are the targets.

    So it's taking the top-left corner and moving it up a bit, the bottom-left is being moved down, the top-right is being moved down and the bottom-right is being moved up, producing the perspective result.

    点赞 打赏 评论

相关推荐 更多相似问题