/* The range isn't guaranteed to be minimal, but it tries to.  */
void _cairo_gradient_pattern_box_to_parameter(const cairo_gradient_pattern_t *gradient, double x0, double y0, double x1, double y1, double tolerance, double out_range[2])
/* The range isn't guaranteed to be minimal, but it tries to.  */
void _cairo_gradient_pattern_box_to_parameter(const cairo_gradient_pattern_t *gradient, double x0, double y0, double x1, double y1, double tolerance, double out_range[2])
{
    assert (gradient->base.type == CAIRO_PATTERN_TYPE_LINEAR ||
	    gradient->base.type == CAIRO_PATTERN_TYPE_RADIAL);
    if (gradient->base.type == CAIRO_PATTERN_TYPE_LINEAR) {
	_cairo_linear_pattern_box_to_parameter ((cairo_linear_pattern_t *) gradient,
						x0, y0, x1, y1, out_range);
    } else {
	_cairo_radial_pattern_box_to_parameter ((cairo_radial_pattern_t *) gradient,
						x0, y0, x1, y1, tolerance, out_range);
    }
}