Esempio n. 1
0
/**
 * Apply Rainbow-Crush Distortion
 * @param intensity a double-precision number between 0 and 1
 */
void distortion::applyRainbowCrush(const double intensity) {
  
  Surface::Iter iter = mSurface.getIter();
  
  // int a = time(0);
  int t = 0;
  
  while (iter.line()) {
    while (iter.pixel()) {
      t++;
      iter.rClamped(0, 0) = iter.gClamped(7, 3);
      iter.gClamped(0, 0) = iter.rClamped(7, 1);
      iter.bClamped(0, 0) = iter.bClamped(7, 2);
      
    }
  }
  app::console() << t << "\n";
}