TonicTones
Src/Api/ImageLoader.h
00001 //      ImageLoader.h
00002 //      
00003 //      Copyright 2010 Jérémy Laumon <jeremy.laumon@gmail.com>
00004 //      
00005 //      This program is free software; you can redistribute it and/or modify
00006 //      it under the terms of the GNU General Public License as published by
00007 //      the Free Software Foundation; either version 2 of the License, or
00008 //      (at your option) any later version.
00009 //      
00010 //      This program is distributed in the hope that it will be useful,
00011 //      but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 //      GNU General Public License for more details.
00014 //      
00015 //      You should have received a copy of the GNU General Public License
00016 //      along with this program; if not, write to the Free Software
00017 //      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00018 //      MA 02110-1301, USA.
00019 
00020 #ifndef IMAGELOADER_H
00021 #define IMAGELOADER_H
00022 
00023 #include <Color.h>
00024 #include <HdrImage.h>
00025 
00031 class ImageLoader
00032 {
00033 public:
00034     virtual ~ImageLoader(){}
00035     
00039     virtual void setFileName(const QString& fileName) = 0;
00040     
00044     virtual bool openFile() = 0;
00045     
00049     virtual QSize getSize() = 0;
00050     
00054     virtual Color* getData() = 0;
00055     
00059     virtual HdrImage::ColorSpace getColorSpace() = 0;
00060     
00064     virtual QString name() const = 0;
00065 };
00066 
00067 typedef QSharedPointer<ImageLoader> ImageLoaderPtr;
00068 
00069 
00070 //----------------------------------------------------------------------
00071 
00078 class ImageLoaderFactory
00079 {
00080 public:
00081     virtual ~ImageLoaderFactory(){}
00082     
00086     virtual QStringList extensions() const = 0;
00087     
00091     virtual ImageLoaderPtr createLoader(const QString &fileName) const = 0;
00092 };
00093 
00094 Q_DECLARE_INTERFACE(ImageLoaderFactory, "TonicTones.ImageLoaderFactory/1.1")
00095 
00096 
00097 #endif
 All Classes Functions Variables