PHP_METHOD(imagickkernel, frombuiltin)
{
	im_long kernel_type;
	GeometryInfo geometry_info = {
		0, //rho,
		0, //sigma,
		0, //xi,
		0, //psi,
		0, //chi;
	};
	KernelInfo *kernel_info;
	char *string;
	IM_LEN_TYPE string_len;
	GeometryFlags flags;
#if MagickLibVersion >= 0x700
	ExceptionInfo *_exception_info = NULL;
#endif

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &kernel_type, &string, &string_len) == FAILURE) {
		return;
	}

	flags = ParseGeometry(string, &geometry_info);
	imagick_fiddle_with_geometry_info(kernel_type, flags, &geometry_info);
	
#if MagickLibVersion >= 0x700
	//TODO - inspect exception info
	kernel_info = AcquireKernelBuiltIn(kernel_type, &geometry_info, _exception_info);
#else
	kernel_info = AcquireKernelBuiltIn(kernel_type, &geometry_info);
#endif
	createKernelZval(return_value, kernel_info TSRMLS_CC);

	return;
}
PHP_METHOD(imagickkernel, frombuiltin)
{
	im_long kernel_type;
	GeometryInfo geometry_info = {
		0,  
		0,  
		0,  
		0,  
		0,  
	};
	KernelInfo *kernel_info;
	char *string;
	IM_LEN_TYPE string_len;
	GeometryFlags flags;
#if MagickLibVersion >= 0x700
	ExceptionInfo *_exception_info = NULL;
#endif

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &kernel_type, &string, &string_len) == FAILURE) {
		return;
	}

	flags = ParseGeometry(string, &geometry_info);
	imagick_fiddle_with_geometry_info(kernel_type, flags, &geometry_info);
	
#if MagickLibVersion >= 0x700
	 
	kernel_info = AcquireKernelBuiltIn(kernel_type, &geometry_info, _exception_info);
#else
	kernel_info = AcquireKernelBuiltIn(kernel_type, &geometry_info);
#endif
	createKernelZval(return_value, kernel_info TSRMLS_CC);

	return;
}