GuidedFilter  1.2.0
 Hosted by GitHub
Functions
examples_kernels.cl File Reference

Kernels used by the provided example applications. More...

Functions

kernel void combineRGBGL (global float *r, global float *g, global float *b, write_only image2d_t out, local float *data, int width, int norm)
 Combines the 3 channels of an RGB Image. More...
 
kernel void combineRGBGL_PC (global float *r, global float *g, global float *b, global float4 *out, local float *data, int width, int norm)
 Combines the 3 channels of an RGB Image. More...
 

Detailed Description

Kernels used by the provided example applications.

Author
Nick Lamprianidis
Version
1.0
Date
2015
Copyright (c) 2015 Nick Lamprianidis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

kernel void combineRGBGL ( global float *  r,
global float *  g,
global float *  b,
write_only image2d_t  out,
local float *  data,
int  width,
int  norm 
)

Combines the 3 channels of an RGB Image.

Assembles the pixels, performs RGB normalization, and stores the resulting pixel to an image object.

Note
It's meant to be used for storing the results on an OpenGL texture.
Performs a matrix transposition on an RGB image (SoA -> AoS). For avoiding alignment restrictions, the SoA structure is broken out to the individual channels, R, G, B.
The global workspace should be one-dimensional (= # pixels in the input buffer). The global and local workspaces should be a multiple of 3.
Parameters
[in]rinput buffer with all the pixel values in channel R.
[in]ginput buffer with all the pixel values in channel G.
[in]binput buffer with all the pixel values in channel B.
[out]outoutput RGBA image.
[in]datalocal buffer with size 3 x (# work-items in work-group) x sizeof (float) bytes.
[in]widthwidth the images.
[in]normflag to indicate whether to perform RGB normalization before storing the pixels.
kernel void combineRGBGL_PC ( global float *  r,
global float *  g,
global float *  b,
global float4 *  out,
local float *  data,
int  width,
int  norm 
)

Combines the 3 channels of an RGB Image.

Assembles the pixels, performs RGB normalization, and stores the resulting pixel to an image object.

Note
It's meant to be used for storing the results on an OpenGL vertex buffer.
Performs a matrix transposition on an RGB image (SoA -> AoS). For avoiding alignment restrictions, the SoA structure is broken out to the individual channels, R, G, B.
The global workspace should be one-dimensional (= # pixels in the input buffer). The global and local workspaces should be a multiple of 3.
Parameters
[in]rinput buffer with all the pixel values in channel R.
[in]ginput buffer with all the pixel values in channel G.
[in]binput buffer with all the pixel values in channel B.
[out]outoutput RGBA image.
[in]datalocal buffer with size 3 x (# work-items in work-group) x sizeof (float) bytes.
[in]widthwidth the images.
[in]normflag to indicate whether to perform RGB normalization before storing the pixels.