001    /*
002     * LineSpotFunction
003     * 
004     * Copyright (c) 2002, 2003 Marco Schmidt.
005     * All rights reserved.
006     */
007    
008    package net.sourceforge.jiu.color.dithering;
009    
010    import net.sourceforge.jiu.color.dithering.SpotFunction;
011    
012    /**
013     * A line spot function.
014     * @author Marco Schmidt
015     * @since 0.9.0
016     * @see ClusteredDotDither
017     */
018    public class LineSpotFunction implements SpotFunction
019    {
020            public double compute(double x, double y)
021            {
022                    if (y < 0)
023                    {
024                            return -y;
025                    }
026                    else
027                    {
028                            return y;
029                    }
030            }
031    
032            public boolean isBalanced()
033            {
034                    return true;
035            }
036    }