// TransformScale generally scales the following text, drawings and images.
// scaleWd and scaleHt are the percentage scaling factors for width and height.
// (x, y) is center of scaling.
//
// The TransformBegin() example demonstrates this method.
965523
func (f *Fpdf) TransformScale(scaleWd, scaleHt, x, y float64) {
	if scaleWd == 0 || scaleHt == 0 {
		f.err = fmt.Errorf("scale factor cannot be zero")
		return
	}
	y = (f.h - y) * f.k
	x *= f.k
	scaleWd /= 100
	scaleHt /= 100
	f.Transform(TransformMatrix{scaleWd, 0, 0,
		scaleHt, x * (1 - scaleWd), y * (1 - scaleHt)})
}
1292162
func (facade *Facade) Rescale(args params.Entities) params.ErrorResults {
	result := params.ErrorResults{
		Results: make([]params.ErrorResult, len(args.Entities)),
	}
	for i, entity := range args.Entities {
		err := facade.rescaleOne(entity.Tag)
		result.Results[i].Error = common.ServerError(err)
	}
	return result
}
739361
func (tr Matrix) GetScale() float64 {
	x := 0.707106781*tr[0] + 0.707106781*tr[1]
	y := 0.707106781*tr[2] + 0.707106781*tr[3]
	return math.Sqrt(x*x + y*y)
}
211698
func autoscale() {
	dumper := NewDumper("xautoscale", 2, 2, 600, 400)
	defer dumper.Close()

	N := 200
	points := make([]chart.EPoint, N)
	for i := 0; i < N-1; i++ {
		points[i].X = rand.Float64()*10000 - 5000 // Full range is [-5000:5000]
		points[i].Y = rand.Float64()*10000 - 5000 // Full range is [-5000:5000]
		points[i].DeltaX = rand.Float64() * 400
		points[i].DeltaY = rand.Float64() * 400
	}
	points[N-1].X = -650
	points[N-1].Y = -2150
	points[N-1].DeltaX = 400
	points[N-1].DeltaY = 400
	points[N-1].OffX = 100
	points[N-1].OffY = -150

	s := chart.ScatterChart{Title: "Full Autoscaling"}
	s.Key.Hide = true
	s.XRange.TicSetting.Mirror = 1
	s.YRange.TicSetting.Mirror = 1
	s.AddData("Data", points, chart.PlotStylePoints, chart.Style{Symbol: 'o', SymbolColor: color.NRGBA{0x00, 0xee, 0x00, 0xff}})
	dumper.Plot(&s)

	s = chart.ScatterChart{Title: "Xmin: -1850, Xmax clipped to [500:900]"}
	s.Key.Hide = true
	s.XRange.TicSetting.Mirror = 1
	s.YRange.TicSetting.Mirror = 1
	s.XRange.MinMode.Fixed, s.XRange.MinMode.Value = true, -1850
	s.XRange.MaxMode.Constrained = true
	s.XRange.MaxMode.Lower, s.XRange.MaxMode.Upper = 500, 900

	s.AddData("Data", points, chart.PlotStylePoints, chart.Style{Symbol: '0', SymbolColor: color.NRGBA{0xee, 0x00, 0x00, 0xff}})
	dumper.Plot(&s)

	s = chart.ScatterChart{Title: "Xmin: -1850, Ymax clipped to [9000:11000]"}
	s.Key.Hide = true
	s.XRange.TicSetting.Mirror = 1
	s.YRange.TicSetting.Mirror = 1
	s.XRange.MinMode.Fixed, s.XRange.MinMode.Value = true, -1850
	s.YRange.MaxMode.Constrained = true
	s.YRange.MaxMode.Lower, s.YRange.MaxMode.Upper = 9000, 11000

	s.AddData("Data", points, chart.PlotStylePoints, chart.Style{Symbol: '0', SymbolColor: color.NRGBA{0x00, 0x00, 0xee, 0xff}})
	dumper.Plot(&s)

	s = chart.ScatterChart{Title: "Tiny fraction"}
	s.Key.Hide = true
	s.XRange.TicSetting.Mirror = 1
	s.YRange.TicSetting.Mirror = 1

	s.YRange.MinMode.Constrained = true
	s.YRange.MinMode.Lower, s.YRange.MinMode.Upper = -2250, -2050
	s.YRange.MaxMode.Constrained = true
	s.YRange.MaxMode.Lower, s.YRange.MaxMode.Upper = -1950, -1700

	s.XRange.MinMode.Constrained = true
	s.XRange.MinMode.Lower, s.XRange.MinMode.Upper = -900, -800
	s.XRange.MaxMode.Constrained = true
	s.XRange.MaxMode.Lower, s.XRange.MaxMode.Upper = -850, -650

	s.AddData("Data", points, chart.PlotStylePoints, chart.Style{Symbol: '0', SymbolColor: color.NRGBA{0xee, 0xcc, 0x00, 0xff}})
	dumper.Plot(&s)
}
1355414
func (f *Fpdf) TransformScaleX(scaleWd, x, y float64) {
	f.TransformScale(scaleWd, 100, x, y)
}
785040
func (s *ColumnMetadata) SetScale(v int64) *ColumnMetadata {
	s.Scale = &v
	return s
}
519777
func Scale(x uint, y uint) OptionsFunc {
	return func(w *Waveform) error {
		return w.setScale(x, y)
	}
}
961967
func (c C) Scaleneg(val Input) Input {
	if c < 0 {
		return c.Mul(val)
	}
	return c
}
56679
func (t *Table) Transform(column int, s string) string {
	return t.transformer[column](s)
}
806557
func Scale2D(scaleX, scaleY float64) Mat3 {
	return Mat3{float64(scaleX), 0, 0, 0, float64(scaleY), 0, 0, 0, 1}
}
207717
func (a Affine) TransformCenter(dst draw.Image, src image.Image, i interp.Interp) error {
	if dst == nil {
		return errors.New("graphics: dst is nil")
	}
	if src == nil {
		return errors.New("graphics: src is nil")
	}

	return a.CenterFit(dst.Bounds(), src.Bounds()).Transform(dst, src, i)
}
1165382
func (s *TaskSet) SetScale(v *Scale) *TaskSet {
	s.Scale = v
	return s
}
380225
func (mat *T) Scale(f float32) *T {
	mat[0][0] *= f
	mat[1][1] *= f
	mat[2][2] *= f
	return mat
}
160543
func (p *Project) Scale(c *check.C, service string, count int) {
	c.Assert(p.project.Scale(service, count), check.IsNil,
		check.Commentf("error while scaling the service '%s'", service))
}
1051262
func (tr *Matrix) Scale(sx, sy float64) {
	tr[0] = sx * tr[0]
	tr[1] = sx * tr[1]
	tr[2] = sy * tr[2]
	tr[3] = sy * tr[3]
}
21832
func ScaledFontCreate(fontFace *FontFace, fontMatrix, ctm *Matrix, options *FontOptions) *ScaledFont {
	ret := wrapScaledFont(C.cairo_scaled_font_create(fontFace.Ptr, (*C.cairo_matrix_t)(unsafe.Pointer(fontMatrix)), (*C.cairo_matrix_t)(unsafe.Pointer(ctm)), options.Ptr))
	if err := ret.status(); err != nil {
		panic(err)
	}
	return ret
}
587425
func (vec *T) Scaled(f float32) T {
	return T{vec[0] * f, vec[1] * f, vec[2] * f}
}