Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-04-2010, 02:14 AM   #30 (permalink)
rocotilos
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default

I ditched the colorize filter.

I found a contrast filter instead.

Code:
thevalue range must be between 0 and 4.

for(int index=0;index<length;index+=4){
			double amountRed;
			double amountGreen;
			double amountBlue;
			
			
			amountRed = (double)data[index+1]/255;
			amountRed -= 0.5;
			amountRed *= thevalue;
			amountRed += 0.5;
			amountRed *= 255;
			if (amountRed <0 ) amountRed = 0;
			if (amountRed>255) amountRed = 255;
			
			
			amountGreen = (double)data[index+2]/255;
			amountGreen -= 0.5;
			amountGreen *= thevalue;
			amountGreen += 0.5;
			amountGreen *= 255;
			if (amountGreen <0 ) amountGreen = 0;
			if (amountGreen>255) amountGreen = 255;
			
			amountBlue = (double)data[index+3]/255;
			amountBlue -= 0.5;
			amountBlue *= thevalue;
			amountBlue += 0.5;
			amountBlue *= 255;
			if (amountBlue <0 ) amountBlue = 0;
			if (amountBlue>255) amountBlue = 255;
			
			
			data[index+1] = (Byte)amountRed;
			data[index+2] = (Byte)amountGreen;
			data[index+3] = (Byte)amountBlue;
		}
While playing around with manipulating pixels, I also found Artistic Pen Sketch filter!!!
rocotilos is offline   Reply With Quote
 

» Advertisements
» Online Users: 556
16 members and 540 guests
argeliaer91, beckz007, BrianSlick, djbrooks111, djohnson, Domele, dylanreich, Hassasin, HemiMG, ilmman, kasumar, larueta13, mariano_donati, shwetap, SLIC, Thompson22
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,446
Threads: 94,031
Posts: 402,604
Top Poster: BrianSlick (7,978)
Welcome to our newest member, larueta13
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:59 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.