Advertisement
Guest User

hh

a guest
Dec 1st, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -(void)ReDraw{
  2.     imgPRE = imgORG;
  3.     for (int i = 0; i<[Parameter_Name count]; i++) {
  4.         imgPRE =  [self ifFilter:[Parameter_Name objectAtIndex:i] Value:[[Parameter_Value objectAtIndex:i]floatValue] Input:imgPRE];
  5.     }
  6.     [self performSelectorOnMainThread:@selector(UpdateView) withObject:nil waitUntilDone:NO];
  7. }
  8.  
  9. -(void)UpdateView{
  10.     imgV.image = imgPRE;
  11. }
  12.  
  13.  
  14. -(UIImage*)ifFilter:(NSString*)Name Value:(float)Value Input:(UIImage*)Input{
  15.     if (Name == @"filter") {
  16.        
  17.         Input = [self FiltersSwitch:Value Input:Input];
  18.         return Input;
  19.     }
  20.     else if (Name == @"gaussian") {
  21.         Input = [filters GausianBlurFilter:Input Amount: Value];
  22.         return Input;
  23.     }
  24.     else if (Name == @"hue"){
  25.         Input =  [filters HueFilter:Input inputAngle: Value];
  26.         return Input;
  27.     }
  28.     else if (Name == @"exposure"){
  29.         Input =  [filters ExposureFilter:Input inputEV: Value];
  30.         return Input;
  31.     }
  32.     else if (Name == @"saturation"){
  33.         Input =  [filters Saturation:Input Saturation:Value];
  34.         return Input;
  35.     }
  36.     else if (Name == @"contrast"){
  37.         Input =  [filters Contrast:Input Contrast:Value];
  38.         return Input;
  39.     }
  40.     else if (Name == @"brightness"){
  41.         Input =  [filters Brightness:Input Brightness:Value];
  42.         return Input;
  43.     }
  44.     return Input;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement