示例#1
0
void VS_CC resizeInitialize(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin *plugin) {
#define INT_OPT(x) #x":int:opt;"
#define FLOAT_OPT(x) #x":float:opt;"
#define DATA_OPT(x) #x":data:opt;"
#define ENUM_OPT(x) INT_OPT(x)DATA_OPT(x ## _s)
    static const char FORMAT_DEFINITION[] =
        "clip:clip;"
        INT_OPT(width)
        INT_OPT(height)
        INT_OPT(format)
        ENUM_OPT(matrix)
        ENUM_OPT(transfer)
        ENUM_OPT(primaries)
        ENUM_OPT(range)
        ENUM_OPT(chromaloc)
        ENUM_OPT(matrix_in)
        ENUM_OPT(transfer_in)
        ENUM_OPT(primaries_in)
        ENUM_OPT(range_in)
        ENUM_OPT(chromaloc_in)
        FLOAT_OPT(filter_param_a)
        FLOAT_OPT(filter_param_b)
        DATA_OPT(resample_filter_uv)
        FLOAT_OPT(filter_param_a_uv)
        FLOAT_OPT(filter_param_b_uv)
        DATA_OPT(dither_type)
        DATA_OPT(cpu_type)
        INT_OPT(prefer_props);
#undef INT_OPT
#undef FLOAT_OPT
#undef DATA_OPT
#undef ENUM_OPT

    zimg_get_version_info(&g_version_info[0], &g_version_info[1], &g_version_info[2]);
    zimg_get_api_version(&g_api_version[0], &g_api_version[1]);

    configFunc("com.vapoursynth.resize", "resize", "VapourSynth Resize", VAPOURSYNTH_API_VERSION, 1, plugin);
    registerFunc("Bilinear", FORMAT_DEFINITION, vszimg_create, (void *)ZIMG_RESIZE_BILINEAR, plugin);
    registerFunc("Bicubic", FORMAT_DEFINITION, vszimg_create, (void *)ZIMG_RESIZE_BICUBIC, plugin);
    registerFunc("Point", FORMAT_DEFINITION, vszimg_create, (void *)ZIMG_RESIZE_POINT, plugin);
    registerFunc("Lanczos", FORMAT_DEFINITION, vszimg_create, (void *)ZIMG_RESIZE_LANCZOS, plugin);
    registerFunc("Spline16", FORMAT_DEFINITION, vszimg_create, (void *)ZIMG_RESIZE_SPLINE16, plugin);
    registerFunc("Spline36", FORMAT_DEFINITION, vszimg_create, (void *)ZIMG_RESIZE_SPLINE36, plugin);
}
示例#2
0
文件: vszimg.c 项目: theomission/zimg
VS_EXTERNAL_API(void) VapourSynthPluginInit(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin *plugin)
{
#define INT_OPT(x) #x":int:opt;"
#define FLOAT_OPT(x) #x":float:opt;"
#define DATA_OPT(x) #x":data:opt;"
#define ENUM_OPT(x) INT_OPT(x)DATA_OPT(x ## _s)
	static const char FORMAT_DEFINITION[] =
		"clip:clip;"
		INT_OPT(width)
		INT_OPT(height)
		INT_OPT(format)
		ENUM_OPT(matrix)
		ENUM_OPT(transfer)
		ENUM_OPT(primaries)
		ENUM_OPT(range)
		ENUM_OPT(chromaloc)
		ENUM_OPT(matrix_in)
		ENUM_OPT(transfer_in)
		ENUM_OPT(primaries_in)
		ENUM_OPT(range_in)
		ENUM_OPT(chromaloc_in)
		DATA_OPT(resample_filter)
		FLOAT_OPT(filter_param_a)
		FLOAT_OPT(filter_param_b)
		DATA_OPT(resample_filter_uv)
		FLOAT_OPT(filter_param_a_uv)
		FLOAT_OPT(filter_param_b_uv)
		DATA_OPT(dither_type)
		DATA_OPT(cpu_type);
#undef INT_OPT
#undef FLOAT_OPT
#undef DATA_OPT
#undef ENUM_OPT

	zimg_get_version_info(&g_version_info[0], &g_version_info[1], &g_version_info[2]);
	zimg_get_api_version(&g_api_version[0], &g_api_version[1]);

	configFunc("the.weather.channel", "z", "batman", VAPOURSYNTH_API_VERSION, 1, plugin);

	registerFunc("Format", FORMAT_DEFINITION, vszimg_create, NULL, plugin);
}