FFmpeg
Loading...
Searching...
No Matches
pad.c
Go to the documentation of this file.
1// Generated from libavfilter/opencl/pad.cl
2const char *ff_source_pad_cl =
3"/*\n"
4" * This file is part of FFmpeg.\n"
5" *\n"
6" * FFmpeg is free software; you can redistribute it and/or\n"
7" * modify it under the terms of the GNU Lesser General Public\n"
8" * License as published by the Free Software Foundation; either\n"
9" * version 2.1 of the License, or (at your option) any later version.\n"
10" *\n"
11" * FFmpeg is distributed in the hope that it will be useful,\n"
12" * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
13" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
14" * Lesser General Public License for more details.\n"
15" *\n"
16" * You should have received a copy of the GNU Lesser General Public\n"
17" * License along with FFmpeg; if not, write to the Free Software\n"
18" * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n"
19" */\n"
20"\n"
21"const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE |\n"
22" CLK_FILTER_NEAREST;\n"
23"\n"
24"__kernel void pad (\n"
25" __read_only image2d_t src,\n"
26" __write_only image2d_t dst,\n"
27" float4 color,\n"
28" int2 xy)\n"
29"{\n"
30" int2 size_src = get_image_dim(src);\n"
31" int2 loc = (int2)(get_global_id(0), get_global_id(1));\n"
32" int2 src_pos = (int2)(get_global_id(0) - xy.x, get_global_id(1) - xy.y);\n"
33" float4 pixel = loc.x >= size_src.x + xy.x ||\n"
34" loc.y >= size_src.y + xy.y ||\n"
35" loc.x < xy.x ||\n"
36" loc.y < xy.y ? color : read_imagef(src, sampler, src_pos);\n"
37" write_imagef(dst, loc, pixel);\n"
38"}\n"
39;
const char * ff_source_pad_cl
Definition pad.c:2