
package org.apache.sanselan.formats.psd.dataparsers;

import org.apache.sanselan.formats.psd.ImageContents;

public class DataParserGrayscale extends DataParser
{
    protected int getRGB(int data[][][], int x, int y,
            ImageContents imageContents)
    {
        int sample = 0xff & data[0][y][x];
        int alpha = 0xff;

        int rgb = ((0xff & alpha) << 24) | ((0xff & sample) << 16)
                | ((0xff & sample) << 8) | ((0xff & sample) << 0);

        return rgb;
    }

    public int getBasicChannelsCount()
    {
        return 1;
    }

}