PixelLightAPI  .
ImageLoaderJPG.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: ImageLoaderJPG.h                               *
00003  *
00004  *  Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLGRAPHICS_IMAGELOADER_JPG_H__
00024 #define __PLGRAPHICS_IMAGELOADER_JPG_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLGraphics/Image/ImageLoader.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLGraphics {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Forward declarations                                  ]
00042 //[-------------------------------------------------------]
00043 class Image;
00044 
00045 
00046 //[-------------------------------------------------------]
00047 //[ Classes                                               ]
00048 //[-------------------------------------------------------]
00049 /**
00050 *  @brief
00051 *    Image loader implementation for JPEG ("Joint Photographic Experts Group") file formats
00052 *
00053 *  @note
00054 *    - Using libjpeg (http://www.ijg.org/)
00055 */
00056 class ImageLoaderJPG : public ImageLoader {
00057 
00058 
00059     //[-------------------------------------------------------]
00060     //[ RTTI interface                                        ]
00061     //[-------------------------------------------------------]
00062     pl_class(PLGRAPHICS_RTTI_EXPORT, ImageLoaderJPG, "PLGraphics", PLGraphics::ImageLoader, "Image loader implementation for JPEG (\"Joint Photographic Experts Group\") file formats")
00063         // Properties
00064         pl_properties
00065             pl_property("Formats",  "jpg,jpeg,jpe,jif,jfif,jfi,JPG,JPEG,JPE,JIF,JFIF,JFI")
00066             pl_property("Load",     "1")
00067             pl_property("Save",     "1")
00068         pl_properties_end
00069         // Constructors
00070         pl_constructor_0(DefaultConstructor,    "Default constructor",  "")
00071         // Methods
00072         pl_method_2(Load,       pl_ret_type(bool),  Image&,         PLCore::File&,                  "Load method, no fancy upsampling and no interblock smoothing is applied",                                                                                                          "")
00073         pl_method_4(LoadParams, pl_ret_type(bool),  Image&,         PLCore::File&,  bool,   bool,   "Load method. Parameters: First 'bool' parameter determines whether or not fancy upsampling is applied, second 'bool' parameter whether or not interblock smoothing is applied.",   "")
00074         pl_method_2(Save,       pl_ret_type(bool),  const Image&,   PLCore::File&,                  "Save method, using 100% quality setting",                                                                                                                                          "")
00075         pl_method_3(SaveParams, pl_ret_type(bool),  const Image&,   PLCore::File&,  PLCore::uint32, "Save method, quality (0...100) as first parameter",                                                                                                                                "")
00076     pl_class_end
00077 
00078 
00079     //[-------------------------------------------------------]
00080     //[ Public RTTI methods                                   ]
00081     //[-------------------------------------------------------]
00082     public:
00083         PLGRAPHICS_API bool Load(Image &cImage, PLCore::File &cFile);
00084         PLGRAPHICS_API bool LoadParams(Image &cImage, PLCore::File &cFile, bool bBlockSmoothing, bool bFancyUpsampling);
00085         PLGRAPHICS_API bool Save(const Image &cImage, PLCore::File &cFile);
00086         PLGRAPHICS_API bool SaveParams(const Image &cImage, PLCore::File &cFile, PLCore::uint32 nQuality);
00087 
00088 
00089     //[-------------------------------------------------------]
00090     //[ Public functions                                      ]
00091     //[-------------------------------------------------------]
00092     public:
00093         /**
00094         *  @brief
00095         *    Default constructor
00096         */
00097         PLGRAPHICS_API ImageLoaderJPG();
00098 
00099         /**
00100         *  @brief
00101         *    Destructor
00102         */
00103         PLGRAPHICS_API virtual ~ImageLoaderJPG();
00104 
00105 
00106 };
00107 
00108 
00109 //[-------------------------------------------------------]
00110 //[ Namespace                                             ]
00111 //[-------------------------------------------------------]
00112 } // PLGraphics
00113 
00114 
00115 #endif // __PLGRAPHICS_IMAGELOADER_JPG_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:50:56
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported