// See cairo_pattern_create_linear().
//
// C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-linear
963248
func PatternCreateLinear(x0, y0, x1, y1 float64) *Pattern {
	ret := wrapPattern(C.cairo_pattern_create_linear(C.double(x0), C.double(y0), C.double(x1), C.double(y1)))
	if err := ret.status(); err != nil {
		panic(err)
	}
	return ret
}
235244
func (eg *exampleGenerator) generateValidatedPatternExample() interface{} {
	if !eg.hasPatternValidation() {
		return false
	}
	pattern := eg.a.Validation.Pattern
	example, err := regen.Generate(pattern)
	if err != nil {
		return eg.r.faker.Name()
	}
	return example
}
407570
func (cr *Context) Mask(pattern *Pattern) {
	C.cairo_mask(cr.Ptr, pattern.Ptr)
	if err := cr.status(); err != nil {
		panic(err)
	}
}
1094174
func Linear(width int) ScaleFunc {
	return func(min, max, value float64) float64 {
		diff := max - min
		offset := value - min
		ratio := offset / diff
		return ratio * float64(width)
	}
}
894027
func (pattern *Pattern) AddColorStopRGB(offset, red, green, blue float64) {
	C.cairo_pattern_add_color_stop_rgb(pattern.Ptr, C.double(offset), C.double(red), C.double(green), C.double(blue))
	if err := pattern.status(); err != nil {
		panic(err)
	}
}
1036743
func PatternCreateRGB(red, green, blue float64) *Pattern {
	ret := wrapPattern(C.cairo_pattern_create_rgb(C.double(red), C.double(green), C.double(blue)))
	if err := ret.status(); err != nil {
		panic(err)
	}
	return ret
}
115356
func (sr *Strrand) CreateGenerator(pattern string) (Generator, error) {
	pis := pickers([]picker{})
	chars := func() *[]string {
		c := strings.Split(pattern, "")
		return &c
	}()

	for len(*chars) > 0 {
		chr := (*chars)[0]
		*chars = (*chars)[1:]

		switch chr {
		case "\\":
			p, err := sr.handleEscape(chars)
			if err != nil {
				return nil, err
			}
			pis = append(pis, p)
		case ".":
			pis = append(pis, any)
		case "[":
			p, err := sr.handleBracket(chars)
			if err != nil {
				return nil, err
			}
			pis = append(pis, p)
		case "*":
			*chars = append(strings.Split("{0,}", ""), (*chars)...)
		case "+":
			*chars = append(strings.Split("{1,}", ""), (*chars)...)
		case "?":
			*chars = append(strings.Split("{0,1}", ""), (*chars)...)
		case "{":
			if len(pis) < 1 {
				return pis, fmt.Errorf("invalid bracket")
			}
			pop := pis[len(pis)-1]
			pis = pis[:len(pis)-1]
			p, err := sr.handleBrace(chars, pop)
			if err != nil {
				return pis, err
			}
			pis = append(pis, p)
		default:
			pis = append(pis, chrPicker([]string{chr}))
		}
	}
	return pis, nil
}
212020
func (target *Surface) CreateForRectangle(x, y, width, height float64) *Surface {
	ret := wrapSurface(C.cairo_surface_create_for_rectangle(target.Ptr, C.double(x), C.double(y), C.double(width), C.double(height)))
	if err := target.status(); err != nil {
		panic(err)
	}
	return ret
}
1347888
func PolylineFromLatLngs(points []LatLng) *Polyline {
	p := make(Polyline, len(points))
	for k, v := range points {
		p[k] = PointFromLatLng(v)
	}
	return &p
}
1200106
func Create(data interface{}) *Tabulate {
	t := &Tabulate{FloatFormat: 'f', MaxSize: 30}

	switch v := data.(type) {
	case [][]string:
		t.Data = createFromString(data.([][]string))
	case [][]int32:
		t.Data = createFromInt32(data.([][]int32))
	case [][]int64:
		t.Data = createFromInt64(data.([][]int64))
	case [][]int:
		t.Data = createFromInt(data.([][]int))
	case [][]bool:
		t.Data = createFromBool(data.([][]bool))
	case [][]float64:
		t.Data = createFromFloat64(data.([][]float64), t.FloatFormat)
	case [][]interface{}:
		t.Data = createFromMixed(data.([][]interface{}), t.FloatFormat)
	case []string:
		t.Data = createFromString([][]string{data.([]string)})
	case []interface{}:
		t.Data = createFromMixed([][]interface{}{data.([]interface{})}, t.FloatFormat)
	case map[string][]interface{}:
		t.Headers, t.Data = createFromMapMixed(data.(map[string][]interface{}), t.FloatFormat)
	case map[string][]string:
		t.Headers, t.Data = createFromMapString(data.(map[string][]string))
	default:
		fmt.Println(v)
	}

	return t
}
1268262
func NewLinearRing(coords ...Coord) (*Geometry, error) {
	cs, err := coordSeqFromSlice(coords)
	if err != nil {
		return nil, err
	}
	return geomFromCoordSeq(cs, "NewLinearRing", cGEOSGeom_createLinearRing)
}
456386
func (calc *LineCentroidCalculator) AddLinearRing(line *geom.LinearRing) *LineCentroidCalculator {
	coords := line.FlatCoords()
	calc.addLine(coords, 0, len(coords))
	return calc
}
1222210
func Create(target *Surface) *Context {
	ret := wrapContext(C.cairo_create(target.Ptr))
	if err := ret.status(); err != nil {
		panic(err)
	}
	return ret
}
649715
func linear(v0, v1, v2, v3 *uint32) {
	*v0 = ((*v0 << 13) | (*v0 >> (32 - 13)))
	*v2 = ((*v2 << 3) | (*v2 >> (32 - 3)))
	*v1 ^= *v0 ^ *v2
	*v3 ^= *v2 ^ (*v0 << 3)
	*v1 = (*v1 << 1) | (*v1 >> (32 - 1))
	*v3 = (*v3 << 7) | (*v3 >> (32 - 7))
	*v0 ^= *v1 ^ *v3
	*v2 ^= *v3 ^ (*v1 << 7)
	*v0 = (*v0 << 5) | (*v0 >> (32 - 5))
	*v2 = (*v2 << 22) | (*v2 >> (32 - 22))
}
356525
func MakeVertexSlice(shader *Shader, len, cap int) *VertexSlice {
	if len > cap {
		panic("failed to make vertex slice: len > cap")
	}
	return &VertexSlice{
		va: newVertexArray(shader, cap),
		i:  0,
		j:  len,
	}
}
972137
func NewLinear(cfg LinearConfig) (*Linear, error) {
	if err := cfg.CheckAndSetDefaults(); err != nil {
		return nil, trace.Wrap(err)
	}
	closedChan := make(chan time.Time)
	close(closedChan)
	return &Linear{LinearConfig: cfg, closedChan: closedChan}, nil
}
485788
func (s *VLANService) NewCreateVlanIpRangeParams() *CreateVlanIpRangeParams {
	p := &CreateVlanIpRangeParams{}
	p.p = make(map[string]interface{})
	return p
}