001package icy.image.colormap;
002
003public class GlowColorMap extends IcyColorMap
004{
005    public GlowColorMap(boolean overUnderMark)
006    {
007        super(overUnderMark ? "Glow Under Over" : "Glow");
008
009        beginUpdate();
010        try
011        {
012            if (overUnderMark)
013            {
014                red.setControlPoint(0, 0);
015                red.setControlPoint(64, 255);
016                red.setControlPoint(192, 255);
017                red.setControlPoint(254, 255);
018                red.setControlPoint(255, 0);
019            }
020            else
021            {
022                red.setControlPoint(0, 0);
023                red.setControlPoint(64, 255);
024                red.setControlPoint(192, 255);
025                red.setControlPoint(255, 255);
026            }
027
028            if (overUnderMark)
029            {
030                green.setControlPoint(0, 255);
031                green.setControlPoint(1, 0);
032                green.setControlPoint(64, 0);
033                green.setControlPoint(192, 255);
034                green.setControlPoint(254, 255);
035                green.setControlPoint(255, 0);
036            }
037            else
038            {
039                green.setControlPoint(0, 0);
040                green.setControlPoint(64, 0);
041                green.setControlPoint(192, 255);
042                green.setControlPoint(255, 255);
043            }
044
045            blue.setControlPoint(0, 0);
046            blue.setControlPoint(192, 0);
047            blue.setControlPoint(255, 255);
048        }
049        finally
050        {
051            endUpdate();
052        }
053    }
054}