我有一个名为maker
的类,类中的以下代码无法编译,错误是:
cannot convert from 'void (__cdecl maker::* )(const int,const int,const FT_Span *const ,void *const )' to 'FT_SpanFunc'
void
RasterCallback(const int y,
const int count,
const FT_Span * const spans,
void * const user)
{
Spans *sptr = (Spans *)user;
for (int i = 0; i < count; ++i)
sptr->push_back(Span(spans[i].x, y, spans[i].len, spans[i].coverage));
}
void
RenderSpans(FT_Library &library,
FT_Outline * const outline,
Spans *spans)
{
FT_Raster_Params params;
memset(¶ms, 0, sizeof(params));
params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
params.gray_spans = &RasterCallback;//here is the error
params.user = spans;
FT_Outline_Render(library, outline, ¶ms);
}
上面的代码在课堂外运行得非常好。有人可以帮助我吗?