provider_factory.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2011 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 **    Mark Page
00028 **    (if your name is missing here, please add it)
00029 */
00030 
00033 
00034 #pragma once
00035 
00036 #include "../api_display.h"
00037 #include <map>
00038 #include "../../Core/Text/string_types.h"
00039 #include "../../Core/IOData/virtual_directory.h"
00040 
00041 class CL_PixelBuffer;
00042 class CL_ImageProviderType;
00043 
00047 class CL_API_DISPLAY CL_ImageProviderFactory
00048 {
00051 
00052 public:
00054         static std::map<CL_String, CL_ImageProviderType *> types;
00055 
00059 
00060 public:
00067         static CL_PixelBuffer try_load(
00068                 const CL_String &filename,
00069                 const CL_String &type = CL_String(),
00070                 CL_VirtualDirectory directory = CL_VirtualDirectory(),
00071                 CL_String *out_failure_reason = 0);
00072 
00075 
00078         static CL_PixelBuffer load(
00079                 const CL_String &filename,
00080                 const CL_VirtualDirectory &directory,
00081                 const CL_String &type = CL_String());
00082 
00083         static CL_PixelBuffer load(
00084                 const CL_String &fullname,
00085                 const CL_String &type = CL_String());
00086 
00087         static CL_PixelBuffer load(
00088                 CL_IODevice &file,
00089                 const CL_String &type);
00090 
00092 
00094         static void save(
00095                 CL_PixelBuffer buffer,
00096                 const CL_String &filename,
00097                 CL_VirtualDirectory &directory,
00098                 const CL_String &type = CL_String());
00099 
00100         static void save(
00101                 CL_PixelBuffer buffer,
00102                 const CL_String &fullname,
00103                 const CL_String &type = CL_String());
00104 
00105         static void save(
00106                 CL_PixelBuffer buffer,
00107                 CL_IODevice &file,
00108                 const CL_String &type);
00110 };
00111