001/*
002 * Copyright 2010-2015 Institut Pasteur.
003 * 
004 * This file is part of Icy.
005 * 
006 * Icy is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 * 
011 * Icy is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014 * GNU General Public License for more details.
015 * 
016 * You should have received a copy of the GNU General Public License
017 * along with Icy. If not, see <http://www.gnu.org/licenses/>.
018 */
019package icy.painter;
020
021import icy.canvas.IcyCanvas;
022import icy.sequence.Sequence;
023
024import java.awt.Graphics2D;
025import java.awt.Image;
026
027/**
028 * Simple image overlay class.
029 */
030public class ImageOverlay extends Overlay
031{
032    public Image image;
033
034    public ImageOverlay(String name, Image image)
035    {
036        super(name, OverlayPriority.IMAGE_NORMAL);
037
038        this.image = image;
039    }
040
041    @Override
042    public void paint(Graphics2D g, Sequence sequence, IcyCanvas canvas)
043    {
044        if (g != null)
045            g.drawImage(image, 0, 0, null);
046    }
047}