コード例 #1
0
ファイル: magick.go プロジェクト: aliksend/magick
// Colorspace() allows to set colorspace to image
func (im *MagickImage) Colorspace(cs Colorspace) (err error) {
	c_colorspace := C.ColorspaceType(cs)
	ok := C.SetImageColorspace(im.Image, c_colorspace)
	if ok == C.MagickFalse {
		return &MagickError{"error", "", "could not set colorspace"}
	}
	return
}
コード例 #2
0
ファイル: magick_wand_prop.go プロジェクト: qwo/abelana-gcp
// Sets the wand colorspace type.
func (mw *MagickWand) SetColorspace(colorspace ColorspaceType) error {
	C.MagickSetColorspace(mw.mw, C.ColorspaceType(colorspace))
	return mw.GetLastError()
}
コード例 #3
0
ファイル: info.go プロジェクト: Kimbsen/magick
// SetColorspace set the colorspace used when encoding the image.
// Note that not all colorspaces are supported for encoding. See
// the documentation on Colorspace.
func (in *Info) SetColorspace(cs Colorspace) {
	in.info.colorspace = C.ColorspaceType(cs)
}
コード例 #4
0
ファイル: colorspace.go プロジェクト: nicolasroy/magick
// SetColorspace changes the image colorspace. Note
// that this only changes how the pixels are interpreted.
// If you want to transform the image to another colorspace
// use TransformColorspace().
func (im *Image) SetColorspace(cs Colorspace) {
	im.image.colorspace = C.ColorspaceType(cs)
}
コード例 #5
0
ファイル: magick_wand_prop.go プロジェクト: palaiyacw/imagick
// Sets the wand colorspace type.
func (mw *MagickWand) SetColorspace(colorspace ColorspaceType) error {
	ok := C.MagickSetColorspace(mw.mw, C.ColorspaceType(colorspace))
	return mw.getLastErrorIfFailed(ok)
}