Golang C.MagickModulateImage类(方法)实例源码

下面列出了Golang C.MagickModulateImage 类(方法)源码代码实例,从而了解它的用法。

作者:phacop    项目:canva   
// Adjusts the canvas's brightness given a factor (-1.0 thru 1.0)
func (self *Canvas) SetBrightness(factor float64) error {
	factor = math.Max(-1, factor)
	factor = math.Min(1, factor)

	success := C.MagickModulateImage(self.wand, C.double(100+factor*100.0), C.double(100), C.double(100))

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

	return nil
}

作者:mishudar    项目:gosex   
// Adjusts the canvas's hue given a factor (-1.0 thru 1.0)
func (cv Canvas) SetHue(factor float64) bool {

	factor = math.Max(-1, factor)
	factor = math.Min(1, factor)

	status := C.MagickModulateImage(cv.wand, C.double(100), C.double(100), C.double(100+factor*100.0))

	if status == C.MagickFalse {
		return false
	}

	return true
}


问题


面经


文章

微信
公众号

扫码关注公众号