func (mw *MagickWand) AddImage(wand *MagickWand) error {
	ok := C.MagickAddImage(mw.mw, wand.mw)
	return mw.getLastErrorIfFailed(ok)
}
Adds a clone of the images from the second wand and inserts them into the
first wand. Use SetLastIterator(), to append new images into an existing
wand, current image will be set to last image so later adds with also be
appened to end of wand. Use SetFirstIterator() to prepend new images into
wand, any more images added will also be prepended before other images in
the wand. However the order of a list of new images will not change.
Otherwise the new images will be inserted just after the current image, and
any later image will also be added after this current image but before the
previously added images. Caution is advised when multiple image adds are
inserted into the middle of the wand image list.
package gmagick
import "C"
import (
	"errors"
	"os"
	"runtime"
	"sync"
	"sync/atomic"
	"syscall"
	"unsafe"
)
type MagickWand struct {
	mw   *C.MagickWand
	init sync.Once
}
func newMagickWand(cmw *C.MagickWand) *MagickWand {
	mw := &MagickWand{mw: cmw}
	runtime.SetFinalizer(mw, Destroy)
	mw.IncreaseCount()
	return mw
}
func NewMagickWand() *MagickWand {
	return newMagickWand(C.NewMagickWand())
}
func (mw *MagickWand) Clone() *MagickWand {
	return newMagickWand(C.CloneMagickWand(mw.mw))
}
func (mw *MagickWand) Destroy() {
	if mw.mw == nil {
		return
	}
	mw.init.Do(func() {
		C.DestroyMagickWand(mw.mw)
		mw.mw = nil
		mw.DecreaseCount()
	})
}
func (mw *MagickWand) IncreaseCount() {
	atomic.AddInt64(&magickWandCounter, int64(1))
	unsetCanTerminate()
}
func (mw *MagickWand) DecreaseCount() {
	atomic.AddInt64(&magickWandCounter, int64(-1))
	setCanTerminate()
}
func (mw *MagickWand) GetImageIndex() uint {
	return uint(C.MagickGetImageIndex(mw.mw))
}
func (mw *MagickWand) AdaptiveThresholdImage(width, height uint, offset int) error {
	ok := C.MagickAdaptiveThresholdImage(mw.mw, C.ulong(width), C.ulong(height), C.long(offset))
	return mw.getLastErrorIfFailed(ok)
}