Пример #1
0
func main() {
	var input io.Reader = os.Stdin
	var output io.Writer = os.Stdout

	args := readArgs()
	validerr := args.zt.Validate()
	if validerr != nil {
		log.Fatal(validerr)
	}

	info, readerr := lib.ReadInfo(input)
	if readerr != nil {
		log.Fatal("Could not read info:", readerr)
	}

	z := lib.Zoom{}
	z.ZoomTarget = args.zt
	z.Prev = *info

	frames, moverr := z.Movie()
	if moverr != nil {
		log.Fatal("Error zooming:", moverr)
	}

	for _, info := range frames {
		outerr := lib.WriteInfo(output, info)
		if outerr != nil {
			log.Println("Error writing output:", outerr)
			break
		}
	}
}
Пример #2
0
func main() {
	output := os.Stdout

	args := parseArguments()

	req, inerr := newRequest(args)
	if inerr != nil {
		log.Fatal("Error forming request: ", inerr)
	}

	desc, gerr := godelbrot.Configure(req)

	if gerr != nil {
		log.Fatal("Error configuring Info: ", gerr)
	}

	outerr := godelbrot.WriteInfo(output, desc)
	if outerr != nil {
		log.Fatal("Error writing Info: ", outerr)
	}
}
Пример #3
0
func (rb *renderbuffers) input(info *lib.Info) error {
	return lib.WriteInfo(&rb.info, info)
}