void Transform::binary( RawTile &in, unsigned char threshold ){

  // Only apply to 8 bit images
  if( in.bpc != 8 ) return;

  // First make sure our image is greyscale
  this->greyscale( in );

  unsigned int np = in.width * in.height;

#if defined(__ICC) || defined(__INTEL_COMPILER)
#pragma ivdep
#elif defined(_OPENMP)
#pragma omp parallel for if( in.width*in.height > PARALLEL_THRESHOLD )
#endif
  for( unsigned int i=0; i<np; i++ ){
    ((unsigned char*)in.data)[i] = ( ((unsigned char*)in.data)[i] < threshold ? (unsigned char)0 : (unsigned char)255 );
  }
}
void Transform::binary( RawTile &in, unsigned char threshold ){

   
  if( in.bpc != 8 ) return;

   
  this->greyscale( in );

  unsigned int np = in.width * in.height;

#if defined(__ICC) || defined(__INTEL_COMPILER)
#pragma ivdep
#elif defined(_OPENMP)
#pragma omp parallel for if( in.width*in.height > PARALLEL_THRESHOLD )
#endif
  for( unsigned int i=0; i<np; i++ ){
    ((unsigned char*)in.data)[i] = ( ((unsigned char*)in.data)[i] < threshold ? (unsigned char)0 : (unsigned char)255 );
  }
}