uk.co.silentsoftware.core.colourstrategy
Class FullPaletteStrategy

java.lang.Object
  extended by uk.co.silentsoftware.core.colourstrategy.FullPaletteStrategy
All Implemented Interfaces:
ColourChoiceStrategy
Direct Known Subclasses:
GigaScreenStrategy

public class FullPaletteStrategy
extends java.lang.Object
implements ColourChoiceStrategy

Colouring strategy to colour all pixels using whichever of the two popular colours is closest to the original.


Constructor Summary
FullPaletteStrategy()
           
 
Method Summary
 int colour(int originalAlphaRgb, int mostPopularRgbColour, int secondMostPopularRgb)
          Method to return the RGB int colour (Spectrum colour) that should be used for a given pixel based on the Spectrum colours passed in as mostPopularColour and secondMostPopularColour.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FullPaletteStrategy

public FullPaletteStrategy()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

colour

public int colour(int originalAlphaRgb,
                  int mostPopularRgbColour,
                  int secondMostPopularRgb)
Description copied from interface: ColourChoiceStrategy
Method to return the RGB int colour (Spectrum colour) that should be used for a given pixel based on the Spectrum colours passed in as mostPopularColour and secondMostPopularColour. ExistingColour is either the original pixel colour or part converted colour (e.g. a pixel that has already undergone colour processing).

Specified by:
colour in interface ColourChoiceStrategy
Returns: