00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002 by the OpenSG Forum * 00006 * * 00007 * www.opensg.org * 00008 * * 00009 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00010 * * 00011 \*---------------------------------------------------------------------------*/ 00012 /*---------------------------------------------------------------------------*\ 00013 * License * 00014 * * 00015 * This library is free software; you can redistribute it and/or modify it * 00016 * under the terms of the GNU Library General Public License as published * 00017 * by the Free Software Foundation, version 2. * 00018 * * 00019 * This library is distributed in the hope that it will be useful, but * 00020 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00022 * Library General Public License for more details. * 00023 * * 00024 * You should have received a copy of the GNU Library General Public * 00025 * License along with this library; if not, write to the Free Software * 00026 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00027 * * 00028 \*---------------------------------------------------------------------------*/ 00029 /*---------------------------------------------------------------------------*\ 00030 * Changes * 00031 * * 00032 * * 00033 * * 00034 * * 00035 * * 00036 * * 00037 \*---------------------------------------------------------------------------*/ 00038 00039 #ifndef _OSGDISPLAYCALIBRATION_H_ 00040 #define _OSGDISPLAYCALIBRATION_H_ 00041 #ifdef __sgi 00042 #pragma once 00043 #endif 00044 00045 #include <OSGConfig.h> 00046 00047 #include <OSGViewport.h> 00048 #include <OSGImage.h> 00049 #include <OSGTextureChunk.h> 00050 #include <OSGComponentTransform.h> 00051 #include <OSGMatrixCamera.h> 00052 #include <OSGTextureGrabBackground.h> 00053 #include <OSGTextureGrabForeground.h> 00054 #include <OSGSolidBackground.h> 00055 #include <OSGGeometry.h> 00056 #include <OSGDisplayCalibrationBase.h> 00057 #include <OSGWindow.h> 00058 #include <OSGChunkMaterial.h> 00059 #include <OSGFragmentProgramChunk.h> 00060 #include <OSGRegisterCombinersChunk.h> 00061 #include <OSGRenderAction.h> 00062 00063 OSG_BEGIN_NAMESPACE 00064 00069 class OSG_SYSTEMLIB_DLLMAPPING DisplayCalibration : public DisplayCalibrationBase 00070 { 00071 private: 00072 00073 typedef DisplayCalibrationBase Inherited; 00074 00075 /*========================== PUBLIC =================================*/ 00076 public: 00077 00078 /*---------------------------------------------------------------------*/ 00082 virtual void calibrate(WindowPtr window,RenderActionBase *ract); 00083 00085 /*---------------------------------------------------------------------*/ 00089 virtual void changed(BitVector whichField, 00090 UInt32 origin ); 00091 00093 /*---------------------------------------------------------------------*/ 00097 virtual void dump( UInt32 uiIndent = 0, 00098 const BitVector bvFlags = 0) const; 00099 00101 /*========================= PROTECTED ===============================*/ 00102 protected: 00103 00104 // Variables should all be in DisplayCalibrationBase. 00105 00106 /*---------------------------------------------------------------------*/ 00110 DisplayCalibration(void); 00111 DisplayCalibration(const DisplayCalibration &source); 00112 00114 /*---------------------------------------------------------------------*/ 00118 virtual ~DisplayCalibration(void); 00119 00121 /*---------------------------------------------------------------------*/ 00125 void createCMViewports(WindowPtr window); 00126 void updateMatrix(); 00127 void updateGamma(); 00128 void updateGrid(WindowPtr window); 00129 void createPincushionGrid(); 00130 00133 bool _useFragmentProgram; 00134 bool _changed; 00135 GeometryPtr _scalegeo; 00136 GeoPositions3fPtr _positions; 00137 GeoTexCoords2fPtr _texcoords; 00138 GeoPositions3fPtr _positionsScale; 00139 GeoTexCoords2fPtr _texcoordsScale; 00140 ImagePtr _rgammaimg; 00141 TextureChunkPtr _rgammachunk; 00142 ImagePtr _ggammaimg; 00143 TextureChunkPtr _ggammachunk; 00144 ImagePtr _bgammaimg; 00145 TextureChunkPtr _bgammachunk; 00146 ImagePtr _argammaimg; 00147 TextureChunkPtr _argammachunk; 00148 ImagePtr _gbgammaimg; 00149 TextureChunkPtr _gbgammachunk; 00150 FragmentProgramChunkPtr _fragProgram; 00151 RegisterCombinersChunkPtr _regCombiner; 00152 00153 ViewportPtr _cmPort; 00154 ViewportPtr _dsPort; 00155 ViewportPtr _dsPort2; 00156 NodePtr _cmRoot; 00157 NodePtr _dsRoot; 00158 NodePtr _ds2Root; 00159 MatrixCameraPtr _cam; 00160 TextureGrabBackgroundPtr _cmBack; 00161 TextureGrabBackgroundPtr _dsBack; 00162 SolidBackgroundPtr _ds2Back; 00163 00164 UInt32 _winWidth; 00165 UInt32 _winHeight; 00166 00167 /*========================== PRIVATE ================================*/ 00168 private: 00169 00170 friend class FieldContainer; 00171 friend class DisplayCalibrationBase; 00172 00173 static void initMethod(void); 00174 00175 // prohibit default functions (move to 'public' if you need one) 00176 00177 void operator =(const DisplayCalibration &source); 00178 }; 00179 00180 typedef DisplayCalibration *DisplayCalibrationP; 00181 00182 OSG_END_NAMESPACE 00183 00184 #include <OSGDisplayCalibrationBase.inl> 00185 #include <OSGDisplayCalibration.inl> 00186 00187 #define OSGDISPLAYCALIBRATION_HEADER_CVSID "@(#)$Id: FCTemplate_h.h,v 1.21 2003/07/11 18:39:08 dirk Exp $" 00188 00189 #endif /* _OSGDISPLAYCALIBRATION_H_ */
1.4.3