sky.monome.frame.analyzer
Class MidGreyAnalyzer

java.lang.Object
  extended by sky.monome.frame.analyzer.MidGreyAnalyzer
All Implemented Interfaces:
PictureAnalyzer

public class MidGreyAnalyzer
extends java.lang.Object
implements PictureAnalyzer

Analyzer for pixels of a picture that is displayed in a PictureFrame. The mid-grey analyzer returns LedState.ON when the average of these three values is over or equal to 128, LedState.OFF otherwise.

Author:
PJ Skyman

Constructor Summary
MidGreyAnalyzer()
          Constructs a mid grey analyzer.
 
Method Summary
 LedButtonCouple.LedState getLedStateForPixel(int[] pixel)
          Returns the led state that corresponds to specified Red/Green/Blue informations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidGreyAnalyzer

public MidGreyAnalyzer()
Constructs a mid grey analyzer.

Method Detail

getLedStateForPixel

public LedButtonCouple.LedState getLedStateForPixel(int[] pixel)
Returns the led state that corresponds to specified Red/Green/Blue informations. The mid-grey analyzer returns LedState.ON when the average of these three values is over or equal to 128, LedState.OFF otherwise.

Specified by:
getLedStateForPixel in interface PictureAnalyzer
Parameters:
pixel - Red/Green/Blue informations of the desired pixel specified in an array of three integer values between 0 and 255 (included).
Returns:
The led state that corresponds to specified Red/Green/Blue informations.