FACT++  1.0
void FilterLed::Stretch ( ) const

Definition at line 502 of file FilterLed.cc.

Referenced by Execute(), and MStarguider::ProcessFrame().

503 {
504  uint8_t min, max;
505  GetMinMax(25, &min, &max);
506 
507  if (min==max || max-min>230) // 255/230=1.1
508  return;
509 
510  const float scale = 255./(max-min);
511 
512  uint8_t *b = fImg;
513  const uint8_t *e = fImg+fW*fH;
514 
515  while (b<e)
516  {
517  if (*b<min)
518  {
519  *b++=0;
520  continue;
521  }
522  if (*b>max)
523  {
524  *b++=255;
525  continue;
526  }
527  *b = (uint8_t)((*b-min)*scale);
528  b++;
529  }
530 }
int fH
Definition: FilterLed.h:14
int fW
Definition: FilterLed.h:13
void GetMinMax(const int offset, uint8_t *min, uint8_t *max) const
Definition: FilterLed.cc:210
uint8_t * fImg
Definition: FilterLed.h:12

+ Here is the caller graph for this function: