Ejemplo n.º 1
0
// 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
}
Ejemplo n.º 2
0
// Sets the wand colorspace type.
func (mw *MagickWand) SetColorspace(colorspace ColorspaceType) error {
	C.MagickSetColorspace(mw.mw, C.ColorspaceType(colorspace))
	return mw.GetLastError()
}
Ejemplo n.º 3
0
// 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)
}
Ejemplo n.º 4
0
// 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)
}
Ejemplo n.º 5
0
// Sets the wand colorspace type.
func (mw *MagickWand) SetColorspace(colorspace ColorspaceType) error {
	ok := C.MagickSetColorspace(mw.mw, C.ColorspaceType(colorspace))
	return mw.getLastErrorIfFailed(ok)
}