Example #1
0
// 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
}
Example #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
}
Example #3
0
// 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
}