mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-05 00:10:24 +08:00
20 lines
478 B
Common Lisp
20 lines
478 B
Common Lisp
kernel void scale(
|
|
read_only image2d_t inputImg,
|
|
sampler_t smp,
|
|
write_only image2d_t outputImg)
|
|
{
|
|
uint x = get_global_id(0);
|
|
uint y = get_global_id(1);
|
|
uint outW = get_image_width(outputImg);
|
|
uint outH = get_image_height(outputImg);
|
|
|
|
float2 normCoord = (float2)(
|
|
(float)x / (float)outW,
|
|
(float)y / (float)outH
|
|
);
|
|
|
|
float4 pixel = read_imagef(inputImg, smp, normCoord);
|
|
|
|
write_imagef(outputImg, (int2)(x, y), pixel);
|
|
}
|