VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
convolve.h
Go to the documentation of this file.
1 
2 // Copyright JRM Enterprises, Inc. 2006
3 // All rights reserved.
4 //
5 // This code is the intellectual property of JRM Enterprises, Inc.
6 // It may not be used or released as source or compiled binary form
7 // without the prior written consent of JRM Enterprises, Inc.
8 //
9 // Original Authors: Ken George
11 
12 // used as pre-compiled header file
13 #include "seIncAll.h"
14 
15 
16 
17 #include <Cg/cg.h>
18 #include <Cg/cgGL.h>
19 #include "glh/glh_linear.h"
20 #include "glh/glh_array.h"
21 #include "NVIFilter.h"
22 
23 using namespace glh;
24 typedef vec<2, int> vec2i;
25 typedef glh::array2<float> Image2D;
26 
27 
28 
29 void initConvolve(CGcontext cgContext, bool use_half, int components, bool use_looping);
30 void destroyConvolve();
31 
32 float *evaluateFilter1D(NVIFilter2D &filter, int radius, int &nsamples, bool normalize);
33 Image2D *evaluateFilter2D(NVIFilter2D &filter, int radius_x, int radius_y, bool normalize);
34 Image2D *evaluateFilterAtlas2D(NVIFilter2D &filter, int nkernels, int max_radius, float min_r, float max_r);
35 
38 
39 CGprogram createPassThruProgram(CGcontext cgContext, bool use_tex2D, bool useFiltering, bool useLogScale,
40  bool noiseEnable, int useColorConversion, bool use888Encoding,
41  bool usePolaritySwitch, bool scanningSensorEnable, bool fullColorEnable, bool histogramEnable,
42  bool normalizeOutput, char *shaderFile);
43 void setFlagsPassThruProgram(CGprogram fprog, bool useFiltering, bool useLogScale,
44  bool noiseEnable, int useColorConversion, bool use888Encoding,
45  bool usePolaritySwitch, bool scanningSensorEnable, bool fullColorEnable, bool histogramEnable);
46 CGprogram createThresholdProgram(CGcontext cgContext, bool useTex2D, bool useFiltering, char *shaderFile);
47 CGprogram createHaloBlendProgram(CGcontext cgContext, bool useTex2D, bool useFiltering, char *shaderFile);
48 
49 CGprogram createDopplerProgram(CGcontext cgContext, bool useTex2D, bool useFiltering, char *shaderFile);
50 
51 CGprogram createMipConvolutionProgram(CGcontext cgContext, bool use_tex2D, int image_w, int image_h, bool useFiltering, char *shaderFile);
52 
53 CGprogram createConvolveProgram(CGcontext cgContext, int nsamples, vec4f *offsetsWeights, bool use_tex2D, bool useFiltering, char *shaderFile);
54 CGprogram createConvolutionProgramSeparable(CGcontext cgContext, float *weights, int nsamples, int radius, bool use_filtering, bool vertical, bool use_tex2D, int image_w, int image_h, char *shaderFile);
55 CGprogram createConvolutionProgram2D(CGcontext cgContext, NVIFilter2D &filter, int radius_x, int radius_y, bool useFiltering, bool use_tex2D, int image_w, int image_h, char *shaderFile);
56 
57 void setSeparableConvolutionParameters(CGprogram &prog, float *weights, int nsamples, int radius, bool useFiltering, bool vertical, bool use_tex2D, int image_w, int image_h);
58 void setConvolutionParameters2D(CGprogram &prog, NVIFilter2D &filter, int radius_x, int radius_y, bool useFiltering, bool use_tex2D, int image_w, int image_h);
59 void setConvolutionParametersKernels2D(CGprogram &prog, float *kernels, bool useFiltering, bool use_tex2D, int kernelWidth, int kernelHeight, int image_w, int image_h);
60 void setUpSampleConvolutionParameters(CGprogram &prog, bool useTex2D, int imageW, int imageH);
61 void setHaloConvolveTexSeparableParameters(CGprogram &prog, bool use_tex2D, int img_width, int img_height, int kernelTexSizeX, int kernelTexSizeY, int *kernelSizes);
62 
63 CGprogram createConvolveProgramTex(CGcontext cgContext, int kernel_width, int kernel_height, int xoffset, int yoffset, bool use_tex2D, int img_width, int img_height, char *shaderFile);
64 CGprogram createConvolveProgramTexSeparable(CGcontext cgContext, int kernel_width, int offset, bool use_tex2D, bool vertical, int img_width, int img_height, char *shaderFile);
65 CGprogram createConvolveProgramMultiTex(CGcontext cgContext, bool use_tex2D, int img_width, int img_height, int kernelTexSize, char *shaderFile);
66 CGprogram createConvolveProgramMultiTexSeparable(CGcontext cgContext, bool use_tex2D, int img_width, int img_height, int kernelTexSize, char *shaderFile);
67 CGprogram createConvolveProgramMulti2DTex(CGcontext cgContext, bool use_tex2D, int img_width, int img_height, int kernelTexSize, char *shaderFile);
68 CGprogram createHaloConvolveProgramTexSeparable(CGcontext cgContext, bool use_tex2D, int img_width, int img_height, int kernelTexSizeX, int kernelTexSizeY, int *kernelSizes, char *shaderFile);
69 CGprogram createUpSampleProgram(CGcontext cgContext, bool useTex2D, int imageW, int imageH, char *shaderFile);
70 
71 void updateConvolveProgramMultiTexSeparable(CGprogram fprog, int offset, bool use_tex2D, bool vertical, int img_width, int img_height);
72 
73 void setDepthScaleBias(float scale, float bias);
74 CGprogram createConvolveProgramTexSteerable(int kernel_width, int kernel_height, int xoffset, int yoffset, int nkernels, bool use_tex2D, int img_width, int img_height, char *shaderFile);
75 CGprogram createMotionBlurProgram(CGcontext cgContext, double weight, char *shaderFile);
76 CGprogram createStripModeProgram(CGcontext cgContext, char *shaderFile);
77 CGprogram createDistortionMapProgram(CGcontext cgContext, float distortionFactor, char *shaderFile);
78 
79 void updateBlurParameters(CGprogram &prog, int nsamples, vec4f *offsetsWeights, int numOffsets, vec2f *scales);


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)