예제 #1
0
파일: canvas.go 프로젝트: mishudark/gosexy
// Adaptively changes the size of the canvas, returns true on success.
func (cv Canvas) AdaptiveResize(width uint, height uint) bool {
	status := C.MagickAdaptiveResizeImage(cv.wand, C.size_t(width), C.size_t(height))
	if status == C.MagickFalse {
		return false
	}
	return true
}
예제 #2
0
/* Adaptively resize image with data dependent triangulation. */
func (w *MagickWand) AdaptiveResizeImage(columns, rows uint) error {
	if C.MagickAdaptiveResizeImage(w.wand, C.size_t(columns), C.size_t(rows)) == C.MagickFalse {
		eStr, eCode := w.Exception()
		return fmt.Errorf("AdaptiveResizeImage() failed : [%d] %s", eStr, eCode)
	}

	return nil
}
예제 #3
0
파일: canvas.go 프로젝트: phacops/canvas
// Adaptively changes the size of the canvas, returns true on success.
func (self *Canvas) AdaptiveResize(width uint, height uint) error {
	success := C.MagickAdaptiveResizeImage(self.wand, C.size_t(width), C.size_t(height))

	if success == C.MagickFalse {
		return fmt.Errorf("Could not resize: %s", self.Error())
	}

	return nil
}