0 Replies Latest reply on Nov 1, 2006 2:07 PM by soulhab

    limit of  "Displacement Map Filter "

    soulhab
      I been working with DisplacementMapFilter on a BitmapData and I realize that there is a restriction in displacement.

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


      The componentX(x, y) returns a Number from 0 to 255 because is limited by the 8 bits of the color component.

      a.e: the scaleX is 256, the componentX return 255 so the displacement will be:

      srcPixel[x + (( 255 - 128) * 256) / 256, .....]
      wich is: x + 127 // here I can only get a half of the total displacement (127 of 256)

      in the other hand if the componentX return 0 the displacement will be:

      srcPixel[x + (( 0 - 128) * 256) / 256, ....]
      wich is: x - 127 // here I only can get the half of the displacement also

      Now my question: Can I get a full displacement ?

      How can I do a faster displacement like: destPixel[x1, y1] = srcPixel[x2, y2]

      Thanks in advance .