mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
36 lines
1.1 KiB
Common Lisp
36 lines
1.1 KiB
Common Lisp
|
#include "calcfirstder.cl"
|
||
|
|
||
|
__constant sampler_t sampler =
|
||
|
CLK_NORMALIZED_COORDS_FALSE
|
||
|
| CLK_ADDRESS_CLAMP_TO_EDGE
|
||
|
| CLK_FILTER_NEAREST;
|
||
|
|
||
|
__kernel void processNineCellWindow(
|
||
|
__read_only image2d_t inputImage,
|
||
|
image2d_t outputImage,
|
||
|
__global float *rasterParams
|
||
|
) {
|
||
|
|
||
|
|
||
|
// 0=width, 1=height
|
||
|
int2 currentPosition = (int2)(get_global_id(0), get_global_id(1));
|
||
|
float4 currentPixel = (ufloat4)(0.0f);
|
||
|
float4 calculatedPixel = (float4)(1.0f);
|
||
|
|
||
|
currentPixel = read_imageuf(inputImage, sampler, currentPosition);
|
||
|
calculatedPixel = currentPixel;
|
||
|
write_imageuf(outputImage, currentPosition, calculatedPixel);
|
||
|
}
|
||
|
|
||
|
|
||
|
const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;
|
||
|
|
||
|
void kernel copy(__read_only image2d_t in, image2d_t out)
|
||
|
{
|
||
|
int x = get_global_id(0);
|
||
|
int y = get_global_id(1);
|
||
|
int2 pos = (int2)(x, y);
|
||
|
uint4 pixel = read_imageui(in, smp, pos);
|
||
|
write_imageui(out, pos, pixel);
|
||
|
}
|