file_bitmap.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * file_bitmap.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: 1b21b77bccd39bfd0ac842129b902a2c882f8094 $
00006  *
00007  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
00008  *          Olivier Teulière <ipkiss@via.ecp.fr>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License along
00021  * with this program; if not, write to the Free Software Foundation, Inc.,
00022  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef FILE_BITMAP_HPP
00026 #define FILE_BITMAP_HPP
00027 
00028 #include "generic_bitmap.hpp"
00029 #include <string>
00030 
00031 
00032 /// Class for file bitmaps
00033 class FileBitmap: public GenericBitmap
00034 {
00035 public:
00036     /// Load a bitmap from a file. aColor is the transparency
00037     /// color, in the format 0xRRGGBB
00038     FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
00039                 string fileName, uint32_t aColor, int nbFrames = 1,
00040                 int fps = 0, int nbLoops = 0 );
00041 
00042     virtual ~FileBitmap();
00043 
00044     /// Get the width of the bitmap
00045     virtual int getWidth() const { return m_width; }
00046 
00047     /// Get the heighth of the bitmap
00048     virtual int getHeight() const { return m_height; }
00049 
00050     /// Get a linear buffer containing the image data.
00051     /// Each pixel is stored in 4 bytes in the order B,G,R,A
00052     virtual uint8_t *getData() const;
00053 
00054 private:
00055     /// Size of the bitmap.
00056     int m_width, m_height;
00057     /// Buffer containing the image data.
00058     uint8_t *m_pData;
00059 };
00060 
00061 
00062 #endif

Generated on Tue May 25 08:04:58 2010 for VLC by  doxygen 1.5.6