Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 自定义CIFilter和内核的问题_Objective C_C - Fatal编程技术网

Objective c 自定义CIFilter和内核的问题

Objective c 自定义CIFilter和内核的问题,objective-c,c,Objective C,C,我正在开发一个自定义过滤器,该过滤器应该使用混合模式组合到图片中,但我遇到了一个问题 内核看起来像这样 kernel vec4 brightnessEffect (sampler background_src, sampler foreground_src) { vec4 colorDodgeValue; vec4 currentSourceBackground; vec4 currentSourceForeground; currentSourceBa

我正在开发一个自定义过滤器,该过滤器应该使用混合模式组合到图片中,但我遇到了一个问题

内核看起来像这样

kernel vec4 brightnessEffect (sampler background_src, sampler foreground_src)
{
    vec4 colorDodgeValue;

    vec4 currentSourceBackground;
    vec4 currentSourceForeground;    
    currentSourceBackground = sample(background_src, samplerCoord(background_src));
    currentSourceForeground = sample(foreground_src, samplerCoord(foreground_src));

    colorDodgeValue = currentSourceBackground; //1
    //colorDodgeValue = currentSourceForeground; //2
    return colorDodgeValue;
}
当我运行它时会崩溃,如果我注释第2行并取消注释第1行,它就可以正常工作。 有什么想法吗