我想从目标c翻译到C++。但是有一些客观的c sintax对我不明确。帮我PLZ明白这是什么:initWithName在目标c
@synthesize contrast = _contrast;
我觉得这产生的getter setter方法属性命名对比度 但什么是_contrast?我还没有发现它在任何地方项目除了一个地方(下同)
然后在另一个功能:
_firstParameter = [ [ MPPostProcessParameter alloc ] initWithName: @"Contrast" minValue: 0.4f maxValue: 2.0f defaultValue: 1.0f ];
确定。这里我想我们初始化这个属性名为contrast(见上面),它包含MPPostProcessParameter的构造函数(minValue:0.4f maxValue:等等) 但是! 在其他函数中这个对比属性用作float!不是MPPostProcessParameter类型的对象!
function (xxx, _contrast); //? the second argument must be float!
帮助我PLZ了解什么是
_firstParameter = [ [ MPPostProcessParameter alloc ] initWithName: @"Contrast" minValue: 0.4f maxValue: 2.0f defaultValue: 1.0f ];
在C++语言编写(什么是initWithName什么这个功能做的话) 谢谢
我认为'_firstParameter'的问题不是因为MPPostProcessParameter对象没有存储在_contrast变量中(正如你的问题所暗示的),而是存储在_firstParameter中。你确定所有的片段都是正确的吗? –