fixed: gcc8 compile issues
[opensg.git] / Source / System / Image / OSGImageFunctions.h
blob723f9b2bb93c725b394f9b517e1674968e1f4606
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
8 * *
9 \*---------------------------------------------------------------------------*/
10 /*---------------------------------------------------------------------------*\
11 * License *
12 * *
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. *
16 * *
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. *
21 * *
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. *
25 * *
26 \*---------------------------------------------------------------------------*/
27 /*---------------------------------------------------------------------------*\
28 * Changes *
29 * *
30 * *
31 * *
32 * *
33 * *
34 * *
35 \*---------------------------------------------------------------------------*/
37 #ifndef _OSGIMAGEFUNCTIONS_H_
38 #define _OSGIMAGEFUNCTIONS_H_
39 #ifdef __sgi
40 #pragma once
41 #endif
43 #include "OSGSystemDef.h"
44 #include "OSGBaseTypes.h"
45 #include "OSGVector.h"
46 #include "OSGColor.h"
47 #include "OSGImage.h"
48 #include "OSGPerlinNoise.h"
50 #include <vector>
51 #include <string>
52 #include <iostream>
55 OSG_BEGIN_NAMESPACE
57 /*! \ingroup GrpSystemImageFuncs
60 enum SliceDataType
62 INVALID_SDT = 0,
63 DEPTH_SDT,
64 FRAME_SDT,
65 SIDE_SDT
68 /*! \ingroup GrpSystemImageFuncs
71 template<class SrcImageStore>
72 bool createComposedImage (const SrcImageStore &srcImageVec,
73 Image *dstImage,
74 SliceDataType sliceDataType = DEPTH_SDT,
75 bool flipY = false );
77 /*! \ingroup GrpSystemImageFuncs
80 OSG_SYSTEM_DLLMAPPING
81 bool createNormalMapFromBump ( Image *srcImage,
82 Image *dstImage,
83 Vec3f normalMapScale);
85 /*! \ingroup GrpSystemImageFuncs
88 OSG_SYSTEM_DLLMAPPING
89 bool createNormalVolume ( Image *srcImage,
90 Image *dstImage,
91 const std::string &outputFormat );
93 /*! \ingroup GrpSystemImageFuncs
96 OSG_SYSTEM_DLLMAPPING
97 bool create2DPreIntegrationLUT ( Image *dstImage,
98 Image *srcImage,
99 Real32 thickness = 1.0 );
100 /*! \ingroup GrpSystemImageFuncs
103 OSG_SYSTEM_DLLMAPPING
104 bool splitRGBA ( Image *rgba,
105 Image *rgb,
106 Image *alpha);
108 /*! \ingroup GrpSystemImageFuncs
111 OSG_SYSTEM_DLLMAPPING
112 bool mergeRGBA ( Image *rgb,
113 Image *alpha,
114 Image *rgba);
116 /*! \ingroup GrpSystemImageFuncs
119 OSG_SYSTEM_DLLMAPPING
120 bool blendImage ( Image *canvas,
121 Image *brush,
122 Vec3f position,
123 Color4f color,
124 Real32 alphaScale = 1,
125 Real32 paintZ = 0 );
127 /*! \ingroup GrpSystemImageFuncs
130 OSG_SYSTEM_DLLMAPPING
131 bool createPhongTexture (Image *image,
132 UInt32 size = 512,
133 Real32 specular_exponent = 10,
134 Real32 ka = 0,
135 Real32 kd = 0,
136 Real32 ks = 1);
138 /*! \ingroup GrpSystemImageFuncs
141 OSG_SYSTEM_DLLMAPPING
142 bool createPhongVolume ( Image *image,
143 Color3f diffuseColor,
144 Color3f specularColor,
145 UInt32 lutSize,
146 UInt32 lutScalar,
147 Real32 lutIncr );
149 /*! \ingroup GrpSystemImageFuncs
152 OSG_SYSTEM_DLLMAPPING
153 bool createNormalizationCubeMap ( std::vector<Image *> imageVec,
154 UInt32 size );
156 /*! \ingroup GrpSystemImageFuncs
159 OSG_SYSTEM_DLLMAPPING
160 bool createNoise ( Image *image,
161 Image::PixelFormat pixelformat = Image::OSG_RGBA_PF,
162 UInt16 numOctaves = 6,
163 UInt16 size = 128,
164 UInt8 dim = 2,
165 bool splitOctaves = false);
167 /*! \ingroup GrpSystemImageFuncs
170 OSG_SYSTEM_DLLMAPPING
171 bool createGamma(Image *image,
172 UInt32 size,
173 Real32 gamma);
175 /*! \ingroup GrpSystemImageFuncs
178 OSG_SYSTEM_DLLMAPPING
179 bool createVignette(Image *image,
180 UInt32 width,
181 UInt32 height,
182 Real32 r0,
183 Real32 r1);
185 /*! \ingroup GrpSystemImageFuncs
188 OSG_SYSTEM_DLLMAPPING
189 bool convertCrossToCubeMap(Image const *pIn,
190 Image *pOut);
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(
227 const Vec2s &vSize,
228 const Vec2f &vRange,
229 Real32 fAmplitude,
230 Real32 fFrequency,
231 const Vec2f &vPhase,
232 Real32 fPersistance,
233 UInt32 uiOctaves,
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(
241 const Vec3s &vSize,
242 const Vec3f &vRange,
243 Real32 fAmplitude,
244 Real32 fFrequency,
245 const Vec3f &vPhase,
246 Real32 fPersistance,
247 UInt32 uiOctaves,
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);
253 OSG_END_NAMESPACE
255 #include "OSGImageFunctions.inl"
257 #endif /* _OSGIMAGEFUNCTIONS_H_ */