/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 2005 Bull S.A.
 * Contact: jonas-team@objectweb.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */
package mfb.converters;

import javax.emb.MediaConverter;
import javax.emb.MediaException;

import org.objectweb.jonas.emb.mfb.converter.image.ImageConverter;
import org.objectweb.jonas.emb.mfb.converter.image.ImageFormatConverterSpec;
import org.objectweb.jonas.emb.mfb.formats.image.BmpFormat;

/**
 * Converter avaiable to pass the TCK : convert a JPEG to BMP
 * <p>
 * TODO : check the source format to be compliant with TCK (but not spec)
 *
 * @author Brice Ruzand
 */
public class JpegToBmpConverterSpec extends ImageFormatConverterSpec {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -3894499792502442548L;

    /**
     * Default constructor
     */
    public JpegToBmpConverterSpec() {
        super(new BmpFormat());
    }

    /**
     * Constructor with specified color Depth
     * <p>
     * Only for TCK not realy used
     *
     * @param colorDepth number of bytes used to encode color (not used)
     */
    public JpegToBmpConverterSpec(byte colorDepth) {
        // for compatiblity only
        super(new BmpFormat());
    }

    /**
     * @see org.objectweb.jonas.emb.mfb.converter.image.ImageAbstractConverterSpec#getConverter()
     * @inheritDoc
     */
    public MediaConverter getConverter() throws MediaException {
        return new ImageConverter(this, new String[] {"jpeg", "jpg"});
    }

}
