MyGUI  3.2.1
MyGUI_TextureUtility.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_TEXTURE_UTILITY_H__
00008 #define __MYGUI_TEXTURE_UTILITY_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Colour.h"
00012 #include "MyGUI_RenderFormat.h"
00013 
00014 namespace MyGUI
00015 {
00016 
00017     namespace texture_utility
00018     {
00019 
00020         MYGUI_EXPORT const IntSize& getTextureSize(const std::string& _texture, bool _cache = true);
00021         MYGUI_EXPORT uint32 toColourARGB(const Colour& _colour);
00022 
00023         MYGUI_FORCEINLINE void convertColour(uint32& _colour, VertexColourType _format)
00024         {
00025             if (_format == VertexColourType::ColourABGR)
00026                 _colour = ((_colour & 0x00FF0000) >> 16) | ((_colour & 0x000000FF) << 16) | (_colour & 0xFF00FF00);
00027         }
00028 
00029 
00030     } // namespace texture_utility
00031 
00032 } // namespace MyGUI
00033 
00034 #endif // __MYGUI_TEXTURE_UTILITY_H__