00001 //=========================================================================== 00002 /* 00003 This file is part of the CHAI 3D visualization and haptics libraries. 00004 Copyright (C) 2003-2009 by CHAI 3D. All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License("GPL") version 2 00008 as published by the Free Software Foundation. 00009 00010 For using the CHAI 3D libraries with software that can not be combined 00011 with the GNU GPL, and for taking advantage of the additional benefits 00012 of our support services, please contact CHAI 3D about acquiring a 00013 Professional Edition License. 00014 00015 \author <http://www.chai3d.org> 00016 \author Francois Conti 00017 \version 2.0.0 $Rev: 251 $ 00018 */ 00019 //=========================================================================== 00020 00021 //--------------------------------------------------------------------------- 00022 #ifndef CBitmapH 00023 #define CBitmapH 00024 //--------------------------------------------------------------------------- 00025 #include "scenegraph/CGenericObject.h" 00026 #include "files/CImageLoader.h" 00027 //--------------------------------------------------------------------------- 00028 00029 //=========================================================================== 00037 //=========================================================================== 00038 00039 //=========================================================================== 00047 //=========================================================================== 00048 class cBitmap : public cGenericObject 00049 { 00050 public: 00051 00052 //----------------------------------------------------------------------- 00053 // CONSTRUCTOR & DESTRUCTOR: 00054 //----------------------------------------------------------------------- 00055 00057 cBitmap(); 00058 00060 virtual ~cBitmap(); 00061 00062 00063 //----------------------------------------------------------------------- 00064 // METHODS: 00065 //----------------------------------------------------------------------- 00066 00068 inline unsigned char* getData() { return m_image.getData(); } 00069 00071 inline unsigned int getBitmapWidth() { return m_image.getWidth(); } 00072 00074 inline unsigned int getBitmapHeight() { return m_image.getHeight(); } 00075 00077 inline unsigned int getBitmapFormat() { return m_image.getFormat(); } 00078 00080 void setZoomHV(float a_zoomHorizontal, float a_zoomVertical); 00081 00083 float getZoomH() { return (m_zoomH); } 00084 00086 float getZoomV() { return (m_zoomV); } 00087 00089 void enableTransparency(bool a_enableTransparency) { m_useTransparency = a_enableTransparency; } 00090 00092 cImageLoader m_image; 00093 00094 00095 private: 00096 00097 //----------------------------------------------------------------------- 00098 // MEMBERS: 00099 //----------------------------------------------------------------------- 00100 00102 float m_zoomH, m_zoomV; 00103 00105 bool m_useTransparency; 00106 00108 virtual void render(const int a_renderMode = CHAI_RENDER_MODE_RENDER_ALL); 00109 }; 00110 00111 //--------------------------------------------------------------------------- 00112 #endif 00113 //---------------------------------------------------------------------------