Re: Core Image in FxPlug example
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=OVqZr2L3/vzLbJ5znxK83UDqguCVylTkmxREYM6UBjCjrAbgnuUqWCgI4gAsDtoB; h=Received:From:To:In-Reply-To:Subject:References:Message-Id:Content-Type:Content-Transfer-Encoding:Mime-Version:Date:Cc:X-Mailer:X-ELNK-Trace:X-Originating-IP; Hi Darrin. Thank you for your examples. Very helpful. Is there any example source code for the Displacement Distortion CI filter which you mention below? Which samples 3 pixels from one image, and 1 pixel from another image? That would be very helpful for me to see. There are very few examples which use multiple (or reference) images, and take multiple samples per image. Is there any such sample code available? (Like of the Displacement Distortion filter you describe, below.) -- Brian On Apr 28, 2009, at 9:01 AM, Darrin Cardani wrote: So let's say the grayscale version of your map image looked like this: 0.75 0.89 0.23 0.52 It takes (0.75 - 0.89) = -0.14 as the x offset It takes (0.75 - 0.23) = .52 as the y offset Does that make sense? Darrin On Apr 27, 2009, at 5:53 PM, Patrick Sheffield wrote: Thank you Darrin - this helps a lot. Thanks, -- Darrin Cardani dcardani@apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/brianrg%40earthlink.net _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... Glad it helps! It looks to me like Displacement Distortion is using the magnitude and direction of edges in the map image to offset pixels in the source image. I believe it first converts the map image to grayscale, then finds the difference of each pixel with its neighbors in the x and y directions. It multiplies the x and y differences by the scale parameter and uses the resulting vector as an offset from the current pixel in the source image. It then multiplies those values by the scale parameter. Let's say it's set to 25, so it comes up with an offset of (-3.5, 13). It adds that to the current (x,y) coordinate and samples the input image at (x - 3.5, y + 13). I wonder if you could shed some light on a specific CoreImage filter - specifically DisplacementDistortion... In Shake and in FxScript, the X-Displacement is governed by one channel in the displace image and the Y-Displacement by another. I can't find any documentation on the CI filter as to how it handles this. Patrick This email sent to brianrg@earthlink.net This email sent to site_archiver@lists.apple.com
participants (1)
-
Brian Gardner