/*
 * Created on 2005-04-05
 *
 * Part of the Symbian development plug-in for Eclipse
 * Copyright (C) Mikołaj Zalewski, 2005
 */
package pl.zalewski.mikolaj.symbdev.core.mmpmodel;

/**
 * @author mikolaj
 */
public class MMPBitmapReference implements Cloneable {

    public static final String DEPTH_1="1";
    public static final String DEPTH_2="2";
    public static final String DEPTH_4="4";
    public static final String DEPTH_8="8";
    public static final String DEPTH_C4="c4";
    public static final String DEPTH_C8="c8";
    public static final String DEPTH_C12="c12";
    public static final String DEPTH_C16="c16";
    public static final String DEPTH_C24="c24";
    
    public MMPBitmapReference(MMPFileReference path, String depth) {
        fPath=path;
        fDepth=depth;
    }
    
    static public String getDepthName(String id)
    {
        String idi=id.toLowerCase().intern();
        if (idi==DEPTH_1)
            return "Black and white (1)";
        if (idi==DEPTH_2)
            return "4-tone grayscale (2)";
        if (idi==DEPTH_4)
            return "16-tone grayscale (4)";
        if (idi==DEPTH_8)
            return "256-tone grayscale (8)";
        if (idi==DEPTH_C4)
            return "16 colors (c4)";
        if (idi==DEPTH_C8)
            return "256 colors (c8)";
        if (idi==DEPTH_C12)
            return "4096 colors (c12)";
        if (idi==DEPTH_C16)
            return "65K colors (c16)";
        if (idi==DEPTH_C24)
            return "16M colors (c24)";
        return "Unknown ("+id+")";
    }
    
    public String getDepthName()
    {
        return getDepthName(fDepth);
    }
    
    public Object clone() {
        try {
            MMPBitmapReference ret=(MMPBitmapReference)super.clone();
        	ret.fPath=(MMPFileReference)fPath.clone();
        	return ret;
        }
        catch (CloneNotSupportedException e)
        {
            // should not happend
            throw new IllegalStateException();
        }
    }
    public MMPFileReference fPath;
    public String fDepth;
}
