00001 /***************************************************************************** 00002 * scaled_bitmap.hpp 00003 ***************************************************************************** 00004 * Copyright (C) 2003 the VideoLAN team 00005 * $Id: 819fb9be7acf842ba371e14022b207aee6824455 $ 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 SCALED_BITMAP_HPP 00026 #define SCALED_BITMAP_HPP 00027 00028 #include "generic_bitmap.hpp" 00029 00030 00031 /// Class for scaling bitmaps 00032 class ScaledBitmap: public GenericBitmap 00033 { 00034 public: 00035 /// Create a scaled bitmap from the given bitmap and size 00036 ScaledBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap, 00037 int width, int height ); 00038 00039 virtual ~ScaledBitmap(); 00040 00041 /// Get the width of the bitmap 00042 virtual int getWidth() const { return m_width; } 00043 00044 /// Get the heighth of the bitmap 00045 virtual int getHeight() const { return m_height; } 00046 00047 /// Get a linear buffer containing the image data. 00048 /// Each pixel is stored in 4 bytes in the order B,G,R,A 00049 virtual uint8_t *getData() const { return m_pData; } 00050 00051 private: 00052 /// Bitmap size 00053 int m_width, m_height; 00054 /// Image data buffer 00055 uint8_t *m_pData; 00056 }; 00057 00058 00059 #endif
1.5.6