package pl.wroc.pwr.image.converter; import pl.wroc.pwr.IOperator; import pl.wroc.pwr.image.IGSImage; import pl.wroc.pwr.image.IHSVImage; import pl.wroc.pwr.image.model.GSImage; import pl.wroc.pwr.imagechannel.basic.CopyChannel; public class HSVtoGSConverter implements IOperator< IGSImage > { private IHSVImage inputImage; public HSVtoGSConverter( IHSVImage image ) { this.inputImage = image; } public void setImage( IHSVImage image ) { this.inputImage = image; } public IGSImage apply( ) { IGSImage outputImage = new GSImage( this.inputImage.getSize( ) ); if ( new CopyChannel( outputImage.getGrayChannel( ), this.inputImage.getBrightnessChannel( ) ).apply( ) == null ) { return null; } return outputImage; } }