B-L-A-C-K-O-P
 
 
Saturday, January 12, 2008
Quartz Composer Patch : Sawtooth Mask
/* Published by b-l-a-c-k-o-p.com
Copyright (c) 2007-2008
http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
*/
SAMPLE: QameraVHSPlayBack.qtzThis kernel evaluates the sawtooth waveform at each vertical pixel location, x, and computes the alpha based on the value of the function at that point.


const float M_PI = 3.1415926535897932384;
const float period_degrees = 180.0;

float inverse_saw(float in_angle_degrees)
{
float angle_degrees = clamp(in_angle_degrees,0.0, period_degrees);
float value_normal = angle_degrees/period_degrees;
float value_if_nz = (value_normal*2.0 - 1.0);
float value = (angle_degrees==0.0) ? 0.0 : -1.0*value_if_nz;
return value;
}

kernel vec4 msBlackHorizontalSawMask(sampler input_image, float input_frequency, float input_amplitude, float input_offset, float input_phase)
{
vec2 image_size = samplerSize(input_image);
vec2 pixel_coord = samplerCoord(input_image);
vec4 pixel = sample(input_image, pixel_coord);
float pixel_y_normal = pixel_coord.y/image_size.y;
float degrees = (pixel_y_normal* period_degrees);
float phase = clamp(input_phase* period_degrees,0.0, period_degrees);
float alpha = input_offset + (input_amplitude * mod(phase+input_frequency* inverse_saw(degrees),1.0));
pixel.a = alpha*pixel.a;
return vec4(clamp(pixel, 0.0, 1.0));
}

Blogged by Ms. Black under Quartz Composer Patch : Sawtooth Mask

 

 
 
 

 B-L-A-C-K-O-P NEWS   
 SITE MAP   
 BLACKOP   
 PRESS   
 B-L-A-C-K-O-P HOME   
 DotMatrix   
 CamCamX   
 Q@mera   
 AsSceneOnTV   
 GrabberRaster   
 Store   
 DOWNLOAD   
 COCOA NIBS   
 BlackenedPixels   
 Share Your Pictures   
 Washington DC   
 Universal Binary   
 Cocoa Programming   
 Cocoa Software   
 Screen Capture   
 Screen Grab Mac   
 iSight download   
 iSight software   
 DotMatrix Blog   
 WebCam   
 PhotoBooth download   
 iPhoto   
 Photoshop   
 MacBook Camera   
 iMac Camera   
 CamCamX Blog   
 CamCamX compatibility   
 Fake WebCam Mac   
 VJ Software Mac   
 Video Mixer Mac   
 Webcam Video Effects   
 Free iChat Video Effects   
 Skype Video Effects Mac   
 Video Effects Stickam   
 iSight Virtualizer Mac   
 Webcast Streaming Mac   
 Broadcast Live Streaming Video Mac   
 QuickTime Broadcaster   
 Quartz Composer   
 Quartz Composer Plugins   
 Mogulus Video FX   
 Video Effects Ustream   
 Operator11 Video FX   
 Polaroid Camera Emulator   
 No recording device found   
 Photo Booth cannot open the camera   
 Free Download/Telechargez   
 Liberi Trasferimento   
 Libere la Transferencia   
 Disclaimer   
 Corporate   
 About   
 


Copyright © 2005-2007
All Rights Reserved
B-L-A-C-K-O-P