1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
7 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
9 \*---------------------------------------------------------------------------*/
10 /*---------------------------------------------------------------------------*\
13 * This library is free software; you can redistribute it and/or modify it *
14 * under the terms of the GNU Library General Public License as published *
15 * by the Free Software Foundation, version 2. *
17 * This library is distributed in the hope that it will be useful, but *
18 * WITHOUT ANY WARRANTY; without even the implied warranty of *
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
20 * Library General Public License for more details. *
22 * You should have received a copy of the GNU Library General Public *
23 * License along with this library; if not, write to the Free Software *
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
26 \*---------------------------------------------------------------------------*/
27 /*---------------------------------------------------------------------------*\
35 \*---------------------------------------------------------------------------*/
37 #ifndef _OSGIMAGEFUNCTIONS_H_
38 #define _OSGIMAGEFUNCTIONS_H_
43 #include "OSGSystemDef.h"
44 #include "OSGBaseTypes.h"
45 #include "OSGVector.h"
48 #include "OSGPerlinNoise.h"
57 /*! \ingroup GrpSystemImageFuncs
68 /*! \ingroup GrpSystemImageFuncs
71 template<class SrcImageStore
>
72 bool createComposedImage (const SrcImageStore
&srcImageVec
,
74 SliceDataType sliceDataType
= DEPTH_SDT
,
77 /*! \ingroup GrpSystemImageFuncs
81 bool createNormalMapFromBump ( Image
*srcImage
,
83 Vec3f normalMapScale
);
85 /*! \ingroup GrpSystemImageFuncs
89 bool createNormalVolume ( Image
*srcImage
,
91 const std::string
&outputFormat
);
93 /*! \ingroup GrpSystemImageFuncs
97 bool create2DPreIntegrationLUT ( Image
*dstImage
,
99 Real32 thickness
= 1.0 );
100 /*! \ingroup GrpSystemImageFuncs
103 OSG_SYSTEM_DLLMAPPING
104 bool splitRGBA ( Image
*rgba
,
108 /*! \ingroup GrpSystemImageFuncs
111 OSG_SYSTEM_DLLMAPPING
112 bool mergeRGBA ( Image
*rgb
,
116 /*! \ingroup GrpSystemImageFuncs
119 OSG_SYSTEM_DLLMAPPING
120 bool blendImage ( Image
*canvas
,
124 Real32 alphaScale
= 1,
127 /*! \ingroup GrpSystemImageFuncs
130 OSG_SYSTEM_DLLMAPPING
131 bool createPhongTexture (Image
*image
,
133 Real32 specular_exponent
= 10,
138 /*! \ingroup GrpSystemImageFuncs
141 OSG_SYSTEM_DLLMAPPING
142 bool createPhongVolume ( Image
*image
,
143 Color3f diffuseColor
,
144 Color3f specularColor
,
149 /*! \ingroup GrpSystemImageFuncs
152 OSG_SYSTEM_DLLMAPPING
153 bool createNormalizationCubeMap ( std::vector
<Image
*> imageVec
,
156 /*! \ingroup GrpSystemImageFuncs
159 OSG_SYSTEM_DLLMAPPING
160 bool createNoise ( Image
*image
,
161 Image::PixelFormat pixelformat
= Image::OSG_RGBA_PF
,
162 UInt16 numOctaves
= 6,
165 bool splitOctaves
= false);
167 /*! \ingroup GrpSystemImageFuncs
170 OSG_SYSTEM_DLLMAPPING
171 bool createGamma(Image
*image
,
175 /*! \ingroup GrpSystemImageFuncs
178 OSG_SYSTEM_DLLMAPPING
179 bool createVignette(Image
*image
,
185 /*! \ingroup GrpSystemImageFuncs
188 OSG_SYSTEM_DLLMAPPING
189 bool convertCrossToCubeMap(Image
const *pIn
,
192 /*! \ingroup GrpSystemImageFuncs
195 template<class ValueT
> inline
196 void swapImageByteOrder(Image
* const pImage
);
198 /*! \ingroup GrpSystemImageFuncs
201 template<class ValueT
, ValueT (*ConvF
)(ValueT
)> inline
202 void swapAndConvertImageByteOrder(Image
* const pImage
);
204 /*! \ingroup GrpSystemImageFuncs
207 template<class ValueT
, ValueT MinVal
> inline
208 ValueT
clampMin(ValueT val
);
210 /*! \ingroup GrpSystemImageFuncs
213 template<class ValueT
, ValueT CompVal
, ValueT ReplaceVal
> inline
214 ValueT
clampMin(ValueT val
);
216 /*! \ingroup GrpSystemImageFuncs
219 template<class ValueT
> inline
220 ValueT
doNothing(ValueT val
);
222 /*---------------------------------------------------------------------*/
223 /* Image functions, from OpenSGToolbox, Author: David Kabala */
225 OSG_SYSTEM_DLLMAPPING
226 ImageTransitPtr
createPerlinImage(
234 UInt32 uiInterpolMode
= Perlin::InterpolateCosine
,
235 bool bSmoothing
= true,
236 Image::PixelFormat pixelformat
= Image::OSG_I_PF
,
237 Image::Type type
= Image::OSG_FLOAT32_IMAGEDATA
);
239 OSG_SYSTEM_DLLMAPPING
240 ImageTransitPtr
createPerlinImage(
248 UInt32 uiInterpolMode
= Perlin::InterpolateCosine
,
249 bool bSmoothing
= true,
250 Image::PixelFormat pixelformat
= Image::OSG_I_PF
,
251 Image::Type type
= Image::OSG_FLOAT32_IMAGEDATA
);
255 #include "OSGImageFunctions.inl"
257 #endif /* _OSGIMAGEFUNCTIONS_H_ */