Changeset 13041 for OpenSceneGraph/trunk/include/osg/ImageUtils
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/ImageUtils (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/ImageUtils
r12894 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 21 21 namespace osg { 22 22 23 template <typename T, class O> 23 template <typename T, class O> 24 24 void _readRow(unsigned int num, GLenum pixelFormat, const T* data,float scale, O& operation) 25 25 { … … 36 36 } 37 37 38 template <class O> 38 template <class O> 39 39 void readRow(unsigned int num, GLenum pixelFormat, GLenum dataType, const unsigned char* data, O& operation) 40 40 { … … 51 51 } 52 52 53 template <class O> 53 template <class O> 54 54 void readImage(const osg::Image* image, O& operation) 55 55 { 56 56 if (!image) return; 57 57 58 58 for(int r=0;r<image->r();++r) 59 59 { … … 68 68 // struct ModifyOperator 69 69 // { 70 // inline void luminance(float& l) const {} 71 // inline void alpha(float& a) const {} 72 // inline void luminance_alpha(float& l,float& a) const {} 70 // inline void luminance(float& l) const {} 71 // inline void alpha(float& a) const {} 72 // inline void luminance_alpha(float& l,float& a) const {} 73 73 // inline void rgb(float& r,float& g,float& b) const {} 74 74 // inline void rgba(float& r,float& g,float& b,float& a) const {} … … 76 76 77 77 78 template <typename T, class M> 78 template <typename T, class M> 79 79 void _modifyRow(unsigned int num, GLenum pixelFormat, T* data,float scale, const M& operation) 80 80 { … … 92 92 } 93 93 94 template <class M> 94 template <class M> 95 95 void modifyRow(unsigned int num, GLenum pixelFormat, GLenum dataType, unsigned char* data, const M& operation) 96 96 { … … 107 107 } 108 108 109 template <class M> 109 template <class M> 110 110 void modifyImage(osg::Image* image, const M& operation) 111 111 { 112 112 if (!image) return; 113 113 114 114 for(int r=0;r<image->r();++r) 115 115 {
