Esempio n. 1
0
func (ws *webservice) mergeInfo(renreq *protocol.RenderRequest) (*lib.Info, error) {
	req := ws.baseinfo.UserRequest

	log.Printf("Base request: %v", req)

	req.ImageWidth = renreq.Req.ImageWidth
	req.ImageHeight = renreq.Req.ImageHeight

	// TODO - route for default render, for cleaner semantics here
	noplane := false
	bounds := []string{
		renreq.Req.RealMin,
		renreq.Req.RealMax,
		renreq.Req.ImagMin,
		renreq.Req.ImagMax,
	}

	for _, b := range bounds {
		noplane = noplane || b == ""
	}

	if !noplane {
		req.RealMin = renreq.Req.RealMin
		req.RealMax = renreq.Req.RealMax
		req.ImagMin = renreq.Req.ImagMin
		req.ImagMax = renreq.Req.ImagMax
	}

	log.Printf("Configuring request: %v", req)

	return lib.Configure(&req)
}
Esempio n. 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)
	}
}