From 17dfe96f29c8f5d840314a5357c183b1f957de17 Mon Sep 17 00:00:00 2001 From: Justin Israel Date: Sat, 9 Sep 2023 17:06:09 +1200 Subject: [PATCH] gofmt and docstring formatting --- examples/affine/main.go | 1 - imagick/affine_matrix_test.go | 2 +- imagick/fix_32_bit.go | 1 + imagick/kernel_info.go | 9 +- imagick/kernel_info_test.go | 2 +- imagick/magick_wand_image.go | 1295 ++++++++++++++------------------- imagick/magick_wand_prop.go | 126 ++-- imagick/memory.go | 2 +- imagick/pixel_iterator.go | 40 +- 9 files changed, 653 insertions(+), 825 deletions(-) diff --git a/examples/affine/main.go b/examples/affine/main.go index fe78566..ae8d813 100644 --- a/examples/affine/main.go +++ b/examples/affine/main.go @@ -129,7 +129,6 @@ func example1() { // Since rotation is done around the origin, we must translate // the point (300,100) up to the origin, do the rotation, and // then translate back again -// func example2() { imagick.Initialize() defer imagick.Terminate() diff --git a/imagick/affine_matrix_test.go b/imagick/affine_matrix_test.go index 1e182e8..476e368 100644 --- a/imagick/affine_matrix_test.go +++ b/imagick/affine_matrix_test.go @@ -37,7 +37,7 @@ func TestAffineMatrix(t *testing.T) { t.Errorf("Expected SY=-1, got %v", m.ScaleY()) } - dw.Affine(m) + dw.Affine(m) mw.DrawImage(dw) m.ResetToIdentity() diff --git a/imagick/fix_32_bit.go b/imagick/fix_32_bit.go index 7e6f33d..b1789d7 100644 --- a/imagick/fix_32_bit.go +++ b/imagick/fix_32_bit.go @@ -1,3 +1,4 @@ +//go:build 386 // +build 386 package imagick diff --git a/imagick/kernel_info.go b/imagick/kernel_info.go index 4687daf..652e263 100644 --- a/imagick/kernel_info.go +++ b/imagick/kernel_info.go @@ -157,10 +157,11 @@ func NewKernelInfoBuiltIn(typ KernelInfoType, kernel string) (*KernelInfo, error // http://www.imagemagick.org/api/morphology.php#ScaleKernelInfo for details. // // Flag should be one of: -// KERNEL_NORMALIZE_NONE -// KERNEL_NORMALIZE_VALUE -// KERNEL_NORMALIZE_CORRELATE -// KERNEL_NORMALIZE_PERCENT +// +// KERNEL_NORMALIZE_NONE +// KERNEL_NORMALIZE_VALUE +// KERNEL_NORMALIZE_CORRELATE +// KERNEL_NORMALIZE_PERCENT func (ki *KernelInfo) Scale(scale float64, normalizeType KernelNormalizeType) { C.ScaleKernelInfo(ki.info, C.double(scale), C.GeometryFlags(normalizeType)) runtime.KeepAlive(ki) diff --git a/imagick/kernel_info_test.go b/imagick/kernel_info_test.go index af71d4c..c89f9e9 100644 --- a/imagick/kernel_info_test.go +++ b/imagick/kernel_info_test.go @@ -20,7 +20,7 @@ func TestKernelInfo(t *testing.T) { kernel string size int }{ - {"Laplacian:2", 3}, // Laplacian + {"Laplacian:2", 3}, // Laplacian {"3x3: 0.0, 0.5, 0.0, 0.5, 1.0, 0.5, 0.0, 0.5, 0.0", 3}, // spread {"0.0 0.5 0.0 0.5 1.0 0.5 0.0 0.5 0.0", 3}, // old } diff --git a/imagick/magick_wand_image.go b/imagick/magick_wand_image.go index 2396287..e82c1a1 100644 --- a/imagick/magick_wand_image.go +++ b/imagick/magick_wand_image.go @@ -36,27 +36,25 @@ func checkColsRows(cols, rows uint) error { return nil } -// Returns the current image from the magick wand +// GetImageFromMagickWand Returns the current image from the magick wand func (mw *MagickWand) GetImageFromMagickWand() *Image { return &Image{C.GetImageFromMagickWand(mw.mw)} } -// Adaptively blurs the image by blurring less intensely near image edges and +// AdaptiveBlurImage Adaptively blurs the image by blurring less intensely near image edges and // more intensely far from edges. We blur the image with a Gaussian operator of // the given radius and standard deviation (sigma). For reasonable results, // radius should be larger than sigma. Use a radius of 0 and // AdaptiveBlurImage() selects a suitable radius for you. // -// radius: the radius of the Gaussian, in pixels, not counting the center pixel -// -// sigma: the standard deviation of the Gaussian, in pixels -// +// radius: the radius of the Gaussian, in pixels, not counting the center pixel +// sigma: the standard deviation of the Gaussian, in pixels func (mw *MagickWand) AdaptiveBlurImage(radius, sigma float64) error { ok := C.MagickAdaptiveBlurImage(mw.mw, C.double(radius), C.double(sigma)) return mw.getLastErrorIfFailed(ok) } -// Adaptively resize image with data dependent triangulation +// AdaptiveResizeImage Adaptively resize image with data dependent triangulation func (mw *MagickWand) AdaptiveResizeImage(cols, rows uint) error { if err := checkColsRows(cols, rows); err != nil { return err @@ -65,23 +63,21 @@ func (mw *MagickWand) AdaptiveResizeImage(cols, rows uint) error { return mw.getLastErrorIfFailed(ok) } -// Adaptively sharpens the image by sharpening more intensely near image edges +// AdaptiveSharpenImage Adaptively sharpens the image by sharpening more intensely near image edges // and less intensely far from edges. We sharpen the image with a Gaussian // operator of the given radius and standard deviation (sigma). For reasonable // results, radius should be larger than sigma. Use a radius of 0 and // AdaptiveSharpenImage() selects a suitable radius for you. // -// radius: the radius of the Gaussian, in pixels, not counting the center pixel -// -// sigma: the standard deviation of the Gaussian, in pixels. -// +// radius: the radius of the Gaussian, in pixels, not counting the center pixel +// sigma: the standard deviation of the Gaussian, in pixels. func (mw *MagickWand) AdaptiveSharpenImage(radius, sigma float64) error { ok := C.MagickAdaptiveSharpenImage(mw.mw, C.double(radius), C.double(sigma)) runtime.KeepAlive(mw) return mw.getLastErrorIfFailed(ok) } -// Selects an individual threshold for each pixel based on the range of +// AdaptiveThresholdImage Selects an individual threshold for each pixel based on the range of // intensity values in its local neighborhood. This allows for thresholding // of an image whose global intensity histogram doesn't contain distinctive // peaks. @@ -90,13 +86,13 @@ func (mw *MagickWand) AdaptiveThresholdImage(width, height uint, offset float64) return mw.getLastErrorIfFailed(ok) } -// Adds a clone of the images from the second wand and inserts them into the +// AddImage 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 +// appended 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 +// 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. @@ -106,27 +102,24 @@ func (mw *MagickWand) AddImage(wand *MagickWand) error { return mw.getLastErrorIfFailed(ok) } -// Adds random noise to the image +// AddNoiseImage Adds random noise to the image func (mw *MagickWand) AddNoiseImage(noiseType NoiseType, offset float64) error { ok := C.MagickAddNoiseImage(mw.mw, C.NoiseType(noiseType), C.double(offset)) return mw.getLastErrorIfFailed(ok) } -// Transforms an image as dictaded by the affine matrix of the drawing wand +// AffineTransformImage Transforms an image as dictaded by the affine matrix of the drawing wand func (mw *MagickWand) AffineTransformImage(drawingWand *DrawingWand) error { ok := C.MagickAffineTransformImage(mw.mw, drawingWand.dw) runtime.KeepAlive(drawingWand) return mw.getLastErrorIfFailed(ok) } -// Annotates an image with text -// -// x: ordinate to left of text -// -// y: ordinate to text baseline -// -// angle: rotate text relative to this angle +// AnnotateImage Annotates an image with text // +// x: ordinate to left of text +// y: ordinate to text baseline +// angle: rotate text relative to this angle func (mw *MagickWand) AnnotateImage(drawingWand *DrawingWand, x, y, angle float64, text string) error { cstext := C.CString(text) defer C.free(unsafe.Pointer(cstext)) @@ -136,7 +129,7 @@ func (mw *MagickWand) AnnotateImage(drawingWand *DrawingWand, x, y, angle float6 return mw.getLastErrorIfFailed(ok) } -// Animates an image or image sequence +// AnimateImages Animates an image or image sequence func (mw *MagickWand) AnimateImages(server string) error { csserver := C.CString(server) defer C.free(unsafe.Pointer(csserver)) @@ -144,9 +137,9 @@ func (mw *MagickWand) AnimateImages(server string) error { return mw.getLastErrorIfFailed(ok) } -// Append the images in a wand from the current image onwards, creating a new +// AppendImages Append the images in a wand from the current image onwards, creating a new // wand with the single image result. This is affected by the gravity and -// background setting of the first image. Typically you would call either +// background setting of the first image. Typically, you would call either // ResetIterator() or SetFirstImage() before calling this function to ensure // that all the images in the wand's image list will be appended together. // By default, images are stacked left-to-right. Set topToBottom to true to @@ -157,21 +150,21 @@ func (mw *MagickWand) AppendImages(topToBottom bool) *MagickWand { return ret } -// Extracts the 'mean' from the image and adjust the image to try make set -// it's gamma appropriatally +// AutoGammaImage Extracts the 'mean' from the image and adjust the image to try make set +// its gamma appropriately func (mw *MagickWand) AutoGammaImage() error { ok := C.MagickAutoGammaImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Adjust the levels of a particular image by scaling the minimum and maximum +// AutoLevelImage Adjust the levels of a particular image by scaling the minimum and maximum // values to the full quantum range. func (mw *MagickWand) AutoLevelImage() error { ok := C.MagickAutoLevelImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// This is like ThresholdImage() but forces all pixels below the threshold +// BlackThresholdImage This is like ThresholdImage() but forces all pixels below the threshold // into black while leaving all pixels above the threshold unchanged. func (mw *MagickWand) BlackThresholdImage(threshold *PixelWand) error { ok := C.MagickBlackThresholdImage(mw.mw, threshold.pw) @@ -179,28 +172,26 @@ func (mw *MagickWand) BlackThresholdImage(threshold *PixelWand) error { return mw.getLastErrorIfFailed(ok) } -// Mutes the colors of the image to simulate a scene at nighttime in the +// BlueShiftImage Mutes the colors of the image to simulate a scene at nighttime in the // moonlight. func (mw *MagickWand) BlueShiftImage(factor float64) error { ok := C.MagickBlueShiftImage(mw.mw, C.double(factor)) return mw.getLastErrorIfFailed(ok) } -// Blurs an image. We convolve the image with a gaussian operator of the +// BlurImage Blurs an image. We convolve the image with a gaussian operator of the // given radius and standard deviation (sigma). For reasonable results, the // radius should be larger than sigma. Use a radius of 0 and BlurImage() // selects a suitable radius for you. // -// radius: the radius of the, in pixels, not counting the center pixel. -// -// sigma: the standard deviation of the, in pixels -// +// radius: the radius of the blur, in pixels, not counting the center pixel. +// sigma: the standard deviation of the blur, in pixels func (mw *MagickWand) BlurImage(radius, sigma float64) error { ok := C.MagickBlurImage(mw.mw, C.double(radius), C.double(sigma)) return mw.getLastErrorIfFailed(ok) } -// Surrounds the image with a border of the color defined by the bordercolor +// BorderImage Surrounds the image with a border of the color defined by the bordercolor // pixel wand. func (mw *MagickWand) BorderImage(borderColor *PixelWand, width, height uint, compose CompositeOperator) error { @@ -212,61 +203,55 @@ func (mw *MagickWand) BorderImage(borderColor *PixelWand, width, height uint, return mw.getLastErrorIfFailed(ok) } -// Use this to change the brightness and/or contrast of an image. It converts +// BrightnessContrastImage Use this to change the brightness and/or contrast of an image. It converts // the brightness and contrast. // -// brighness: the brightness percent (-100 .. 100) -// -// contrast: the brightness percent (-100 .. 100) -// +// brightness: the brightness percent (-100 .. 100) +// contrast: the brightness percent (-100 .. 100) func (mw *MagickWand) BrightnessContrastImage(brightness, contrast float64) error { ok := C.MagickBrightnessContrastImage(mw.mw, C.double(brightness), C.double(contrast)) return mw.getLastErrorIfFailed(ok) } -// Simulates a charcoal drawing -// -// radius: the radius of the Gaussian, in pixels, not counting the center pixel -// -// sigma: the standard deviation of the Gaussian, in pixels +// CharcoalImage Simulates a charcoal drawing // +// radius: the radius of the Gaussian, in pixels, not counting the center pixel +// sigma: the standard deviation of the Gaussian, in pixels func (mw *MagickWand) CharcoalImage(radius, sigma float64) error { ok := C.MagickCharcoalImage(mw.mw, C.double(radius), C.double(sigma)) return mw.getLastErrorIfFailed(ok) } -// Removes a region of an image and collapses the image to occupy the removed +// ChopImage Removes a region of an image and collapses the image to occupy the removed // portion. // -// width, height: the region width and height -// -// x, y: the region x and y offsets -// +// width, height: the region width and height +// x, y: the region x and y offsets func (mw *MagickWand) ChopImage(width, height uint, x, y int) error { ok := C.MagickChopImage(mw.mw, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y)) return mw.getLastErrorIfFailed(ok) } -// Restricts the color range from 0 to the quantum depth +// ClampImage Restricts the color range from 0 to the quantum depth func (mw *MagickWand) ClampImage() error { ok := C.MagickClampImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Clips along the first path from the 8BIM profile, if present +// ClipImage Clips along the first path from the 8BIM profile, if present func (mw *MagickWand) ClipImage() error { ok := C.MagickClipImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Clips along the named paths from the 8BOM profile, if present. Later +// ClipImagePath Clips along the named paths from the 8BOM profile, if present. Later // operations take effect inside the path. Id may be a number if preceded with // #, to work on a numbered path, e.g. "#1" to use the first path. // pathname: name of clipping path resource. If name is preceded by #, use // clipping path numbered by name. // -// inside: if true, later operations take effect inside clipping path. Otherwise -// later operations take effect outside clipping path. +// inside: if true, later operations take effect inside clipping path. +// Otherwise, later operations take effect outside clipping path. func (mw *MagickWand) ClipImagePath(pathname string, inside bool) error { cspathname := C.CString(pathname) defer C.free(unsafe.Pointer(cspathname)) @@ -274,14 +259,14 @@ func (mw *MagickWand) ClipImagePath(pathname string, inside bool) error { return mw.getLastErrorIfFailed(ok) } -// Replaces colors in the image from a color lookup table +// ClutImage Replaces colors in the image from a color lookup table func (mw *MagickWand) ClutImage(clut *MagickWand, interp PixelInterpolateMethod) error { ok := C.MagickClutImage(mw.mw, clut.mw, C.PixelInterpolateMethod(interp)) runtime.KeepAlive(clut) return mw.getLastErrorIfFailed(ok) } -// Composites a set of images while respecting any page offsets and disposal +// CoalesceImages Composites a set of images while respecting any page offsets and disposal // methods. GIF, MIFF, and MNG animation sequences typically start with an // image background and each subsequent image varies in size and offset. // CoalesceImages() returns a new sequence where each image in the sequence @@ -291,23 +276,22 @@ func (mw *MagickWand) CoalesceImages() *MagickWand { return newMagickWand(C.MagickCoalesceImages(mw.mw)) } -// Accepts a lightweight Color Correction Collection (CCC) file which solely +// ColorDecisionListImage Accepts a lightweight Color Correction Collection (CCC) file which solely // contains one or more color corrections and applies the color correction to // the image. Here is a sample CCC file content: // -// -// -// -// 0.9 1.2 0.5 -// 0.4 -0.5 0.6 -// 1.0 0.8 1.5 -// -// -// 0.85 -// -// -// -// +// +// +// +// 0.9 1.2 0.5 +// 0.4 -0.5 0.6 +// 1.0 0.8 1.5 +// +// +// 0.85 +// +// +// func (mw *MagickWand) ColorDecisionListImage(cccXML string) error { cscccXML := C.CString(cccXML) defer C.free(unsafe.Pointer(cscccXML)) @@ -315,7 +299,7 @@ func (mw *MagickWand) ColorDecisionListImage(cccXML string) error { return mw.getLastErrorIfFailed(ok) } -// Blends the fill color with each pixel in the image +// ColorizeImage Blends the fill color with each pixel in the image func (mw *MagickWand) ColorizeImage(colorize, opacity *PixelWand) error { ok := C.MagickColorizeImage(mw.mw, colorize.pw, opacity.pw) runtime.KeepAlive(colorize) @@ -323,7 +307,7 @@ func (mw *MagickWand) ColorizeImage(colorize, opacity *PixelWand) error { return mw.getLastErrorIfFailed(ok) } -// Apply color transformation to an image. The method permits saturation +// ColorMatrixImage Apply color transformation to an image. The method permits saturation // changes, hue rotation, luminance to alpha, and various other effects. // Although variable-sized transformation matrices can be used, typically one // uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with @@ -336,7 +320,7 @@ func (mw *MagickWand) ColorMatrixImage(colorMatrix *KernelInfo) error { return mw.getLastErrorIfFailed(ok) } -// Combines one or more images into a single image. The grayscale value of +// CombineImages Combines one or more images into a single image. The grayscale value of // the pixels of each image in the sequence is assigned in order to the // specified channels of the combined image. The typical ordering would be // image 1 => Red, 2 => Green, 3 => Blue, etc. @@ -346,7 +330,7 @@ func (mw *MagickWand) CombineImages(cs ColorspaceType) *MagickWand { return ret } -// Adds a comment to your image +// CommentImage Adds a comment to your image func (mw *MagickWand) CommentImage(comment string) error { cscomment := C.CString(comment) defer C.free(unsafe.Pointer(cscomment)) @@ -354,13 +338,13 @@ func (mw *MagickWand) CommentImage(comment string) error { return mw.getLastErrorIfFailed(ok) } -// Compares each image with the next in a sequence and returns the maximum +// CompareImagesLayers Compares each image with the next in a sequence and returns the maximum // bounding region of any pixel differences it discovers. func (mw *MagickWand) CompareImagesLayers(method LayerMethod) *MagickWand { return newMagickWand(C.MagickCompareImagesLayers(mw.mw, C.LayerMethod(method))) } -// CompareImages() compares an image to a reconstructed image and returns the +// CompareImages CompareImages() compares an image to a reconstructed image and returns the // specified difference image. Returns the new MagickWand and the computed // distortion between the images func (mw *MagickWand) CompareImages(reference *MagickWand, metric MetricType) (wand *MagickWand, distortion float64) { @@ -371,15 +355,13 @@ func (mw *MagickWand) CompareImages(reference *MagickWand, metric MetricType) (w return } -// Composite one image onto another at the specified offset. +// CompositeImage Composite one image onto another at the specified offset. // source: The magick wand holding source image. // compose: This operator affects how the composite is applied to the image. // The default is Over. // -// x: the column offset of the composited image. -// -// y: the row offset of the composited image. -// +// x: the column offset of the composited image. +// y: the row offset of the composited image. func (mw *MagickWand) CompositeImage(source *MagickWand, compose CompositeOperator, clipToSelf bool, x, y int) error { @@ -396,19 +378,18 @@ func (mw *MagickWand) CompositeImage(source *MagickWand, return mw.getLastErrorIfFailed(ok) } -// Composite one image onto another at the specified offset. +// CompositeImageGravity Composite one image onto another at the specified offset. // source: The magick wand holding source image. // compose: This operator affects how the composite is applied to the image. // The default is Over. // gravity : positioning gravity. -// func (mw *MagickWand) CompositeImageGravity(source *MagickWand, compose CompositeOperator, gravity GravityType) error { ok := C.MagickCompositeImageGravity(mw.mw, source.mw, C.CompositeOperator(compose), C.GravityType(gravity)) runtime.KeepAlive(source) return mw.getLastErrorIfFailed(ok) } -// Composite the images in the source wand over the images in the destination +// CompositeLayers Composite the images in the source wand over the images in the destination // wand in sequence, starting with the current image in both lists. Each layer // from the two image lists are composted together until the end of one of the // image lists is reached. The offset of each composition is also adjusted to @@ -417,38 +398,36 @@ func (mw *MagickWand) CompositeImageGravity(source *MagickWand, compose Composit // Composition uses given x and y offsets, as the 'origin' location of the // source images virtual canvas (not the real image) allowing you to compose a // list of 'layer images' into the destination images. This makes it well -// suitable for directly composing 'Clears Frame Animations' or 'Coaleased -// Animations' onto a static or other 'Coaleased Animation' destination image +// suited for directly composing 'Clears Frame Animations' or 'Coalesced +// Animations' onto a static or other 'Coalesced Animation' destination image // list. GIF disposal handling is not looked at. Special case: If one of the // image sequences is the last image (just a single image remaining), that -// image is repeatally composed with all the images in the other image list. +// image is repeatedly composed with all the images in the other image list. // Either the source or destination lists may be the single image, for this // situation. In the case of a single destination image (or last image given), // that image will ve cloned to match the number of images remaining in the -// source image list. This is equivelent to the "-layer Composite" Shell API +// source image list. This is equivalent to the "-layer Composite" Shell API // operator. -// source: the wand holding the source images -// -// compose, x, y: composition arguments // +// source: the wand holding the source images +// compose, x, y: composition arguments func (mw *MagickWand) CompositeLayers(source *MagickWand, compose CompositeOperator, x, y int) error { ok := C.MagickCompositeLayers(mw.mw, source.mw, C.CompositeOperator(compose), C.ssize_t(x), C.ssize_t(y)) runtime.KeepAlive(source) return mw.getLastErrorIfFailed(ok) } -// Enhances the intensity differences between the lighter and darker elements +// ContrastImage Enhances the intensity differences between the lighter and darker elements // of the image. Set sharpen to a value other than 0 to increase the image // contrast otherwise the contrast is reduced. // -// sharpen: increase or decrease image contrast -// +// sharpen: increase or decrease image contrast func (mw *MagickWand) ContrastImage(sharpen bool) error { ok := C.MagickContrastImage(mw.mw, b2i(sharpen)) return mw.getLastErrorIfFailed(ok) } -// Enhances the contrast of a color image by adjusting the pixels color to +// ContrastStretchImage Enhances the contrast of a color image by adjusting the pixels color to // span the entire range of colors available. You can also reduce the // influence of a particular channel with a gamma value of 0. func (mw *MagickWand) ContrastStretchImage(blackPoint, whitePoint float64) error { @@ -456,10 +435,9 @@ func (mw *MagickWand) ContrastStretchImage(blackPoint, whitePoint float64) error return mw.getLastErrorIfFailed(ok) } -// Applies a custom convolution kernel to the image. -// -// kernel: KernelInfo +// ConvolveImage Applies a custom convolution kernel to the image. // +// kernel: KernelInfo func (mw *MagickWand) ConvolveImage(kernel *KernelInfo) error { ok := C.MagickConvolveImage(mw.mw, kernel.info) runtime.KeepAlive(mw) @@ -467,7 +445,7 @@ func (mw *MagickWand) ConvolveImage(kernel *KernelInfo) error { return mw.getLastErrorIfFailed(ok) } -// Extracts a region of the image +// CropImage Extracts a region of the image func (mw *MagickWand) CropImage(width, height uint, x, y int) error { ok := C.MagickCropImage(mw.mw, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y)) runtime.KeepAlive(mw) @@ -516,28 +494,26 @@ func (mw *MagickWand) CropImageToTiles(cropGeom string) error { return nil } -// Displaces an Image's colormap by a given number of positions. If you cycle -// the colormap a number of times you can produce a psychodelic effect. +// CycleColormapImage Displaces an Image's colormap by a given number of positions. If you cycle +// the colormap a number of times you can produce a psychedelic effect. func (mw *MagickWand) CycleColormapImage(displace int) error { ok := C.MagickCycleColormapImage(mw.mw, C.ssize_t(displace)) runtime.KeepAlive(mw) return mw.getLastErrorIfFailed(ok) } -// Adds an image to the wand comprised of the pixel data you supply. The pixel +// ConstituteImage Adds an image to the wand comprised of the pixel data you supply. The pixel // data must be in scanline order top-to-bottom. // -// stype: Define the data type of the pixels. Float and double types are -// expected to be normalized [0..1] otherwise [0..QuantumRange]. -// -// pmap: This string reflects the expected ordering of the pixel array. It can -// be any combination or order of R = red, G = green, B = blue, A = alpha -// (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, -// M = magenta, K = black, I = intensity (for grayscale), P = pad. +// stype: Define the data type of the pixels. Float and double types are +// expected to be normalized [0..1] otherwise [0..QuantumRange]. // -// pixels: This array of values contain the pixel components as defined by the -// type. +// pmap: This string reflects the expected ordering of the pixel array. It can +// be any combination or order of R = red, G = green, B = blue, A = alpha +// (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, +// M = magenta, K = black, I = intensity (for grayscale), P = pad. // +// pixels: This array of values contain the pixel components as defined by the type. func (mw *MagickWand) ConstituteImage(cols, rows uint, pmap string, stype StorageType, pixels interface{}) error { if err := checkColsRows(cols, rows); err != nil { return err @@ -555,7 +531,7 @@ func (mw *MagickWand) ConstituteImage(cols, rows uint, pmap string, stype Storag return mw.getLastErrorIfFailed(ok) } -// Converts cipher pixels to plain pixels +// DecipherImage Converts cipher pixels to plain pixels func (mw *MagickWand) DecipherImage(passphrase string) error { cspassphrase := C.CString(passphrase) defer C.free(unsafe.Pointer(cspassphrase)) @@ -564,32 +540,33 @@ func (mw *MagickWand) DecipherImage(passphrase string) error { return mw.getLastErrorIfFailed(ok) } -// Compares each image with the next in a sequence and returns the maximum -// bouding region of any pixel differences it discovers. +// DeconstructImages Compares each image with the next in a sequence and returns the maximum +// bounding region of any pixel differences it discovers. func (mw *MagickWand) DeconstructImages() *MagickWand { ret := newMagickWand(C.MagickDeconstructImages(mw.mw)) runtime.KeepAlive(mw) return ret } -// Removes skew from the image. Skew is an artifact that occurs in scanned +// DeskewImage Removes skew from the image. Skew is an artifact that occurs in scanned // images because of the camera being misaligned, imperfections in the // scanning or surface, or simply because the paper was not placed completely // flat when scanned. -// threshold: separate background from foreground +// +// threshold: separate background from foreground func (mw *MagickWand) DeskewImage(threshold float64) error { ok := C.MagickDeskewImage(mw.mw, C.double(threshold)) return mw.getLastErrorIfFailed(ok) } -// Reduces the speckle noise in an image while perserving the edges of the +// DespeckleImage Reduces the speckle noise in an image while perserving the edges of the // original image. func (mw *MagickWand) DespeckleImage() error { ok := C.MagickDespeckleImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Dereferences an image, deallocating memory associated with the image if the +// DestroyImage Dereferences an image, deallocating memory associated with the image if the // reference count becomes zero. func (mw *MagickWand) DestroyImage(img *Image) *Image { ret := &Image{C.MagickDestroyImage(img.img)} @@ -598,7 +575,7 @@ func (mw *MagickWand) DestroyImage(img *Image) *Image { return ret } -// Displays and image +// DisplayImage Displays and image func (mw *MagickWand) DisplayImage(server string) error { cstring := C.CString(server) defer C.free(unsafe.Pointer(cstring)) @@ -606,7 +583,7 @@ func (mw *MagickWand) DisplayImage(server string) error { return mw.getLastErrorIfFailed(ok) } -// Displays and image or image sequence +// DisplayImages Displays and image or image sequence func (mw *MagickWand) DisplayImages(server string) error { cstring := C.CString(server) defer C.free(unsafe.Pointer(cstring)) @@ -614,8 +591,8 @@ func (mw *MagickWand) DisplayImages(server string) error { return mw.getLastErrorIfFailed(ok) } -// DistortImage() distorts an image using various distortion methods, by -// mapping color lookups of the source image to a new destination image usally +// DistortImage DistortImage() distorts an image using various distortion methods, by +// mapping color lookups of the source image to a new destination image usually // of the same size as the source image, unless 'bestfit' is set to true. If // 'bestfit' is enabled, and distortion allows it, the destination image is // adjusted to ensure the whole source 'image' will just fit within the final @@ -626,56 +603,51 @@ func (mw *MagickWand) DisplayImages(server string) error { // method: the method of image distortion. ArcDistortion always ignores the // source image offset, and always 'bestfit' the destination image with the // top left corner offset relative to the polar mapping center. Bilinear has -// no simple inverse mapping so it does not allow 'bestfit' style of image +// no simple inverse mapping, so it does not allow 'bestfit' style of image // distortion. Affine, Perspective, and Bilinear, do least squares fitting of // the distortion when more than the minimum number of control point pairs are // provided. Perspective, and Bilinear, falls back to a Affine distortion when -// less that 4 control point pairs are provided. While Affine distortions let +// less than 4 control point pairs are provided. While Affine distortions let // you use any number of control point pairs, that is Zero pairs is a no-Op // (viewport only) distortion, one pair is a translation and two pairs of // control points do a scale-rotate-translate, without any shearing. // -// args: the arguments for this distortion method. -// -// bestfit: Attempt to resize destination to fit distorted source. -// +// args: the arguments for this distortion method. +// bestfit: Attempt to resize destination to fit distorted source. func (mw *MagickWand) DistortImage(method DistortImageMethod, args []float64, bestfit bool) error { ok := C.MagickDistortImage(mw.mw, C.DistortMethod(method), C.size_t(len(args)), (*C.double)(&args[0]), b2i(bestfit)) return mw.getLastErrorIfFailed(ok) } -// Renders the drawing wand on the current image +// DrawImage Renders the drawing wand on the current image func (mw *MagickWand) DrawImage(drawingWand *DrawingWand) error { ok := C.MagickDrawImage(mw.mw, drawingWand.dw) runtime.KeepAlive(drawingWand) return mw.getLastErrorIfFailed(ok) } -// Enhance edges within the image with a convolution filter of the given +// EdgeImage Enhance edges within the image with a convolution filter of the given // radius. Use a radius of 0 and Edge() selects a suitable radius for you. // -// radius: the radius of the pixel neighborhood -// +// radius: the radius of the pixel neighborhood func (mw *MagickWand) EdgeImage(radius float64) error { ok := C.MagickEdgeImage(mw.mw, C.double(radius)) return mw.getLastErrorIfFailed(ok) } -// Returns a grayscale image with a three-dimensional effect. We convolve the +// EmbossImage Returns a grayscale image with a three-dimensional effect. We convolve the // image with a Gaussian operator of the given radius and standard deviation // (sigma). For reasonable results, radius should be larger than sigma. Use a // radius of 0 and Emboss() selects a suitable radius for you. // -// radius: the radius of the Gaussian, in pixels, not counting the center pixel -// -// sigma: the standard deviation of the Gaussian, in pixels -// +// radius: the radius of the Gaussian, in pixels, not counting the center pixel +// sigma: the standard deviation of the Gaussian, in pixels func (mw *MagickWand) EmbossImage(radius, sigma float64) error { ok := C.MagickEmbossImage(mw.mw, C.double(radius), C.double(sigma)) return mw.getLastErrorIfFailed(ok) } -// Converts plain pixels to cipher pixels +// EncipherImage Converts plain pixels to cipher pixels func (mw *MagickWand) EncipherImage(passphrase string) error { cspassphrase := C.CString(passphrase) defer C.free(unsafe.Pointer(cspassphrase)) @@ -683,19 +655,19 @@ func (mw *MagickWand) EncipherImage(passphrase string) error { return mw.getLastErrorIfFailed(ok) } -// Applies a digital filter that improves the quality of a noisy image +// EnhanceImage Applies a digital filter that improves the quality of a noisy image func (mw *MagickWand) EnhanceImage() error { ok := C.MagickEnhanceImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Equalizes the image histogram. +// EqualizeImage Equalizes the image histogram. func (mw *MagickWand) EqualizeImage() error { ok := C.MagickEqualizeImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Applys an arithmetic, relational, or logical expression to an image. +// EvaluateImage Apply an arithmetic, relational, or logical expression to an image. // Use these operators to lighten or darken an image, to increase or // decrease contrast in an image, or to produce the "negative" of an image. func (mw *MagickWand) EvaluateImage(op EvaluateOperator, value float64) error { @@ -703,7 +675,7 @@ func (mw *MagickWand) EvaluateImage(op EvaluateOperator, value float64) error { return mw.getLastErrorIfFailed(ok) } -// Applys an arithmetic, relational, or logical expression to an image. +// EvaluateImages Apply an arithmetic, relational, or logical expression to an image. // Use these operators to lighten or darken an image, to increase or // decrease contrast in an image, or to produce the "negative" of an image. func (mw *MagickWand) EvaluateImages(op EvaluateOperator) error { @@ -711,39 +683,38 @@ func (mw *MagickWand) EvaluateImages(op EvaluateOperator) error { return mw.GetLastError() } -// Extracts pixel data from an image and returns it to you. +// ExportImagePixels Extracts pixel data from an image and returns it to you. // -// x, y, cols, rows: These values define the perimeter of a region of -// pixels you want to extract. +// x, y, cols, rows: These values define the perimeter of a region of +// pixels you want to extract. // -// map: This string reflects the expected ordering of the pixel array. It can -// be any combination or order of R = red, G = green, B = blue, A = alpha -// (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, -// M = magenta, K = black, I = intensity (for grayscale), P = pad. -// -// stype: Define the data type of the pixels. Float and double types are -// expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from -// these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel, LongPixel, -// QuantumPixel, or ShortPixel. +// map: This string reflects the expected ordering of the pixel array. It can +// be any combination or order of R = red, G = green, B = blue, A = alpha +// (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, +// M = magenta, K = black, I = intensity (for grayscale), P = pad. // +// stype: Define the data type of the pixels. Float and double types are +// expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from +// these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel, LongPixel, +// QuantumPixel, or ShortPixel. // // StorageType defines the underlying slice type of the returned interface{}: -// PIXEL_CHAR => []byte -// PIXEL_DOUBLE => []float64 -// PIXEL_FLOAT => []float32 -// PIXEL_SHORT => []int16 -// PIXEL_LONG => []int32 -// PIXEL_LONGLONG => []int64 -// PIXEL_QUANTUM => []int64 // -// Example: +// PIXEL_CHAR => []byte +// PIXEL_DOUBLE => []float64 +// PIXEL_FLOAT => []float32 +// PIXEL_SHORT => []int16 +// PIXEL_LONG => []int32 +// PIXEL_LONGLONG => []int64 +// PIXEL_QUANTUM => []int64 // -// val, err := wand.ExportImagePixels(0, 0, 512, 512, "RGB", PIXEL_FLOAT) -// if err != nil { -// panic(err.Error()) -// } -// floatPixels := val.([]float32) +// Example: // +// val, err := wand.ExportImagePixels(0, 0, 512, 512, "RGB", PIXEL_FLOAT) +// if err != nil { +// panic(err.Error()) +// } +// floatPixels := val.([]float32) func (mw *MagickWand) ExportImagePixels(x, y int, cols, rows uint, pmap string, stype StorageType) (interface{}, error) { if len(pmap) == 0 { @@ -817,38 +788,33 @@ func (mw *MagickWand) ExportImagePixels(x, y int, cols, rows uint, return pixel_iface, mw.getLastErrorIfFailed(ok) } -// Extends the image as defined by the geometry, gravitt, and wand background +// ExtentImage Extends the image as defined by the geometry, gravitt, and wand background // color. Set the (x,y) offset of the geometry to move the original wand // relative to the extended wand. // -// width: the region width. -// -// height: the region height. -// -// x: the region x offset. -// -// y: the region y offset. -// +// width: the region width. +// height: the region height. +// x: the region x offset. +// y: the region y offset. func (mw *MagickWand) ExtentImage(width, height uint, x, y int) error { ok := C.MagickExtentImage(mw.mw, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y)) return mw.getLastErrorIfFailed(ok) } -// Creates a vertical mirror image by reflecting the pixels around the central +// FlipImage Creates a vertical mirror image by reflecting the pixels around the central // x-axis. func (mw *MagickWand) FlipImage() error { ok := C.MagickFlipImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Changes the color value of any pixel that matches target and is an immediate +// FloodfillPaintImage Changes the color value of any pixel that matches target and is an immediate // neighbor. If the method FillToBorderMethod is specified, the color value is // changed for any neighbor pixel that does not match the bordercolor member // of image. // -// fill: the floodfill color pixel wand. -// -// fuzz: By default target must match a particular pixel color exactly. +// fill: the floodfill color pixel wand. +// fuzz: By default target must match a particular pixel color exactly. // // However, in many cases two colors may differ by a small amount. The fuzz // member of image defines how much tolerance is acceptable to consider two @@ -856,12 +822,9 @@ func (mw *MagickWand) FlipImage() error { // intensities of 100 and 102 respectively are now interpreted as the same // color for the purposes of the floodfill. // -// bordercolor: the border color pixel wand. -// -// x, y: the starting location of the operation. -// -// invert: paint any pixel that does not match the target color. -// +// bordercolor: the border color pixel wand. +// x, y: the starting location of the operation. +// invert: paint any pixel that does not match the target color. func (mw *MagickWand) FloodfillPaintImage(fill *PixelWand, fuzz float64, borderColor *PixelWand, x, y int, invert bool) error { ok := C.MagickFloodfillPaintImage(mw.mw, fill.pw, C.double(fuzz), borderColor.pw, C.ssize_t(x), C.ssize_t(y), b2i(invert)) runtime.KeepAlive(fill) @@ -869,41 +832,33 @@ func (mw *MagickWand) FloodfillPaintImage(fill *PixelWand, fuzz float64, borderC return mw.getLastErrorIfFailed(ok) } -// Creates a horizontal mirror image by reflecting the pixels around the +// FlopImage Creates a horizontal mirror image by reflecting the pixels around the // central y-axis. func (mw *MagickWand) FlopImage() error { ok := C.MagickFlopImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Implements the discrete Fourier transform (DFT) of the image either as a +// ForwardFourierTransformImage Implements the discrete Fourier transform (DFT) of the image either as a // magnitude/phase or real/imaginary image pair. // -// magnitude: if true, return as magnitude/phase pair otherwise a -// -// real/imaginary image pair. +// magnitude: if true, return as magnitude/phase pair otherwise a real/imaginary image pair. func (mw *MagickWand) ForwardFourierTransformImage(magnitude bool) error { ok := C.MagickForwardFourierTransformImage(mw.mw, b2i(magnitude)) return mw.getLastErrorIfFailed(ok) } -// Adds a simulated three-dimensional border around the image. The width and +// FrameImage Adds a simulated three-dimensional border around the image. The width and // height specify the border width of the vertical and horizontal sides of the // frame. The inner and outer bevels indicate the width of the inner and outer // shadows of the frame. // -// matteColor: the frame color pixel wand. -// -// width: the border width. -// -// height: the border height. -// -// innerBevel: the inner bevel width. -// -// outerBevel: the outer bevel width. -// -// compose: the composite operator. -// +// matteColor: the frame color pixel wand. +// width: the border width. +// height: the border height. +// innerBevel: the inner bevel width. +// outerBevel: the outer bevel width. +// compose: the composite operator. func (mw *MagickWand) FrameImage(matteColor *PixelWand, width, height uint, innerBevel, outerBevel int, compose CompositeOperator) error { @@ -916,7 +871,7 @@ func (mw *MagickWand) FrameImage(matteColor *PixelWand, width, height uint, return mw.getLastErrorIfFailed(ok) } -// Applys an arithmetic, relational, or logical expression to an image. Use +// FunctionImage Apply an arithmetic, relational, or logical expression to an image. Use // these operators to lighten or darken an image, to increase or decrease // contrast in an image, or to produce the "negative" of an image. func (mw *MagickWand) FunctionImage(function MagickFunction, args []float64) error { @@ -924,7 +879,7 @@ func (mw *MagickWand) FunctionImage(function MagickFunction, args []float64) err return mw.getLastErrorIfFailed(ok) } -// Evaluate expression for each pixel in the image. +// FxImage Evaluate expression for each pixel in the image. func (mw *MagickWand) FxImage(expression string) (fxmw *MagickWand, err error) { csexpression := C.CString(expression) defer C.free(unsafe.Pointer(csexpression)) @@ -933,7 +888,7 @@ func (mw *MagickWand) FxImage(expression string) (fxmw *MagickWand, err error) { return } -// Gamma-corrects an image. The same image viewed on different devices will +// GammaImage Gamma-corrects an image. The same image viewed on different devices will // have perceptual differences in the way the image's intensities are // represented on the screen. Specify individual gamma levels for the red, // green, and blue channels, or adjust all three with the gamma parameter. @@ -944,21 +899,19 @@ func (mw *MagickWand) GammaImage(gamma float64) error { return mw.getLastErrorIfFailed(ok) } -// Blurs an image. We convolve the image with a Gaussian operator of the given +// GaussianBlurImage Blurs an image. We convolve the image with a Gaussian operator of the given // radius and standard deviation (sigma). For reasonable results, the radius // should be larger than sigma. Use a radius of 0 and GaussianBlurImage() // selects a suitable radius for you. // -// radius: the radius of the Gaussian, in pixels, not counting the center pixel. -// -// sigma: the standard deviation of the Gaussian, in pixels. -// +// radius: the radius of the Gaussian, in pixels, not counting the center pixel. +// sigma: the standard deviation of the Gaussian, in pixels. func (mw *MagickWand) GaussianBlurImage(radius, sigma float64) error { ok := C.MagickGaussianBlurImage(mw.mw, C.double(radius), C.double(sigma)) return mw.getLastErrorIfFailed(ok) } -// Gets the image at the current image index. +// GetImage Gets the image at the current image index. func (mw *MagickWand) GetImage() *MagickWand { ret := newMagickWand(C.MagickGetImage(mw.mw)) runtime.KeepAlive(mw) @@ -973,14 +926,14 @@ func (mw *MagickWand) GetImageAlphaChannel() bool { return ret } -// Returns the image background color. +// GetImageBackgroundColor Returns the image background color. func (mw *MagickWand) GetImageBackgroundColor() (bgColor *PixelWand, err error) { cbgcolor := NewPixelWand() ok := C.MagickGetImageBackgroundColor(mw.mw, cbgcolor.pw) return cbgcolor, mw.getLastErrorIfFailed(ok) } -// Implements direct to memory image formats. It returns the image as a blob +// GetImageBlob Implements direct to memory image formats. It returns the image as a blob // (a formatted "file" in memory) and its length, starting from the current // position in the image sequence. Use SetImageFormat() to set the format to // write to the blob (GIF, JPEG, PNG, etc.). Utilize ResetIterator() to ensure @@ -994,7 +947,7 @@ func (mw *MagickWand) GetImageBlob() []byte { return ret } -// Implements direct to memory image formats. It returns the image sequence +// GetImagesBlob Implements direct to memory image formats. It returns the image sequence // as a blob and its length. The format of the image determines the format of // the returned blob (GIF, JPEG, PNG, etc.). To return a different image // format, use SetImageFormat(). Note, some image formats do not permit @@ -1008,14 +961,11 @@ func (mw *MagickWand) GetImagesBlob() []byte { return C.GoBytes(unsafe.Pointer(csblob), C.int(clen)) } -// Returns the chromaticy blue primary point for the image. -// -// x: the chromaticity blue primary x-point. -// -// y: the chromaticity blue primary y-point. -// -// z: the chromaticity blue primary z-point. +// GetImageBluePrimary Returns the chromaticy blue primary point for the image. // +// x: the chromaticity blue primary x-point. +// y: the chromaticity blue primary y-point. +// z: the chromaticity blue primary z-point. func (mw *MagickWand) GetImageBluePrimary() (x, y, z float64, err error) { ok := C.MagickGetImageBluePrimary(mw.mw, (*C.double)(&x), (*C.double)(&y), (*C.double)(&z)) @@ -1023,70 +973,70 @@ func (mw *MagickWand) GetImageBluePrimary() (x, y, z float64, err error) { return } -// Returns the image border color. +// GetImageBorderColor Returns the image border color. func (mw *MagickWand) GetImageBorderColor() (borderColor *PixelWand, err error) { cbc := NewPixelWand() ok := C.MagickGetImageBorderColor(mw.mw, cbc.pw) return cbc, mw.getLastErrorIfFailed(ok) } -// Returns the color of the specified colormap index. +// GetImageColormapColor Returns the color of the specified colormap index. func (mw *MagickWand) GetImageColormapColor(index uint) (color *PixelWand, err error) { cpw := NewPixelWand() ok := C.MagickGetImageColormapColor(mw.mw, C.size_t(index), cpw.pw) return cpw, mw.getLastErrorIfFailed(ok) } -// Gets the number of unique colors in the image. +// GetImageColors Gets the number of unique colors in the image. func (mw *MagickWand) GetImageColors() uint { ret := uint(C.MagickGetImageColors(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image colorspace. +// GetImageColorspace Gets the image colorspace. func (mw *MagickWand) GetImageColorspace() ColorspaceType { ret := ColorspaceType(C.MagickGetImageColorspace(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the composite operator associated with the image. +// GetImageCompose Returns the composite operator associated with the image. func (mw *MagickWand) GetImageCompose() CompositeOperator { ret := CompositeOperator(C.MagickGetImageCompose(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image compression. +// GetImageCompression Gets the image compression. func (mw *MagickWand) GetImageCompression() CompressionType { ret := CompressionType(C.MagickGetImageCompression(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image compression quality. +// GetImageCompressionQuality Gets the image compression quality. func (mw *MagickWand) GetImageCompressionQuality() uint { ret := uint(C.MagickGetImageCompressionQuality(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image delay. +// GetImageDelay Gets the image delay. func (mw *MagickWand) GetImageDelay() uint { ret := uint(C.MagickGetImageDelay(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image depth. +// GetImageDepth Gets the image depth. func (mw *MagickWand) GetImageDepth() uint { ret := uint(C.MagickGetImageDepth(mw.mw)) runtime.KeepAlive(mw) return ret } -// Compares an image to a reconstructed image and returns the specified +// GetImageDistortion Compares an image to a reconstructed image and returns the specified // distortion metric. func (mw *MagickWand) GetImageDistortion(reference *MagickWand, metric MetricType) (distortion float64, err error) { ok := C.MagickGetImageDistortion(mw.mw, reference.mw, C.MetricType(metric), (*C.double)(&distortion)) @@ -1095,28 +1045,28 @@ func (mw *MagickWand) GetImageDistortion(reference *MagickWand, metric MetricTyp return } -// Gets the image disposal method. +// GetImageDispose Gets the image disposal method. func (mw *MagickWand) GetImageDispose() DisposeType { ret := DisposeType(C.MagickGetImageDispose(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image endian. +// GetImageEndian Gets the image endian. func (mw *MagickWand) GetImageEndian() EndianType { ret := EndianType(C.MagickGetImageEndian(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the filename of a particular image in a sequence. +// GetImageFilename Returns the filename of a particular image in a sequence. func (mw *MagickWand) GetImageFilename() string { p := C.MagickGetImageFilename(mw.mw) defer relinquishMemory(unsafe.Pointer(p)) return C.GoString(p) } -// Returns the format of a particular image in a sequence. +// GetImageFormat Returns the format of a particular image in a sequence. func (mw *MagickWand) GetImageFormat() string { p := C.MagickGetImageFormat(mw.mw) runtime.KeepAlive(mw) @@ -1124,35 +1074,32 @@ func (mw *MagickWand) GetImageFormat() string { return C.GoString(p) } -// Gets the image fuzz. +// GetImageFuzz Gets the image fuzz. func (mw *MagickWand) GetImageFuzz() float64 { ret := float64(C.MagickGetImageFuzz(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image gamma. +// GetImageGamma Gets the image gamma. func (mw *MagickWand) GetImageGamma() float64 { ret := float64(C.MagickGetImageGamma(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image gravity. +// GetImageGravity Gets the image gravity. func (mw *MagickWand) GetImageGravity() GravityType { ret := GravityType(C.MagickGetImageGravity(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the chromaticy green primary point. -// -// x: the chromaticity green primary x-point. -// -// y: the chromaticity green primary y-point. -// -// z: the chromaticity green primary z-point. +// GetImageGreenPrimary Returns the chromaticy green primary point. // +// x: the chromaticity green primary x-point. +// y: the chromaticity green primary y-point. +// z: the chromaticity green primary z-point. func (mw *MagickWand) GetImageGreenPrimary() (x, y, z float64, err error) { ok := C.MagickGetImageGreenPrimary(mw.mw, (*C.double)(&x), (*C.double)(&y), (*C.double)(&z)) @@ -1160,17 +1107,17 @@ func (mw *MagickWand) GetImageGreenPrimary() (x, y, z float64, err error) { return } -// Returns the image height. +// GetImageHeight Returns the image height. func (mw *MagickWand) GetImageHeight() uint { ret := uint(C.MagickGetImageHeight(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the image histogram as an array of PixelWand wands. +// GetImageHistogram Returns the image histogram as an array of PixelWand wands. // -// numberColors: the number of unique colors in the image and the number of -// pixel wands returned. +// numberColors: the number of unique colors in the image and the number of +// pixel wands returned. func (mw *MagickWand) GetImageHistogram() (numberColors uint, pws []*PixelWand) { cnc := C.size_t(0) p := C.MagickGetImageHistogram(mw.mw, &cnc) @@ -1189,47 +1136,45 @@ func (mw *MagickWand) GetImageHistogram() (numberColors uint, pws []*PixelWand) return } -// Gets the image interlace scheme. +// GetImageInterlaceScheme Gets the image interlace scheme. func (mw *MagickWand) GetImageInterlaceScheme() InterlaceType { ret := InterlaceType(C.MagickGetImageInterlaceScheme(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the interpolation method for the sepcified image. +// GetImageInterpolateMethod Returns the interpolation method for the sepcified image. func (mw *MagickWand) GetImageInterpolateMethod() PixelInterpolateMethod { ret := PixelInterpolateMethod(C.MagickGetImageInterpolateMethod(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image iterations. +// GetImageIterations Gets the image iterations. func (mw *MagickWand) GetImageIterations() uint { ret := uint(C.MagickGetImageIterations(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the image length in bytes. +// GetImageLength Returns the image length in bytes. func (mw *MagickWand) GetImageLength() (length uint, err error) { cl := C.MagickSizeType(0) ok := C.MagickGetImageLength(mw.mw, &cl) return uint(cl), mw.getLastErrorIfFailed(ok) } -// Returns the image orientation. +// GetImageOrientation Returns the image orientation. func (mw *MagickWand) GetImageOrientation() OrientationType { ret := OrientationType(C.MagickGetImageOrientation(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the page geometry associated with the image. -// -// w, h: the page width and height -// -// x, h: the page x-offset and y-offset. +// GetImagePage Returns the page geometry associated with the image. // +// w, h: the page width and height +// x, h: the page x-offset and y-offset. func (mw *MagickWand) GetImagePage() (w, h uint, x, y int, err error) { var cw, ch C.size_t var cx, cy C.ssize_t @@ -1237,52 +1182,51 @@ func (mw *MagickWand) GetImagePage() (w, h uint, x, y int, err error) { return uint(cw), uint(ch), int(cx), int(cy), mw.getLastErrorIfFailed(ok) } -// Returns the color of the specified pixel. +// GetImagePixelColor Returns the color of the specified pixel. func (mw *MagickWand) GetImagePixelColor(x, y int) (color *PixelWand, err error) { pw := NewPixelWand() ok := C.MagickGetImagePixelColor(mw.mw, C.ssize_t(x), C.ssize_t(y), pw.pw) return pw, mw.getLastErrorIfFailed(ok) } -// Returns the chromaticy red primary point. +// GetImageRedPrimary Returns the chromaticy red primary point. // // x, y, z: the chromaticity red primary x/y/z-point. -// func (mw *MagickWand) GetImageRedPrimary() (x, y, z float64, err error) { var cdx, cdy, cdz C.double ok := C.MagickGetImageRedPrimary(mw.mw, &cdx, &cdy, &cdz) return float64(cdx), float64(cdy), float64(cdz), mw.getLastErrorIfFailed(ok) } -// Extracts a region of the image and returns it as a a new wand. +// GetImageRegion Extracts a region of the image and returns it as a a new wand. func (mw *MagickWand) GetImageRegion(width uint, height uint, x int, y int) *MagickWand { ret := newMagickWand(C.MagickGetImageRegion(mw.mw, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y))) runtime.KeepAlive(mw) return ret } -// Gets the image rendering intent. +// GetImageRenderingIntent Gets the image rendering intent. func (mw *MagickWand) GetImageRenderingIntent() RenderingIntent { ret := RenderingIntent(C.MagickGetImageRenderingIntent(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image X and Y resolution. +// GetImageResolution Gets the image X and Y resolution. func (mw *MagickWand) GetImageResolution() (x, y float64, err error) { var dx, dy C.double ok := C.MagickGetImageResolution(mw.mw, &dx, &dy) return float64(dx), float64(dy), mw.getLastErrorIfFailed(ok) } -// Gets the image scene. +// GetImageScene Gets the image scene. func (mw *MagickWand) GetImageScene() uint { ret := uint(C.MagickGetImageScene(mw.mw)) runtime.KeepAlive(mw) return ret } -// Generates an SHA-256 message digest for the image pixel stream. +// GetImageSignature Generates an SHA-256 message digest for the image pixel stream. func (mw *MagickWand) GetImageSignature() string { p := C.MagickGetImageSignature(mw.mw) defer relinquishMemory(unsafe.Pointer(p)) @@ -1290,14 +1234,14 @@ func (mw *MagickWand) GetImageSignature() string { return C.GoString(p) } -// Gets the image ticks-per-second. +// GetImageTicksPerSecond Gets the image ticks-per-second. func (mw *MagickWand) GetImageTicksPerSecond() uint { ret := uint(C.MagickGetImageTicksPerSecond(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the potential image type +// GetImageType Gets the potential image type // To ensure the image type matches its potential, use SetImageType(): // wand.SetImageType(wand.GetImageType()) func (mw *MagickWand) GetImageType() ImageType { @@ -1306,24 +1250,23 @@ func (mw *MagickWand) GetImageType() ImageType { return ret } -// Gets the image units of resolution. +// GetImageUnits Gets the image units of resolution. func (mw *MagickWand) GetImageUnits() ResolutionType { ret := ResolutionType(C.MagickGetImageUnits(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the virtual pixel method for the specified image. +// GetImageVirtualPixelMethod Returns the virtual pixel method for the specified image. func (mw *MagickWand) GetImageVirtualPixelMethod() VirtualPixelMethod { ret := VirtualPixelMethod(C.MagickGetImageVirtualPixelMethod(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the chromaticy white point. -// -// x, y, z: the chromaticity white x/y-point. +// GetImageWhitePoint Returns the chromaticy white point. // +// x, y, z: the chromaticity white x/y-point. func (mw *MagickWand) GetImageWhitePoint() (x, y, z float64, err error) { ok := C.MagickGetImageWhitePoint(mw.mw, (*C.double)(&x), (*C.double)(&y), (*C.double)(&z)) @@ -1331,28 +1274,28 @@ func (mw *MagickWand) GetImageWhitePoint() (x, y, z float64, err error) { return } -// Returns the image width. +// GetImageWidth Returns the image width. func (mw *MagickWand) GetImageWidth() uint { ret := uint(C.MagickGetImageWidth(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the number of images associated with a magick wand. +// GetNumberImages Returns the number of images associated with a magick wand. func (mw *MagickWand) GetNumberImages() uint { ret := uint(C.MagickGetNumberImages(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image total ink density. +// GetImageTotalInkDensity Gets the image total ink density. func (mw *MagickWand) GetImageTotalInkDensity() float64 { ret := float64(C.MagickGetImageTotalInkDensity(mw.mw)) runtime.KeepAlive(mw) return ret } -// Applies a continuously smooth color transition along a vector +// GradientImage Applies a continuously smooth color transition along a vector // from one color stop to another. func (mw *MagickWand) GradientImage(gradientType GradientType, spreadMethod SpreadMethod, colorStops []StopInfo) error { @@ -1385,7 +1328,7 @@ func (mw *MagickWand) GradientImage(gradientType GradientType, spreadMethod Spre return nil } -// Replaces colors in the image from a Hald color lookup table. A Hald color +// HaldClutImage Replaces colors in the image from a Hald color lookup table. A Hald color // lookup table is a 3-dimensional color cube mapped to 2 dimensions. Create // it with the HALD coder. You can apply any color transformation to the Hald // image and then use this method to apply the transform to the image. @@ -1394,7 +1337,7 @@ func (mw *MagickWand) HaldClutImage(hald *MagickWand) error { return mw.getLastErrorIfFailed(ok) } -// Returns true if the wand has more images when traversing the list in the +// HasNextImage Returns true if the wand has more images when traversing the list in the // forward direction func (mw *MagickWand) HasNextImage() bool { ret := 1 == C.MagickHasNextImage(mw.mw) @@ -1402,7 +1345,7 @@ func (mw *MagickWand) HasNextImage() bool { return ret } -// Returns true if the wand has more images when traversing the list in the +// HasPreviousImage Returns true if the wand has more images when traversing the list in the // reverse direction func (mw *MagickWand) HasPreviousImage() bool { ret := 1 == C.MagickHasPreviousImage(mw.mw) @@ -1410,7 +1353,7 @@ func (mw *MagickWand) HasPreviousImage() bool { return ret } -// Identifies an image by printing its attributes to the file. Attributes +// IdentifyImage Identifies an image by printing its attributes to the file. Attributes // include the image width, height, size, and others. func (mw *MagickWand) IdentifyImage() string { p := C.MagickIdentifyImage(mw.mw) @@ -1419,13 +1362,11 @@ func (mw *MagickWand) IdentifyImage() string { return C.GoString(p) } -// Creates a new image that is a copy of an existing one with the image pixels +// ImplodeImage Creates a new image that is a copy of an existing one with the image pixels // "implode" by the specified percentage. // -// radius: Define the extent of the implosion. -// -// method: the pixel interpolation method. -// +// radius: Define the extent of the implosion. +// method: the pixel interpolation method. func (mw *MagickWand) ImplodeImage(radius float64, method PixelInterpolateMethod) error { ok := C.MagickImplodeImage(mw.mw, C.double(radius), C.PixelInterpolateMethod(method)) return mw.getLastErrorIfFailed(ok) @@ -1476,36 +1417,35 @@ func pixelInterfaceToPtr(pixels interface{}) (unsafe.Pointer, StorageType, error return ptr, stype, nil } -// Accepts pixel data and stores it in the image at the location you specify. +// ImportImagePixels Accepts pixel data and stores it in the image at the location you specify. // The pixel data can be either byte, int16, int32, int64, float32, or float64 // in the order specified by map. Suppose your want to upload the first // scanline of a 640x480 image from character data in red-green-blue order: // -// wand.ImportImagePixels(0, 0, 640, 1, "RGB", PIXEL_CHAR, pixels) +// wand.ImportImagePixels(0, 0, 640, 1, "RGB", PIXEL_CHAR, pixels) // // x, y, cols, rows: These values define the perimeter of a region of pixels // you want to define. // -// pmap: This string reflects the expected ordering of the pixel array. It can -// be any combination or order of R = red, G = green, B = blue, A = alpha (0 -// is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, -// M = magenta, K = black, I = intensity (for grayscale), P = pad. -// -// stype: Define the data type of the pixels. Float and double types are -// expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from -// these types: -// -// PIXEL_CHAR -// PIXEL_SHORT -// PIXEL_INTEGER -// PIXEL_LONG -// PIXEL_FLOAT -// PIXEL_DOUBLE -// -// pixels: This slice of values contain the pixel components as defined by map -// and type. You must pre-allocate this slice where the expected length varies -// depending on the values of width, height, map, and type. -// +// pmap: This string reflects the expected ordering of the pixel array. It can +// be any combination or order of R = red, G = green, B = blue, A = alpha (0 +// is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, +// M = magenta, K = black, I = intensity (for grayscale), P = pad. +// +// stype: Define the data type of the pixels. Float and double types are +// expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from +// these types: +// +// PIXEL_CHAR +// PIXEL_SHORT +// PIXEL_INTEGER +// PIXEL_LONG +// PIXEL_FLOAT +// PIXEL_DOUBLE +// +// pixels: This slice of values contain the pixel components as defined by map +// and type. You must pre-allocate this slice where the expected length varies +// depending on the values of width, height, map, and type. func (mw *MagickWand) ImportImagePixels(x, y int, cols, rows uint, pmap string, stype StorageType, pixels interface{}) error { @@ -1532,22 +1472,18 @@ func (mw *MagickWand) ImportImagePixels(x, y int, cols, rows uint, pmap string, return mw.getLastErrorIfFailed(ok) } -// Implements the inverse discrete Fourier transform (DFT) of the image either +// InverseFourierTransformImage Implements the inverse discrete Fourier transform (DFT) of the image either // as a magnitude/phase or real/imaginary image pair. // -// magnitudeWand: the magnitude or real wand. -// -// phaseWand: the phase or imaginary wand. -// -// magnitude: if true, return as magnitude/phase pair otherwise a -// real/imaginary image pair. -// +// magnitudeWand: the magnitude or real wand. +// phaseWand: the phase or imaginary wand. +// magnitude: if true, return as magnitude/phase pair otherwise a real/imaginary image pair. func (mw *MagickWand) InverseFourierTransformImage(phaseWand *MagickWand, magnitude bool) error { ok := C.MagickInverseFourierTransformImage(mw.mw, phaseWand.mw, b2i(magnitude)) return mw.getLastErrorIfFailed(ok) } -// Adds a label to your image. +// LabelImage Adds a label to your image. func (mw *MagickWand) LabelImage(label string) error { cslabel := C.CString(label) defer C.free(unsafe.Pointer(cslabel)) @@ -1555,7 +1491,7 @@ func (mw *MagickWand) LabelImage(label string) error { return mw.getLastErrorIfFailed(ok) } -// Adjusts the levels of an image by scaling the colors falling between +// LevelImage Adjusts the levels of an image by scaling the colors falling between // specified white and black points to the full available quantum range. The // parameters provided represent the black, mid, and white points. The black // point specifies the darkest color in the image. Colors darker than the @@ -1567,21 +1503,18 @@ func (mw *MagickWand) LevelImage(blackPoint, gamma, whitePoint float64) error { return mw.getLastErrorIfFailed(ok) } -// Stretches with saturation the image intensity. You can also reduce the +// LinearStretchImage Stretches with saturation the image intensity. You can also reduce the // influence of a particular channel with a gamma value of 0. func (mw *MagickWand) LinearStretchImage(blackPoint, whitePoint float64) error { ok := C.MagickLinearStretchImage(mw.mw, C.double(blackPoint), C.double(whitePoint)) return mw.getLastErrorIfFailed(ok) } -// Rescales image with seam carving. -// -// cols, rows: the number of cols and rows in the scaled image. -// -// deltaX: maximum seam transversal step (0 means straight seams). -// -// rigidity: introduce a bias for non-straight seams (typically 0). +// LiquidRescaleImage Rescales image with seam carving. // +// cols, rows: the number of cols and rows in the scaled image. +// deltaX: maximum seam transversal step (0 means straight seams). +// rigidity: introduce a bias for non-straight seams (typically 0). func (mw *MagickWand) LiquidRescaleImage(cols, rows uint, deltaX, rigidity float64) error { if err := checkColsRows(cols, rows); err != nil { return err @@ -1590,42 +1523,42 @@ func (mw *MagickWand) LiquidRescaleImage(cols, rows uint, deltaX, rigidity float return mw.getLastErrorIfFailed(ok) } -// This is a convenience method that scales an image proportionally to twice +// MagnifyImage This is a convenience method that scales an image proportionally to twice // its original size. func (mw *MagickWand) MagnifyImage() error { ok := C.MagickMagnifyImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Composes all the image layers from the current given image onward to +// MergeImageLayers Composes all the image layers from the current given image onward to // produce a single image of the merged layers. The inital canvas's size // depends on the given ImageLayerMethod, and is initialized using the first // images background color. The images are then compositied onto that image in // sequence using the given composition that has been assigned to each // individual image. // -// method: the method of selecting the size of the initial canvas. MergeLayer: -// Merge all layers onto a canvas just large enough to hold all the actual -// images. The virtual canvas of the first image is preserved but otherwise -// ignored. FlattenLayer: Use the virtual canvas size of first image. Images -// which fall outside this canvas is clipped. This can be used to 'fill out' -// a given virtual canvas. MosaicLayer: Start with the virtual canvas of the -// first image, enlarging left and right edges to contain all images. Images -// with negative offsets will be clipped. +// method: the method of selecting the size of the initial canvas. MergeLayer: +// Merge all layers onto a canvas just large enough to hold all the actual +// images. The virtual canvas of the first image is preserved but otherwise +// ignored. FlattenLayer: Use the virtual canvas size of first image. Images +// which fall outside this canvas is clipped. This can be used to 'fill out' +// a given virtual canvas. MosaicLayer: Start with the virtual canvas of the +// first image, enlarging left and right edges to contain all images. Images +// with negative offsets will be clipped. func (mw *MagickWand) MergeImageLayers(method LayerMethod) *MagickWand { ret := newMagickWand(C.MagickMergeImageLayers(mw.mw, C.LayerMethod(method))) runtime.KeepAlive(mw) return ret } -// This is a convenience method that scales an image proportionally to +// MinifyImage This is a convenience method that scales an image proportionally to // one-half its original size func (mw *MagickWand) MinifyImage() error { ok := C.MagickMinifyImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Lets you control the brightness, saturation, and hue of an image. Hue is +// ModulateImage Lets you control the brightness, saturation, and hue of an image. Hue is // the percentage of absolute rotation from the current position. For example // 50 results in a counter-clockwise rotation of 90 degrees, 150 results in a // clockwise rotation of 90 degrees, with 0 and 200 both resulting in a @@ -1633,34 +1566,24 @@ func (mw *MagickWand) MinifyImage() error { // decrease the color saturation by 10 and leave the hue unchanged, use: 120, // 90, 100. // -// brightness: the percent change in brighness. -// -// saturation: the percent change in saturation. -// -// hue: the percent change in hue. -// +// brightness: the percent change in brighness. +// saturation: the percent change in saturation. +// hue: the percent change in hue. func (mw *MagickWand) ModulateImage(brightness, saturation, hue float64) error { ok := C.MagickModulateImage(mw.mw, C.double(brightness), C.double(saturation), C.double(hue)) return mw.getLastErrorIfFailed(ok) } -// Creates a composite image by combining several separate images. The images +// MontageImage Creates a composite image by combining several separate images. The images // are tiled on the composite image with the name of the image optionally // appearing just below the individual tile. // -// dw: the drawing wand. The font name, size, and color are obtained from this -// wand. -// -// tileGeo: the number of tiles per row and page (e.g. 6x4+0+0). -// -// thumbGeo: Preferred image size and border size of each thumbnail (e.g. -// 120x120+4+3>). -// -// mode: Thumbnail framing mode: Frame, Unframe, or Concatenate. -// -// frame: Surround the image with an ornamental border (e.g. 15x15+3+3). The -// frame color is that of the thumbnail's matte color. -// +// dw: the drawing wand. The font name, size, and color are obtained from this wand. +// tileGeo: the number of tiles per row and page (e.g. 6x4+0+0). +// thumbGeo: Preferred image size and border size of each thumbnail (e.g. 120x120+4+3>). +// mode: Thumbnail framing mode: Frame, Unframe, or Concatenate. +// frame: Surround the image with an ornamental border (e.g. 15x15+3+3). The +// frame color is that of the thumbnail's matte color. func (mw *MagickWand) MontageImage(dw *DrawingWand, tileGeo string, thumbGeo string, mode MontageMode, frame string) *MagickWand { cstile := C.CString(tileGeo) defer C.free(unsafe.Pointer(cstile)) @@ -1675,70 +1598,63 @@ func (mw *MagickWand) MontageImage(dw *DrawingWand, tileGeo string, thumbGeo str return ret } -// Method morphs a set of images. Both the image pixels and size are linearly +// MorphImages Method morphs a set of images. Both the image pixels and size are linearly // interpolated to give the appearance of a meta-morphosis from one image to // the next. // -// numFrames: the number of in-between images to generate. +// numFrames: the number of in-between images to generate. func (mw *MagickWand) MorphImages(numFrames uint) *MagickWand { ret := newMagickWand(C.MagickMorphImages(mw.mw, C.size_t(numFrames))) runtime.KeepAlive(mw) return ret } -// Applies a user supplied kernel to the image according to the given mophology +// MorphologyImage Applies a user supplied kernel to the image according to the given mophology // method. // -// channel: the image channel(s). -// -// method: the morphology method to be applied. -// -// iterations: apply the operation this many times (or no change). A value of -// -1 means loop until no change found. How this is applied may depend on the -// morphology method. Typically this is a value of 1. -// -// kernel: An array of doubles representing the morphology kernel. +// channel: the image channel(s). +// method: the morphology method to be applied. +// iterations: apply the operation this many times (or no change). A value of +// -1 means loop until no change found. How this is applied may depend on the +// morphology method. Typically this is a value of 1. +// kernel: An array of doubles representing the morphology kernel. func (mw *MagickWand) MorphologyImage(method MorphologyMethod, iterations int, kernel *KernelInfo) error { ok := C.MagickMorphologyImage(mw.mw, C.MorphologyMethod(method), C.ssize_t(iterations), kernel.info) return mw.getLastErrorIfFailed(ok) } -// Simulates motion blur. We convolve the image with a Gaussian operator of +// MotionBlurImage Simulates motion blur. We convolve the image with a Gaussian operator of // the given radius and standard deviation (sigma). For reasonable results, // radius should be larger than sigma. Use a radius of 0 and MotionBlurImage() // selects a suitable radius for you. Angle gives the angle of the blurring // motion. // -// radius: the radius of the Gaussian, in pixels, not counting the center pixel. -// -// sigma: the standard deviation of the Gaussian, in pixels. -// -// angle: apply the effect along this angle. -// +// radius: the radius of the Gaussian, in pixels, not counting the center pixel. +// sigma: the standard deviation of the Gaussian, in pixels. +// angle: apply the effect along this angle. func (mw *MagickWand) MotionBlurImage(radius, sigma, angle float64) error { ok := C.MagickMotionBlurImage(mw.mw, C.double(radius), C.double(sigma), C.double(angle)) return mw.getLastErrorIfFailed(ok) } -// Negates the colors in the reference image. The Grayscale option means that +// NegateImage Negates the colors in the reference image. The Grayscale option means that // only grayscale values within the image are negated. You can also reduce the // influence of a particular channel with a gamma value of 0. // -// gray: If true, only negate grayscale pixels within the image. -// +// gray: If true, only negate grayscale pixels within the image. func (mw *MagickWand) NegateImage(gray bool) error { ok := C.MagickNegateImage(mw.mw, b2i(gray)) return mw.getLastErrorIfFailed(ok) } -// Adds a blank image canvas of the specified size and background color to the +// NewImage Adds a blank image canvas of the specified size and background color to the // wand. func (mw *MagickWand) NewImage(cols uint, rows uint, background *PixelWand) error { ok := C.MagickNewImage(mw.mw, C.size_t(cols), C.size_t(rows), background.pw) return mw.getLastErrorIfFailed(ok) } -// Sets the next image in the wand as the current image. It is typically used +// NextImage Sets the next image in the wand as the current image. It is typically used // after ResetIterator(), after which its first use will set the first image // as the current image (unless the wand is empty). It will return false when // no more images are left to be returned which happens when the wand is empty, @@ -1753,7 +1669,7 @@ func (mw *MagickWand) NextImage() bool { return ret } -// Enhances the contrast of a color image by adjusting the pixels color to +// NormalizeImage Enhances the contrast of a color image by adjusting the pixels color to // span the entire range of colors available. You can also reduce the // influence of a particular channel with a gamma value of 0. func (mw *MagickWand) NormalizeImage() error { @@ -1761,40 +1677,38 @@ func (mw *MagickWand) NormalizeImage() error { return mw.getLastErrorIfFailed(ok) } -// Applies a special effect filter that simulates an oil painting. Each pixel +// OilPaintImage Applies a special effect filter that simulates an oil painting. Each pixel // is replaced by the most frequent color occurring in a circular region // defined by radius. // -// radius: the radius of the circular neighborhood. -// -// sigma: the standard deviation of the Gaussian, in pixels. -// +// radius: the radius of the circular neighborhood. +// sigma: the standard deviation of the Gaussian, in pixels. func (mw *MagickWand) OilPaintImage(radius, sigma float64) error { ok := C.MagickOilPaintImage(mw.mw, C.double(radius), C.double(sigma)) return mw.getLastErrorIfFailed(ok) } -// Changes any pixel that matches color with the color defined by fill. +// OpaquePaintImage Changes any pixel that matches color with the color defined by fill. // -// target: Change this target color to the fill color within the image. +// target: Change this target color to the fill color within the image. // // fill: the fill pixel wand. // // fuzz: By default target must match a particular pixel color exactly. -// However, in many cases two colors may differ by a small amount. The fuzz -// member of image defines how much tolerance is acceptable to consider two -// colors as the same. For example, set fuzz to 10 and the color red at -// intensities of 100 and 102 respectively are now interpreted as the same -// color for the purposes of the floodfill. // -// invert: paint any pixel that does not match the target color. +// However, in many cases two colors may differ by a small amount. The fuzz +// member of image defines how much tolerance is acceptable to consider two +// colors as the same. For example, set fuzz to 10 and the color red at +// intensities of 100 and 102 respectively are now interpreted as the same +// color for the purposes of the floodfill. // +// invert: paint any pixel that does not match the target color. func (mw *MagickWand) OpaquePaintImage(target, fill *PixelWand, fuzz float64, invert bool) error { ok := C.MagickOpaquePaintImage(mw.mw, target.pw, fill.pw, C.double(fuzz), b2i(invert)) return mw.getLastErrorIfFailed(ok) } -// Compares each image the GIF disposed forms of the previous image in the +// OptimizeImageLayers Compares each image the GIF disposed forms of the previous image in the // sequence. From this it attempts to select the smallest cropped image to // replace each frame, while preserving the results of the animation. func (mw *MagickWand) OptimizeImageLayers() *MagickWand { @@ -1803,7 +1717,7 @@ func (mw *MagickWand) OptimizeImageLayers() *MagickWand { return ret } -// Unsupported in ImageMagick 6.7.7 +// OptimizeImageTransparency Unsupported in ImageMagick 6.7.7 // Takes a frame optimized GIF animation, and compares the overlayed pixels // against the disposal image resulting from all the previous frames in the // animation. Any pixel that does not change the disposal image (and thus does @@ -1815,7 +1729,7 @@ func (mw *MagickWand) OptimizeImageTransparency() error { return mw.getLastErrorIfFailed(ok) } -// This is like ReadImage() except the only valid information returned is the +// PingImage This is like ReadImage() except the only valid information returned is the // image width, height, size, and format. It is designed to efficiently obtain // this information from a file without reading the entire image sequence into // memory. @@ -1826,7 +1740,7 @@ func (mw *MagickWand) PingImage(filename string) error { return mw.getLastErrorIfFailed(ok) } -// Pings an image or image sequence from a blob. +// PingImageBlob Pings an image or image sequence from a blob. func (mw *MagickWand) PingImageBlob(blob []byte) error { if len(blob) == 0 { return errors.New("zero-length blob not permitted") @@ -1835,7 +1749,7 @@ func (mw *MagickWand) PingImageBlob(blob []byte) error { return mw.getLastErrorIfFailed(ok) } -// Pings an image or image sequence from an open file descriptor. +// PingImageFile Pings an image or image sequence from an open file descriptor. func (mw *MagickWand) PingImageFile(img *os.File) error { file, err := cfdopen(img, "rb") if err != nil { @@ -1846,14 +1760,11 @@ func (mw *MagickWand) PingImageFile(img *os.File) error { return mw.getLastErrorIfFailed(ok) } -// Simulates a Polaroid picture. -// -// caption: the Polaroid caption. -// -// angle: Apply the effect along this angle. -// -// method: the pixel interpolation method. +// PolaroidImage Simulates a Polaroid picture. // +// caption: the Polaroid caption. +// angle: Apply the effect along this angle. +// method: the pixel interpolation method. func (mw *MagickWand) PolaroidImage(dw *DrawingWand, caption string, angle float64, method PixelInterpolateMethod) error { @@ -1869,20 +1780,19 @@ func (mw *MagickWand) PolaroidImage(dw *DrawingWand, caption string, return mw.getLastErrorIfFailed(ok) } -// Reduces the image to a limited number of color level. -// -// levels: Number of color levels allowed in each channel. Very low values -// (2, 3, or 4) have the most visible effect. +// PosterizeImage Reduces the image to a limited number of color level. // -// dither: choose the dither method: UndefinedDitherMethod, NoDitherMethod, -// RiemersmaDitherMethod, or FloydSteinbergDitherMethod. +// levels: Number of color levels allowed in each channel. Very low values +// (2, 3, or 4) have the most visible effect. // +// dither: choose the dither method: UndefinedDitherMethod, NoDitherMethod, +// RiemersmaDitherMethod, or FloydSteinbergDitherMethod. func (mw *MagickWand) PosterizeImage(levels uint, dither DitherMethod) error { ok := C.MagickPosterizeImage(mw.mw, C.size_t(levels), C.DitherMethod(dither)) return mw.getLastErrorIfFailed(ok) } -// Tiles 9 thumbnails of the specified image with an image processing +// PreviewImages Tiles 9 thumbnails of the specified image with an image processing // operation applied at varying strengths. This helpful to quickly pin-point // an appropriate parameter for an image processing operation. func (mw *MagickWand) PreviewImages(preview PreviewType) *MagickWand { @@ -1891,7 +1801,7 @@ func (mw *MagickWand) PreviewImages(preview PreviewType) *MagickWand { return ret } -// Sets the previous image in the wand as the current image. It is typically +// PreviousImage Sets the previous image in the wand as the current image. It is typically // used after SetLastIterator(), after which its first use will set the last // image as the current image (unless the wand is empty). It will return false // when no more images are left to be returned which happens when the wand is @@ -1907,33 +1817,31 @@ func (mw *MagickWand) PreviousImage() bool { return ret } -// Analyzes the colors within a reference image and chooses a fixed number of +// QuantizeImage Analyzes the colors within a reference image and chooses a fixed number of // colors to represent the image. The goal of the algorithm is to minimize the // color difference between the input and output image while minimizing the // processing time. // -// numColors: the number of colors. -// -// colorspace: Perform color reduction in this colorspace, typically -// RGBColorspace. +// numColors: the number of colors. // -// treedepth: Normally, this integer value is zero or one. A zero or one tells -// Quantize to choose a optimal tree depth of Log4(number_colors). A tree of -// this depth generally allows the best representation of the reference image -// with the least amount of memory and the fastest computational speed. In -// some cases, such as an image with low color dispersion (a few number of -// colors), a value other than Log4(number_colors) is required. To expand the -// color tree completely, use a value of 8. +// colorspace: Perform color reduction in this colorspace, typically RGBColorspace. // -// dither: choose from UndefinedDitherMethod, NoDitherMethod, -// RiemersmaDitherMethod, FloydSteinbergDitherMethod. +// treedepth: Normally, this integer value is zero or one. A zero or one tells +// Quantize to choose a optimal tree depth of Log4(number_colors). A tree of +// this depth generally allows the best representation of the reference image +// with the least amount of memory and the fastest computational speed. In +// some cases, such as an image with low color dispersion (a few number of +// colors), a value other than Log4(number_colors) is required. To expand the +// color tree completely, use a value of 8. // -// measureError: A value other than zero measures the difference between the -// original and quantized images. This difference is the total quantization -// error. The error is computed by summing over all pixels in an image the -// distance squared in RGB space between each reference pixel value and its -// quantized value. +// dither: choose from UndefinedDitherMethod, NoDitherMethod, +// RiemersmaDitherMethod, FloydSteinbergDitherMethod. // +// measureError: A value other than zero measures the difference between the +// original and quantized images. This difference is the total quantization +// error. The error is computed by summing over all pixels in an image the +// distance squared in RGB space between each reference pixel value and its +// quantized value. func (mw *MagickWand) QuantizeImage(numColors uint, colorspace ColorspaceType, treedepth uint, dither DitherMethod, measureError bool) error { @@ -1944,33 +1852,31 @@ func (mw *MagickWand) QuantizeImage(numColors uint, colorspace ColorspaceType, return mw.getLastErrorIfFailed(ok) } -// Analyzes the colors within a sequence of images and chooses a fixed number +// QuantizeImages Analyzes the colors within a sequence of images and chooses a fixed number // of colors to represent the image. The goal of the algorithm is to minimize // the color difference between the input and output image while minimizing the // processing time. // -// numColors: the number of colors. +// numColors: the number of colors. // -// colorspace: Perform color reduction in this colorspace, typically -// RGBColorspace. +// colorspace: Perform color reduction in this colorspace, typically RGBColorspace. // -// treedepth: Normally, this integer value is zero or one. A zero or one tells -// Quantize to choose a optimal tree depth of Log4(number_colors). A tree of -// this depth generally allows the best representation of the reference image -// with the least amount of memory and the fastest computational speed. In -// some cases, such as an image with low color dispersion (a few number of -// colors), a value other than Log4(number_colors) is required. To expand the -// color tree completely, use a value of 8. +// treedepth: Normally, this integer value is zero or one. A zero or one tells +// Quantize to choose a optimal tree depth of Log4(number_colors). A tree of +// this depth generally allows the best representation of the reference image +// with the least amount of memory and the fastest computational speed. In +// some cases, such as an image with low color dispersion (a few number of +// colors), a value other than Log4(number_colors) is required. To expand the +// color tree completely, use a value of 8. // -// dither: choose from these dither methods: NoDitherMethod, -// RiemersmaDitherMethod, or FloydSteinbergDitherMethod. -// -// measureError: A value other than zero measures the difference between the -// original and quantized images. This difference is the total quantization -// error. The error is computed by summing over all pixels in an image the -// distance squared in RGB space between each reference pixel value and its -// quantized value. +// dither: choose from these dither methods: NoDitherMethod, +// RiemersmaDitherMethod, or FloydSteinbergDitherMethod. // +// measureError: A value other than zero measures the difference between the +// original and quantized images. This difference is the total quantization +// error. The error is computed by summing over all pixels in an image the +// distance squared in RGB space between each reference pixel value and its +// quantized value. func (mw *MagickWand) QuantizeImages(numColors uint, colorspace ColorspaceType, treedepth uint, dither DitherMethod, measureError bool) error { @@ -1981,41 +1887,37 @@ func (mw *MagickWand) QuantizeImages(numColors uint, colorspace ColorspaceType, return mw.getLastErrorIfFailed(ok) } -// Radial blurs an image. +// RadialBlurImage Radial blurs an image. // // angle: the angle of the blur in degrees. -// func (mw *MagickWand) RadialBlurImage(angle float64) error { ok := C.MagickRotationalBlurImage(mw.mw, C.double(angle)) return mw.getLastErrorIfFailed(ok) } -// Creates a simulated three-dimensional button-like effect by lightening and +// RaiseImage Creates a simulated three-dimensional button-like effect by lightening and // darkening the edges of the image. Members width and height of raise_info // define the width of the vertical and horizontal edge of the effect. width, // -// height, x, y: Define the dimensions of the area to raise. -// -// raise: A value other than zero creates a 3-D raise effect, otherwise it has -// a lowered effect. +// height, x, y: Define the dimensions of the area to raise. // +// raise: A value other than zero creates a 3-D raise effect, otherwise it has +// a lowered effect. func (mw *MagickWand) RaiseImage(width uint, height uint, x int, y int, raise bool) error { ok := C.MagickRaiseImage(mw.mw, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y), b2i(raise)) return mw.getLastErrorIfFailed(ok) } -// Changes the value of individual pixels based on the intensity of each pixel +// RandomThresholdImage Changes the value of individual pixels based on the intensity of each pixel // compared to threshold. The result is a high-contrast, two color image. // -// low, high: Specify the high and low thresholds. These values range from 0 -// to QuantumRange. -// +// low, high: Specify the high and low thresholds. These values range from 0 to QuantumRange. func (mw *MagickWand) RandomThresholdImage(low, high float64) error { ok := C.MagickRandomThresholdImage(mw.mw, C.double(low), C.double(high)) return mw.getLastErrorIfFailed(ok) } -// Reads an image or image sequence. The images are inserted at the current +// ReadImage Reads an image or image sequence. The images are inserted at the current // image pointer position. Use SetFirstIterator(), SetLastIterator, or // SetImageIndex() to specify the current image pointer position at the // beginning of the image list, the end, or anywhere in-between respectively. @@ -2026,7 +1928,7 @@ func (mw *MagickWand) ReadImage(filename string) error { return mw.getLastErrorIfFailed(ok) } -// Reads an image or image sequence from a blob. +// ReadImageBlob Reads an image or image sequence from a blob. func (mw *MagickWand) ReadImageBlob(blob []byte) error { if len(blob) == 0 { return errors.New("zero-length blob not permitted") @@ -2035,7 +1937,7 @@ func (mw *MagickWand) ReadImageBlob(blob []byte) error { return mw.getLastErrorIfFailed(ok) } -// Reads an image or image sequence from an open file descriptor. +// ReadImageFile Reads an image or image sequence from an open file descriptor. func (mw *MagickWand) ReadImageFile(img *os.File) error { file, err := cfdopen(img, "rb") if err != nil { @@ -2046,34 +1948,31 @@ func (mw *MagickWand) ReadImageFile(img *os.File) error { return mw.getLastErrorIfFailed(ok) } -// Replaces the colors of an image with the closest color from a reference image. -// -// method: choose from these dither methods: NoDitherMethod, RiemersmaDitherMethod, or FloydSteinbergDitherMethod. +// RemapImage Replaces the colors of an image with the closest color from a reference image. // +// method: choose from these dither methods: NoDitherMethod, RiemersmaDitherMethod, or FloydSteinbergDitherMethod. func (mw *MagickWand) RemapImage(remap *MagickWand, method DitherMethod) error { ok := C.MagickRemapImage(mw.mw, remap.mw, C.DitherMethod(method)) runtime.KeepAlive(remap) return mw.getLastErrorIfFailed(ok) } -// Removes an image from the image list. +// RemoveImage Removes an image from the image list. func (mw *MagickWand) RemoveImage() error { ok := C.MagickRemoveImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Resample image to desired resolution. -// -// xRes/yRes: the new image x/y resolution. -// -// filter: Image filter to use. +// ResampleImage Resample image to desired resolution. // +// xRes/yRes: the new image x/y resolution. +// filter: Image filter to use. func (mw *MagickWand) ResampleImage(xRes, yRes float64, filter FilterType) error { ok := C.MagickResampleImage(mw.mw, C.double(xRes), C.double(yRes), C.FilterType(filter)) return mw.getLastErrorIfFailed(ok) } -// Resets the Wand page canvas and position. +// ResetImagePage Resets the Wand page canvas and position. // page: the relative page specification. func (mw *MagickWand) ResetImagePage(page string) error { cspage := C.CString(page) @@ -2082,14 +1981,11 @@ func (mw *MagickWand) ResetImagePage(page string) error { return mw.getLastErrorIfFailed(ok) } -// Scales an image to the desired dimensions -// -// cols: the number of cols in the scaled image. -// -// rows: the number of rows in the scaled image. -// -// filter: Image filter to use. +// ResizeImage Scales an image to the desired dimensions // +// cols: the number of cols in the scaled image. +// rows: the number of rows in the scaled image. +// filter: Image filter to use. func (mw *MagickWand) ResizeImage(cols, rows uint, filter FilterType) error { if err := checkColsRows(cols, rows); err != nil { return err @@ -2098,31 +1994,27 @@ func (mw *MagickWand) ResizeImage(cols, rows uint, filter FilterType) error { return mw.getLastErrorIfFailed(ok) } -// Offsets an image as defined by x and y. -// -// x: the x offset. -// -// y: the y offset. +// RollImage Offsets an image as defined by x and y. // +// x: the x offset. +// y: the y offset. func (mw *MagickWand) RollImage(x, y int) error { ok := C.MagickRollImage(mw.mw, C.ssize_t(x), C.ssize_t(y)) return mw.getLastErrorIfFailed(ok) } -// Rotates an image the specified number of degrees. Empty triangles left over +// RotateImage Rotates an image the specified number of degrees. Empty triangles left over // from rotating the image are filled with the background color. // -// background: the background pixel wand. -// -// degrees: the number of degrees to rotate the image. -// +// background: the background pixel wand. +// degrees: the number of degrees to rotate the image. func (mw *MagickWand) RotateImage(background *PixelWand, degrees float64) error { ok := C.MagickRotateImage(mw.mw, background.pw, C.double(degrees)) runtime.KeepAlive(background) return mw.getLastErrorIfFailed(ok) } -// Scales an image to the desired dimensions with pixel sampling. Unlike other +// SampleImage Scales an image to the desired dimensions with pixel sampling. Unlike other // scaling methods, this method does not introduce any additional color into // the scaled image. func (mw *MagickWand) SampleImage(cols, rows uint) error { @@ -2133,7 +2025,7 @@ func (mw *MagickWand) SampleImage(cols, rows uint) error { return mw.getLastErrorIfFailed(ok) } -// Scales the size of an image to the given dimensions. +// ScaleImage Scales the size of an image to the given dimensions. func (mw *MagickWand) ScaleImage(cols, rows uint) error { if err := checkColsRows(cols, rows); err != nil { return err @@ -2142,53 +2034,46 @@ func (mw *MagickWand) ScaleImage(cols, rows uint) error { return mw.getLastErrorIfFailed(ok) } -// Segments an image by analyzing the histograms of the color components and +// SegmentImage Segments an image by analyzing the histograms of the color components and // identifying units that are homogeneous with the fuzzy C-means technique. // -// verbose: set to true to print detailed information about the identified -// classes. -// -// clusterThreshold: this represents the minimum number of pixels contained in -// a hexahedra before it can be considered valid (expressed as a percentage). +// verbose: set to true to print detailed information about the identified classes. // -// smoothThreshold: the smoothing threshold eliminates noise in the second -// derivative of the histogram. As the value is increased, you can expect a -// smoother second derivative. +// clusterThreshold: this represents the minimum number of pixels contained in +// a hexahedra before it can be considered valid (expressed as a percentage). // +// smoothThreshold: the smoothing threshold eliminates noise in the second +// derivative of the histogram. As the value is increased, you can expect a +// smoother second derivative. func (mw *MagickWand) SegmentImage(colorspace ColorspaceType, verbose bool, clusterThreshold, smoothThreshold float64) error { ok := C.MagickSegmentImage(mw.mw, C.ColorspaceType(colorspace), b2i(verbose), C.double(clusterThreshold), C.double(smoothThreshold)) return mw.getLastErrorIfFailed(ok) } -// Selectively blur an image within a contrast threshold. It is similar to the +// SelectiveBlurImage Selectively blur an image within a contrast threshold. It is similar to the // unsharpen mask that sharpens everything with contrast above a certain // threshold. // -// radius: the radius of the gaussian, in pixels, not counting the center pixel. -// -// sigma: the standard deviation of the gaussian, in pixels. -// -// threshold: only pixels within this contrast threshold are included in the -// blur operation. -// +// radius: the radius of the gaussian, in pixels, not counting the center pixel. +// sigma: the standard deviation of the gaussian, in pixels. +// threshold: only pixels within this contrast threshold are included in the blur operation. func (mw *MagickWand) SelectiveBlurImage(radius, sigma, threshold float64) error { ok := C.MagickSelectiveBlurImage(mw.mw, C.double(radius), C.double(sigma), C.double(threshold)) return mw.getLastErrorIfFailed(ok) } -// Applies a special effect to the image, similar to the effect achieved in a +// SepiaToneImage Applies a special effect to the image, similar to the effect achieved in a // photo darkroom by sepia toning. Threshold ranges from 0 to QuantumRange and // is a measure of the extent of the sepia toning. A threshold of 80 is a good // starting point for a reasonable tone. // -// threshold: Define the extent of the sepia toning. -// +// threshold: Define the extent of the sepia toning. func (mw *MagickWand) SepiaToneImage(threshold float64) error { ok := C.MagickSepiaToneImage(mw.mw, C.double(threshold)) return mw.getLastErrorIfFailed(ok) } -// Replaces the last image returned by SetImageIndex(), NextImage(), +// SetImage Replaces the last image returned by SetImageIndex(), NextImage(), // PreviousImage() with the images from the specified wand. func (mw *MagickWand) SetImage(source *MagickWand) error { ok := C.MagickSetImage(mw.mw, source.mw) @@ -2196,32 +2081,30 @@ func (mw *MagickWand) SetImage(source *MagickWand) error { return mw.getLastErrorIfFailed(ok) } -// Sets the image to the specified alpha level. -// -// alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully -// transparent. +// SetImageAlpha Sets the image to the specified alpha level. // +// alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully transparent. func (mw *MagickWand) SetImageAlpha(alpha float64) error { ok := C.MagickSetImageAlpha(mw.mw, C.double(alpha)) runtime.KeepAlive(mw) return mw.getLastErrorIfFailed(ok) } -// Sets the image background color. +// SetImageBackgroundColor Sets the image background color. func (mw *MagickWand) SetImageBackgroundColor(background *PixelWand) error { ok := C.MagickSetImageBackgroundColor(mw.mw, background.pw) runtime.KeepAlive(background) return mw.getLastErrorIfFailed(ok) } -// Sets the image chromaticity blue primary point. +// SetImageBluePrimary Sets the image chromaticity blue primary point. func (mw *MagickWand) SetImageBluePrimary(x, y, z float64) error { ok := C.MagickSetImageBluePrimary(mw.mw, C.double(x), C.double(y), C.double(z)) return mw.getLastErrorIfFailed(ok) } -// Sets the image border color. +// SetImageBorderColor Sets the image border color. func (mw *MagickWand) SetImageBorderColor(border *PixelWand) error { ok := C.MagickSetImageBorderColor(mw.mw, border.pw) runtime.KeepAlive(border) @@ -2237,7 +2120,7 @@ func (mw *MagickWand) SetImageChannelMask(channel ChannelType) ChannelType { return ChannelType(prevChannel) } -// Set the entire wand canvas to the specified color. +// SetImageColor Set the entire wand canvas to the specified color. func (mw *MagickWand) SetImageColor(color *PixelWand) error { ok := C.MagickSetImageColor(mw.mw, color.pw) runtime.KeepAlive(color) @@ -2250,84 +2133,78 @@ func (mw *MagickWand) SetImageAlphaChannel(operation AlphaChannelType) error { return mw.getLastErrorIfFailed(ok) } -// Sets the color of the specified colormap index. -// -// index: the offset into the image colormap. -// -// color: return the colormap color in this wand. +// SetImageColormapColor Sets the color of the specified colormap index. // +// index: the offset into the image colormap. +// color: return the colormap color in this wand. func (mw *MagickWand) SetImageColormapColor(index uint, color *PixelWand) error { ok := C.MagickSetImageColormapColor(mw.mw, C.size_t(index), color.pw) return mw.getLastErrorIfFailed(ok) } -// Sets the image colorspace. +// SetImageColorspace Sets the image colorspace. func (mw *MagickWand) SetImageColorspace(colorspace ColorspaceType) error { ok := C.MagickSetImageColorspace(mw.mw, C.ColorspaceType(colorspace)) return mw.getLastErrorIfFailed(ok) } -// Sets the image composite operator, useful for specifying how to composite -/// the image thumbnail when using the MontageImage() method. +// SetImageCompose Sets the image composite operator, useful for specifying how to composite +// the image thumbnail when using the MontageImage() method. func (mw *MagickWand) SetImageCompose(compose CompositeOperator) error { ok := C.MagickSetImageCompose(mw.mw, C.CompositeOperator(compose)) return mw.getLastErrorIfFailed(ok) } -// Sets the image compression. +// SetImageCompression Sets the image compression. func (mw *MagickWand) SetImageCompression(compression CompressionType) error { ok := C.MagickSetImageCompression(mw.mw, C.CompressionType(compression)) return mw.getLastErrorIfFailed(ok) } -// Sets the image compression quality. +// SetImageCompressionQuality Sets the image compression quality. func (mw *MagickWand) SetImageCompressionQuality(quality uint) error { ok := C.MagickSetImageCompressionQuality(mw.mw, C.size_t(quality)) return mw.getLastErrorIfFailed(ok) } -// Sets the image delay. -// -// delay: the image delay in ticks-per-second units. +// SetImageDelay Sets the image delay. // +// delay: the image delay in ticks-per-second units. func (mw *MagickWand) SetImageDelay(delay uint) error { ok := C.MagickSetImageDelay(mw.mw, C.size_t(delay)) return mw.getLastErrorIfFailed(ok) } -// Sets the image depth. -// -// depth: the image depth in bits: 8, 16, or 32. +// SetImageDepth Sets the image depth. // +// depth: the image depth in bits: 8, 16, or 32. func (mw *MagickWand) SetImageDepth(depth uint) error { ok := C.MagickSetImageDepth(mw.mw, C.size_t(depth)) return mw.getLastErrorIfFailed(ok) } -// Sets the image disposal method. +// SetImageDispose Sets the image disposal method. func (mw *MagickWand) SetImageDispose(dispose DisposeType) error { ok := C.MagickSetImageDispose(mw.mw, C.DisposeType(dispose)) return mw.getLastErrorIfFailed(ok) } -// Sets the image endian method. +// SetImageEndian Sets the image endian method. func (mw *MagickWand) SetImageEndian(endian EndianType) error { ok := C.MagickSetImageEndian(mw.mw, C.EndianType(endian)) return mw.getLastErrorIfFailed(ok) } -// Sets the image size (i.e. cols & rows). -// -// cols: The image width in pixels. -// -// rows: The image height in pixels. +// SetImageExtent Sets the image size (i.e. cols & rows). // +// cols: The image width in pixels. +// rows: The image height in pixels. func (mw *MagickWand) SetImageExtent(cols, rows uint) error { ok := C.MagickSetImageExtent(mw.mw, C.size_t(cols), C.size_t(rows)) return mw.getLastErrorIfFailed(ok) } -// Sets the filename of a particular image in a sequence. +// SetImageFilename Sets the filename of a particular image in a sequence. func (mw *MagickWand) SetImageFilename(filename string) error { csfilename := C.CString(filename) defer C.free(unsafe.Pointer(csfilename)) @@ -2335,10 +2212,9 @@ func (mw *MagickWand) SetImageFilename(filename string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the format of a particular image in a sequence. -// -// format: the image format. +// SetImageFormat Sets the format of a particular image in a sequence. // +// format: the image format. func (mw *MagickWand) SetImageFormat(format string) error { csformat := C.CString(format) defer C.free(unsafe.Pointer(csformat)) @@ -2346,184 +2222,176 @@ func (mw *MagickWand) SetImageFormat(format string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the image fuzz. +// SetImageFuzz Sets the image fuzz. func (mw *MagickWand) SetImageFuzz(fuzz float64) error { ok := C.MagickSetImageFuzz(mw.mw, C.double(fuzz)) return mw.getLastErrorIfFailed(ok) } -// Sets the image gamma. +// SetImageGamma Sets the image gamma. func (mw *MagickWand) SetImageGamma(gamma float64) error { ok := C.MagickSetImageGamma(mw.mw, C.double(gamma)) return mw.getLastErrorIfFailed(ok) } -// Sets the image gravity type. +// SetImageGravity Sets the image gravity type. func (mw *MagickWand) SetImageGravity(gravity GravityType) error { ok := C.MagickSetImageGravity(mw.mw, C.GravityType(gravity)) return mw.getLastErrorIfFailed(ok) } -// Sets the image chromaticity green primary point. +// SetImageGreenPrimary Sets the image chromaticity green primary point. func (mw *MagickWand) SetImageGreenPrimary(x, y, z float64) error { ok := C.MagickSetImageGreenPrimary(mw.mw, C.double(x), C.double(y), C.double(z)) return mw.getLastErrorIfFailed(ok) } -// Sets the image interlace scheme. +// SetImageInterlaceScheme Sets the image interlace scheme. func (mw *MagickWand) SetImageInterlaceScheme(interlace InterlaceType) error { ok := C.MagickSetImageInterlaceScheme(mw.mw, C.InterlaceType(interlace)) return mw.getLastErrorIfFailed(ok) } -// Sets the image interpolate pixel method. +// SetImageInterpolateMethod Sets the image interpolate pixel method. func (mw *MagickWand) SetImageInterpolateMethod(method PixelInterpolateMethod) error { ok := C.MagickSetImageInterpolateMethod(mw.mw, C.PixelInterpolateMethod(method)) return mw.getLastErrorIfFailed(ok) } -// Sets the image iterations. +// SetImageIterations Sets the image iterations. func (mw *MagickWand) SetImageIterations(iterations uint) error { ok := C.MagickSetImageIterations(mw.mw, C.size_t(iterations)) return mw.getLastErrorIfFailed(ok) } -// Sets the image matte channel. +// SetImageMatte Sets the image matte channel. func (mw *MagickWand) SetImageMatte(matte bool) error { ok := C.MagickSetImageMatte(mw.mw, b2i(matte)) return mw.getLastErrorIfFailed(ok) } -// Sets image clip mask. +// SetImageMask Sets image clip mask. // PixelMaskType can be one of: PIXEL_MASK_READ, PIXEL_MASK_WRITE func (mw *MagickWand) SetImageMask(typ PixelMaskType, clipMask *MagickWand) error { ok := C.MagickSetImageMask(mw.mw, C.PixelMask(typ), clipMask.mw) return mw.getLastErrorIfFailed(ok) } -// Sets the image orientation. +// SetImageOrientation Sets the image orientation. func (mw *MagickWand) SetImageOrientation(orientation OrientationType) error { ok := C.MagickSetImageOrientation(mw.mw, C.OrientationType(orientation)) return mw.getLastErrorIfFailed(ok) } -// Auto orient the image +// AutoOrientImage Auto orient the image func (mw *MagickWand) AutoOrientImage() error { ok := C.MagickAutoOrientImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Sets the page geometry of the image. +// SetImagePage Sets the page geometry of the image. func (mw *MagickWand) SetImagePage(width, height uint, x, y int) error { ok := C.MagickSetImagePage(mw.mw, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y)) return mw.getLastErrorIfFailed(ok) } -// Sets the image chromaticity red primary point. +// SetImageRedPrimary Sets the image chromaticity red primary point. func (mw *MagickWand) SetImageRedPrimary(x, y, z float64) error { ok := C.MagickSetImageRedPrimary(mw.mw, C.double(x), C.double(y), C.double(z)) return mw.getLastErrorIfFailed(ok) } -// Sets the image rendering intent. +// SetImageRenderingIntent Sets the image rendering intent. func (mw *MagickWand) SetImageRenderingIntent(ri RenderingIntent) error { ok := C.MagickSetImageRenderingIntent(mw.mw, C.RenderingIntent(ri)) return mw.getLastErrorIfFailed(ok) } -// Sets the image resolution. +// SetImageResolution Sets the image resolution. func (mw *MagickWand) SetImageResolution(xRes, yRes float64) error { ok := C.MagickSetImageResolution(mw.mw, C.double(xRes), C.double(yRes)) return mw.getLastErrorIfFailed(ok) } -// Sets the image scene. +// SetImageScene Sets the image scene. func (mw *MagickWand) SetImageScene(scene uint) error { ok := C.MagickSetImageScene(mw.mw, C.size_t(scene)) return mw.getLastErrorIfFailed(ok) } -// Sets the image ticks-per-second. +// SetImageTicksPerSecond Sets the image ticks-per-second. func (mw *MagickWand) SetImageTicksPerSecond(tps int) error { ok := C.MagickSetImageTicksPerSecond(mw.mw, C.ssize_t(tps)) return mw.getLastErrorIfFailed(ok) } -// Sets the image type. +// SetImageType Sets the image type. func (mw *MagickWand) SetImageType(imgtype ImageType) error { ok := C.MagickSetImageType(mw.mw, C.ImageType(imgtype)) return mw.getLastErrorIfFailed(ok) } -// Sets the image units of resolution. +// SetImageUnits Sets the image units of resolution. func (mw *MagickWand) SetImageUnits(units ResolutionType) error { ok := C.MagickSetImageUnits(mw.mw, C.ResolutionType(units)) return mw.getLastErrorIfFailed(ok) } -// Sets the image virtual pixel method. +// SetImageVirtualPixelMethod Sets the image virtual pixel method. func (mw *MagickWand) SetImageVirtualPixelMethod(method VirtualPixelMethod) VirtualPixelMethod { return VirtualPixelMethod(C.MagickSetImageVirtualPixelMethod(mw.mw, C.VirtualPixelMethod(method))) } -// Sets the image chromaticity white point. +// SetImageWhitePoint Sets the image chromaticity white point. func (mw *MagickWand) SetImageWhitePoint(x, y, z float64) error { ok := C.MagickSetImageWhitePoint(mw.mw, C.double(x), C.double(y), C.double(z)) return mw.getLastErrorIfFailed(ok) } -// Shines a distant light on an image to create a three-dimensional effect. +// ShadeImage Shines a distant light on an image to create a three-dimensional effect. // You control the positioning of the light with azimuth and elevation; // azimuth is measured in degrees off the x axis and elevation is measured in // pixels above the Z axis. // -// gray: if true, shades the intensity of each pixel. -// -// azimuth, elevation: define the light source direction. -// +// gray: if true, shades the intensity of each pixel. azimuth, elevation: define the light source direction. func (mw *MagickWand) ShadeImage(gray bool, azimuth, elevation float64) error { ok := C.MagickShadeImage(mw.mw, b2i(gray), C.double(azimuth), C.double(elevation)) return mw.getLastErrorIfFailed(ok) } -// Simulates an image shadow. +// ShadowImage Simulates an image shadow. // // opacity: percentage transparency. // -// sigma: the standard deviation of the Gaussian, in pixels. -// -// x: the shadow x-offset. -// -// y: the shadow y-offset. -// +// sigma: the standard deviation of the Gaussian, in pixels. +// x: the shadow x-offset. +// y: the shadow y-offset. func (mw *MagickWand) ShadowImage(opacity, sigma float64, x, y int) error { ok := C.MagickShadowImage(mw.mw, C.double(opacity), C.double(sigma), C.ssize_t(x), C.ssize_t(y)) return mw.getLastErrorIfFailed(ok) } -// Sharpens an image. We convolve the image with a Gaussian operator of the +// SharpenImage Sharpens an image. We convolve the image with a Gaussian operator of the // given radius and standard deviation (sigma). For reasonable results, the // radius should be larger than sigma. Use a radius of 0 and SharpenImage() // selects a suitable radius for you. // -// radius: the radius of the Gaussian, in pixels, not counting the center pixel. -// -// sigma: the standard deviation of the Gaussian, in pixels. -// +// radius: the radius of the Gaussian, in pixels, not counting the center pixel. +// sigma: the standard deviation of the Gaussian, in pixels. func (mw *MagickWand) SharpenImage(radius, sigma float64) error { ok := C.MagickSharpenImage(mw.mw, C.double(radius), C.double(sigma)) return mw.getLastErrorIfFailed(ok) } -// Shaves pixels from the image edges. It allocates the memory necessary for +// ShaveImage Shaves pixels from the image edges. It allocates the memory necessary for // the new Image structure and returns a pointer to the new image. func (mw *MagickWand) ShaveImage(cols, rows uint) error { ok := C.MagickShaveImage(mw.mw, C.size_t(cols), C.size_t(rows)) return mw.getLastErrorIfFailed(ok) } -// Slides one edge of an image along the X or Y axis, creating a parallelogram. +// ShearImage Slides one edge of an image along the X or Y axis, creating a parallelogram. // An X direction shear slides an edge along the X axis, while a Y direction // shear slides an edge along the Y axis. The amount of the shear is controlled // by a shear angle. For X direction shears, xShear is measured relative to the @@ -2536,7 +2404,7 @@ func (mw *MagickWand) ShearImage(background *PixelWand, xShear, yShear float64) return mw.getLastErrorIfFailed(ok) } -// Adjusts the contrast of an image with a non-linear sigmoidal contrast +// SigmoidalContrastImage Adjusts the contrast of an image with a non-linear sigmoidal contrast // algorithm. Increase the contrast of the image using a sigmoidal transfer // function without saturating highlights or shadows. Contrast indicates how // much to increase the contrast (0 is none; 3 is typical; 20 is pushing it); @@ -2544,31 +2412,23 @@ func (mw *MagickWand) ShearImage(background *PixelWand, xShear, yShear float64) // 50 is middle-gray; 100 is black). Set sharpen to true to increase the image // contrast otherwise the contrast is reduced. // -// sharpen: Increase or decrease image contrast. -// -// alpha: strength of the contrast, the larger the number the more -// 'threshold-like' it becomes. -// -// beta: midpoint of the function as a color value 0 to QuantumRange. -// +// sharpen: Increase or decrease image contrast. +// alpha: strength of the contrast, the larger the number the more 'threshold-like' it becomes. +// beta: midpoint of the function as a color value 0 to QuantumRange. func (mw *MagickWand) SigmoidalContrastImage(sharpen bool, alpha, beta float64) error { ok := C.MagickSigmoidalContrastImage(mw.mw, b2i(sharpen), C.double(alpha), C.double(beta)) return mw.getLastErrorIfFailed(ok) } -// Compares the reference image of the image and returns the best match offset. +// SimilarityImage Compares the reference image of the image and returns the best match offset. // In addition, it returns a similarity image such that an exact match location // is completely white and if none of the pixels match, black, otherwise some // gray level in-between. // -// reference: the reference wand. -// -// offset: the best match offset of the reference image within the image. -// -// metric: the metric. -// -// threshold: similarity; minimum distortion for (sub)image match. -// +// reference: the reference wand. +// offset: the best match offset of the reference image within the image. +// metric: the metric. +// threshold: similarity; minimum distortion for (sub)image match. func (mw *MagickWand) SimilarityImage(reference *MagickWand, metric MetricType, threshold float64) (offset *RectangleInfo, similarity float64, area *MagickWand) { @@ -2582,45 +2442,38 @@ func (mw *MagickWand) SimilarityImage(reference *MagickWand, metric MetricType, return &RectangleInfo{&rectInfo}, similarity, newMagickWand(mwarea) } -// Simulates a pencil sketch. We convolve the image with a Gaussian operator +// SketchImage Simulates a pencil sketch. We convolve the image with a Gaussian operator // of the given radius and standard deviation (sigma). For reasonable results, // radius should be larger than sigma. Use a radius of 0 and SketchImage() // selects a suitable radius for you. Angle gives the angle of the blurring // motion. // -// radius: the radius of the Gaussian, in pixels, not counting the center pixel. -// -// sigma: the standard deviation of the Gaussian, in pixels. -// -// angle: Apply the effect along this angle. -// +// radius: the radius of the Gaussian, in pixels, not counting the center pixel. +// sigma: the standard deviation of the Gaussian, in pixels. +// angle: Apply the effect along this angle. func (mw *MagickWand) SketchImage(radius, sigma, angle float64) error { ok := C.MagickSketchImage(mw.mw, C.double(radius), C.double(sigma), C.double(angle)) return mw.getLastErrorIfFailed(ok) } -// Takes all images from the current image pointer to the end of the image +// SmushImages Takes all images from the current image pointer to the end of the image // list and smushs them to each other top-to-bottom if the stack parameter is // true, otherwise left-to-right. // -// stack: by default, images are stacked left-to-right. Set stack to true to -// stack them top-to-bottom. -// -// offset: minimum distance in pixels between images. -// +// stack: by default, images are stacked left-to-right. Set stack to true to stack them top-to-bottom. +// offset: minimum distance in pixels between images. func (mw *MagickWand) SmushImages(stack bool, offset int) *MagickWand { ret := newMagickWand(C.MagickSmushImages(mw.mw, b2i(stack), C.ssize_t(offset))) runtime.KeepAlive(mw) return ret } -// Applies a special effect to the image, similar to the effect achieved in a +// SolarizeImage Applies a special effect to the image, similar to the effect achieved in a // photo darkroom by selectively exposing areas of photo sensitive paper to // light. Threshold ranges from 0 to QuantumRange and is a measure of the // extent of the solarization. // -// threshold: define the extent of the solarization. -// +// threshold: define the extent of the solarization. func (mw *MagickWand) SolarizeImage(threshold float64) error { ok := C.MagickSolarizeImage(mw.mw, C.double(threshold)) return mw.getLastErrorIfFailed(ok) @@ -2632,30 +2485,29 @@ func (mw *MagickWand) SolarizeImage(threshold float64) error { // sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a // measure of the extent of the solarization. // -// threshold: define the extent of the solarization. +// threshold: define the extent of the solarization. // //func (mw *MagickWand) SolarizeImageChannel(channel ChannelType, threshold float64) error { // ok := C.MagickSolarizeImageChannel(mw.mw, C.ChannelType(channel), C.double(threshold)) // return mw.getLastErrorIfFailed(ok) //} -// Given a set of coordinates, interpolates the colors found at those +// SparseColorImage Given a set of coordinates, interpolates the colors found at those // coordinates, across the whole image, using various methods. // -// method: the method of image sparseion. ArcSparseColorion will always ignore -// source image offset, and always 'bestfit' the destination image with the top -// left corner offset relative to the polar mapping center. Bilinear has no -// simple inverse mapping so will not allow 'bestfit' style of image sparseion. -// Affine, Perspective, and Bilinear, will do least squares fitting of the -// distortion when more than the minimum number of control point pairs are -// provided. Perspective, and Bilinear, will fall back to a Affine sparseion -// when less than 4 control point pairs are provided. While Affine sparseions -// will let you use any number of control point pairs, that is Zero pairs is a -// No-Op (viewport only) distortion, one pair is a translation and two pairs -// of control points will do a scale-rotate-translate, without any shearing. -// -// arguments: the arguments for this sparseion method. -// +// method: the method of image sparseion. ArcSparseColorion will always ignore +// source image offset, and always 'bestfit' the destination image with the top +// left corner offset relative to the polar mapping center. Bilinear has no +// simple inverse mapping so will not allow 'bestfit' style of image sparseion. +// Affine, Perspective, and Bilinear, will do least squares fitting of the +// distortion when more than the minimum number of control point pairs are +// provided. Perspective, and Bilinear, will fall back to a Affine sparseion +// when less than 4 control point pairs are provided. While Affine sparseions +// will let you use any number of control point pairs, that is Zero pairs is a +// No-Op (viewport only) distortion, one pair is a translation and two pairs +// of control points will do a scale-rotate-translate, without any shearing. +// +// arguments: the arguments for this sparseion method. func (mw *MagickWand) SparseColorImage(channel ChannelType, method SparseColorMethod, arguments []float64) error { @@ -2665,44 +2517,38 @@ func (mw *MagickWand) SparseColorImage(channel ChannelType, method SparseColorMe return mw.getLastErrorIfFailed(ok) } -// Splices a solid color into the image. +// SpliceImage Splices a solid color into the image. func (mw *MagickWand) SpliceImage(width, height uint, x, y int) error { ok := C.MagickSpliceImage(mw.mw, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y)) return mw.getLastErrorIfFailed(ok) } -// Is a special effects method that randomly displaces each pixel in a block +// SpreadImage Is a special effects method that randomly displaces each pixel in a block // defined by the radius parameter. // -// method: intepolation method. -// -// radius: Choose a random pixel in a neighborhood of this extent. -// +// method: intepolation method. +// radius: Choose a random pixel in a neighborhood of this extent. func (mw *MagickWand) SpreadImage(method PixelInterpolateMethod, radius float64) error { ok := C.MagickSpreadImage(mw.mw, C.PixelInterpolateMethod(method), C.double(radius)) return mw.getLastErrorIfFailed(ok) } -// Replace each pixel with corresponding statistic from the neighborhood of +// StatisticImage Replace each pixel with corresponding statistic from the neighborhood of // the specified width and height. // -// type: the statistic type (e.g. median, mode, etc.). -// -// width: the width of the pixel neighborhood. -// -// height: the height of the pixel neighborhood. -// +// type: the statistic type (e.g. median, mode, etc.). +// width: the width of the pixel neighborhood. +// height: the height of the pixel neighborhood. func (mw *MagickWand) StatisticImage(stype StatisticType, width, height uint) error { ok := C.MagickStatisticImage(mw.mw, C.StatisticType(stype), C.size_t(width), C.size_t(height)) return mw.getLastErrorIfFailed(ok) } -// Hides a digital watermark within the image. Recover the hidden watermark +// SteganoImage Hides a digital watermark within the image. Recover the hidden watermark // later to prove that the authenticity of an image. Offset defines the start // position within the image to hide the watermark. // -// offset: start hiding at this offset into the image. -// +// offset: start hiding at this offset into the image. func (mw *MagickWand) SteganoImage(watermark *MagickWand, offset int) *MagickWand { ret := newMagickWand(C.MagickSteganoImage(mw.mw, watermark.mw, C.ssize_t(offset))) runtime.KeepAlive(mw) @@ -2710,7 +2556,7 @@ func (mw *MagickWand) SteganoImage(watermark *MagickWand, offset int) *MagickWan return ret } -// Composites two images and produces a single image that is the composite of +// StereoImage Composites two images and produces a single image that is the composite of // a left and right image of a stereo pair. func (mw *MagickWand) StereoImage(offset *MagickWand) *MagickWand { ret := newMagickWand(C.MagickStereoImage(mw.mw, offset.mw)) @@ -2719,26 +2565,24 @@ func (mw *MagickWand) StereoImage(offset *MagickWand) *MagickWand { return ret } -// Strips an image of all profiles and comments. +// StripImage Strips an image of all profiles and comments. func (mw *MagickWand) StripImage() error { ok := C.MagickStripImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Swirls the pixels about the center of the image, where degrees indicates the +// SwirlImage Swirls the pixels about the center of the image, where degrees indicates the // sweep of the arc through which each pixel is moved. You get a more dramatic // effect as the degrees move from 1 to 360. // -// degrees: define the tightness of the swirling effect. -// -// method: the pixel interpolation method. -// +// degrees: define the tightness of the swirling effect. +// method: the pixel interpolation method. func (mw *MagickWand) SwirlImage(degrees float64, method PixelInterpolateMethod) error { ok := C.MagickSwirlImage(mw.mw, C.double(degrees), C.PixelInterpolateMethod(method)) return mw.getLastErrorIfFailed(ok) } -// Repeatedly tiles the texture image across and down the image canvas. +// TextureImage Repeatedly tiles the texture image across and down the image canvas. func (mw *MagickWand) TextureImage(texture *MagickWand) *MagickWand { ret := newMagickWand(C.MagickTextureImage(mw.mw, texture.mw)) runtime.KeepAlive(mw) @@ -2746,27 +2590,25 @@ func (mw *MagickWand) TextureImage(texture *MagickWand) *MagickWand { return ret } -// Changes the value of individual pixels based on the intensity of each pixel +// ThresholdImage Changes the value of individual pixels based on the intensity of each pixel // compared to threshold. The result is a high-contrast, two color image. // -// threshold: define the threshold value. -// +// threshold: define the threshold value. func (mw *MagickWand) ThresholdImage(threshold float64) error { ok := C.MagickThresholdImage(mw.mw, C.double(threshold)) return mw.getLastErrorIfFailed(ok) } -// Changes the value of individual pixels based on the intensity of each pixel +// ThresholdImageChannel Changes the value of individual pixels based on the intensity of each pixel // compared to threshold. The result is a high-contrast, two color image. // -// threshold: define the threshold value. -// +// threshold: define the threshold value. func (mw *MagickWand) ThresholdImageChannel(channel ChannelType, threshold float64) error { ok := C.MagickThresholdImageChannel(mw.mw, C.ChannelType(channel), C.double(threshold)) return mw.getLastErrorIfFailed(ok) } -// Changes the size of an image to the given dimensions and removes any +// ThumbnailImage Changes the size of an image to the given dimensions and removes any // associated profiles. The goal is to produce small low cost thumbnail images // suited for display on the Web. func (mw *MagickWand) ThumbnailImage(cols, rows uint) error { @@ -2777,14 +2619,12 @@ func (mw *MagickWand) ThumbnailImage(cols, rows uint) error { return mw.getLastErrorIfFailed(ok) } -// Applies a color vector to each pixel in the image. The length of the vector +// TintImage Applies a color vector to each pixel in the image. The length of the vector // is 0 for black and white and at its maximum for the midtones. The vector // weighting function is f(x)=(1-(4.0*((x-0.5)*(x-0.5)))). // -// tint: the tint pixel wand. -// -// opacity: the opacity pixel wand. -// +// tint: the tint pixel wand. +// opacity: the opacity pixel wand. func (mw *MagickWand) TintImage(tint, opacity *PixelWand) error { ok := C.MagickTintImage(mw.mw, tint.pw, opacity.pw) runtime.KeepAlive(tint) @@ -2792,102 +2632,93 @@ func (mw *MagickWand) TintImage(tint, opacity *PixelWand) error { return mw.getLastErrorIfFailed(ok) } -// Transform the image colorspace, setting the images colorspace while +// TransformImageColorspace Transform the image colorspace, setting the images colorspace while // transforming the images data to that colorspace. func (mw *MagickWand) TransformImageColorspace(colorspace ColorspaceType) error { ok := C.MagickTransformImageColorspace(mw.mw, C.ColorspaceType(colorspace)) return mw.getLastErrorIfFailed(ok) } -// Changes any pixel that matches color with the color defined by fill. -// -// alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully -// transparent. +// TransparentPaintImage Changes any pixel that matches color with the color defined by fill. // -// fuzz: by default target must match a particular pixel color exactly. -// However, in many cases two colors may differ by a small amount. The fuzz -// member of image defines how much tolerance is acceptable to consider two -// colors as the same. For example, set fuzz to 10 and the color red at -// intensities of 100 and 102 respectively are now interpreted as the same -// color for the purposes of the floodfill. +// alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully transparent. // -// invert: paint any pixel that does not match the target color. +// fuzz: by default target must match a particular pixel color exactly. +// However, in many cases two colors may differ by a small amount. The fuzz +// member of image defines how much tolerance is acceptable to consider two +// colors as the same. For example, set fuzz to 10 and the color red at +// intensities of 100 and 102 respectively are now interpreted as the same +// color for the purposes of the floodfill. // +// invert: paint any pixel that does not match the target color. func (mw *MagickWand) TransparentPaintImage(target *PixelWand, alpha, fuzz float64, invert bool) error { ok := C.MagickTransparentPaintImage(mw.mw, target.pw, C.double(alpha), C.double(fuzz), b2i(invert)) runtime.KeepAlive(target) return mw.getLastErrorIfFailed(ok) } -// Creates a vertical mirror image by reflecting the pixels around the central +// TransposeImage Creates a vertical mirror image by reflecting the pixels around the central // x-axis while rotating them 90-degrees. func (mw *MagickWand) TransposeImage() error { ok := C.MagickTransposeImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Creates a horizontal mirror image by reflecting the pixels around the +// TransverseImage Creates a horizontal mirror image by reflecting the pixels around the // central y-axis while rotating them 270-degrees. func (mw *MagickWand) TransverseImage() error { ok := C.MagickTransverseImage(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Remove edges that are the background color from the image. +// TrimImage Remove edges that are the background color from the image. // -// fuzz: by default target must match a particular pixel color exactly. -// However, in many cases two colors may differ by a small amount. The fuzz -// member of image defines how much tolerance is acceptable to consider two -// colors as the same. For example, set fuzz to 10 and the color red at -// intensities of 100 and 102 respectively are now interpreted as the same -// color for the purposes of the floodfill. +// fuzz: by default target must match a particular pixel color exactly. +// However, in many cases two colors may differ by a small amount. The fuzz +// member of image defines how much tolerance is acceptable to consider two +// colors as the same. For example, set fuzz to 10 and the color red at +// intensities of 100 and 102 respectively are now interpreted as the same +// color for the purposes of the floodfill. func (mw *MagickWand) TrimImage(fuzz float64) error { ok := C.MagickTrimImage(mw.mw, C.double(fuzz)) return mw.getLastErrorIfFailed(ok) } -// Discards all but one of any pixel color. +// UniqueImageColors Discards all but one of any pixel color. func (mw *MagickWand) UniqueImageColors() error { ok := C.MagickUniqueImageColors(mw.mw) return mw.getLastErrorIfFailed(ok) } -// Unsharpens an image. We convolve the image with a Gaussian operator of the +// UnsharpMaskImage Unsharpens an image. We convolve the image with a Gaussian operator of the // given radius and standard deviation (sigma). For reasonable results, radius // should be larger than sigma. Use a radius of 0 and UnsharpMaskImage() // selects a suitable radius for you. // -// radius: the radius of the Gaussian, in pixels, not counting the center pixel. -// -// sigma: the standard deviation of the Gaussian, in pixels. -// -// amount: the percentage of the difference between the original and the blur -// image that is added back into the original. -// -// threshold: the threshold in pixels needed to apply the diffence amount. -// +// radius: the radius of the Gaussian, in pixels, not counting the center pixel. +// sigma: the standard deviation of the Gaussian, in pixels. +// amount: the percentage of the difference between the original and the blur +// image that is added back into the original. +// threshold: the threshold in pixels needed to apply the diffence amount. func (mw *MagickWand) UnsharpMaskImage(radius, sigma, amount, threshold float64) error { ok := C.MagickUnsharpMaskImage(mw.mw, C.double(radius), C.double(sigma), C.double(amount), C.double(threshold)) return mw.getLastErrorIfFailed(ok) } -// Softens the edges of the image in vignette style. +// VignetteImage Softens the edges of the image in vignette style. // // x, y: define the x and y ellipse offset. -// func (mw *MagickWand) VignetteImage(blackPoint, whitePoint float64, x, y int) error { ok := C.MagickVignetteImage(mw.mw, C.double(blackPoint), C.double(whitePoint), C.ssize_t(x), C.ssize_t(y)) return mw.getLastErrorIfFailed(ok) } -// Creates a "ripple" effect in the image by shifting the pixels vertically +// WaveImage Creates a "ripple" effect in the image by shifting the pixels vertically // along a sine wave whose amplitude and wavelength is specified by the given // parameters. // -// amplitude, wavelength: Define the amplitude and wave length of the sine wave. -// -// method: the pixel interpolation method -// +// amplitude, wavelength: Define the amplitude and wave length of the sine wave. +// method: the pixel interpolation method func (mw *MagickWand) WaveImage(amplitude, wavelength float64, method PixelInterpolateMethod) error { @@ -2897,7 +2728,7 @@ func (mw *MagickWand) WaveImage(amplitude, wavelength float64, return mw.getLastErrorIfFailed(ok) } -// Is like ThresholdImage() but force all pixels above the threshold into white +// WhiteThresholdImage Is like ThresholdImage() but force all pixels above the threshold into white // while leaving all pixels below the threshold unchanged. func (mw *MagickWand) WhiteThresholdImage(threshold *PixelWand) error { ok := C.MagickWhiteThresholdImage(mw.mw, threshold.pw) @@ -2905,7 +2736,7 @@ func (mw *MagickWand) WhiteThresholdImage(threshold *PixelWand) error { return mw.getLastErrorIfFailed(ok) } -// Writes an image to the specified filename. +// WriteImage Writes an image to the specified filename. func (mw *MagickWand) WriteImage(filename string) error { csfilename := C.CString(filename) defer C.free(unsafe.Pointer(csfilename)) @@ -2913,7 +2744,7 @@ func (mw *MagickWand) WriteImage(filename string) error { return mw.getLastErrorIfFailed(ok) } -// Writes an image to an open file descriptor. +// WriteImageFile Writes an image to an open file descriptor. func (mw *MagickWand) WriteImageFile(out *os.File) error { file, err := cfdopen(out, "w") if err != nil { @@ -2924,7 +2755,7 @@ func (mw *MagickWand) WriteImageFile(out *os.File) error { return mw.getLastErrorIfFailed(ok) } -// Writes an image or image sequence. +// WriteImages Writes an image or image sequence. func (mw *MagickWand) WriteImages(filename string, adjoin bool) error { csfilename := C.CString(filename) defer C.free(unsafe.Pointer(csfilename)) @@ -2932,7 +2763,7 @@ func (mw *MagickWand) WriteImages(filename string, adjoin bool) error { return mw.getLastErrorIfFailed(ok) } -// Writes an image sequence to an open file descriptor. +// WriteImagesFile Writes an image sequence to an open file descriptor. func (mw *MagickWand) WriteImagesFile(out *os.File) error { file, err := cfdopen(out, "w") if err != nil { diff --git a/imagick/magick_wand_prop.go b/imagick/magick_wand_prop.go index 9b1d02a..ad09d1b 100644 --- a/imagick/magick_wand_prop.go +++ b/imagick/magick_wand_prop.go @@ -15,7 +15,7 @@ import ( "unsafe" ) -// This method deletes a wand artifact +// DeleteImageArtifact This method deletes a wand artifact func (mw *MagickWand) DeleteImageArtifact(artifact string) error { csartifact := C.CString(artifact) defer C.free(unsafe.Pointer(csartifact)) @@ -23,7 +23,7 @@ func (mw *MagickWand) DeleteImageArtifact(artifact string) error { return mw.getLastErrorIfFailed(ok) } -// This method deletes a image property +// DeleteImageProperty This method deletes a image property func (mw *MagickWand) DeleteImageProperty(property string) error { csproperty := C.CString(property) defer C.free(unsafe.Pointer(csproperty)) @@ -31,7 +31,7 @@ func (mw *MagickWand) DeleteImageProperty(property string) error { return mw.getLastErrorIfFailed(ok) } -// This method deletes a wand option +// DeleteOption This method deletes a wand option func (mw *MagickWand) DeleteOption(option string) error { csoption := C.CString(option) defer C.free(unsafe.Pointer(csoption)) @@ -39,42 +39,42 @@ func (mw *MagickWand) DeleteOption(option string) error { return mw.getLastErrorIfFailed(ok) } -// Returns the antialias property associated with the wand +// GetAntialias Returns the antialias property associated with the wand func (mw *MagickWand) GetAntialias() bool { ret := 1 == C.int(C.MagickGetAntialias(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the wand background color +// GetBackgroundColor Returns the wand background color func (mw *MagickWand) GetBackgroundColor() *PixelWand { ret := newPixelWand(C.MagickGetBackgroundColor(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the wand colorspace type +// GetColorspace Returns the wand colorspace type func (mw *MagickWand) GetColorspace() ColorspaceType { ccst := C.MagickGetColorspace(mw.mw) runtime.KeepAlive(mw) return ColorspaceType(ccst) } -// Gets the wand compression type. +// GetCompression Gets the wand compression type. func (mw *MagickWand) GetCompression() CompressionType { ret := CompressionType(C.MagickGetCompression(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the wand compression quality. +// GetCompressionQuality Gets the wand compression quality. func (mw *MagickWand) GetCompressionQuality() uint { ret := uint(C.MagickGetCompressionQuality(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the filename associated with an image sequence. +// GetFilename Returns the filename associated with an image sequence. func (mw *MagickWand) GetFilename() string { cstr := C.MagickGetFilename(mw.mw) runtime.KeepAlive(mw) @@ -82,7 +82,7 @@ func (mw *MagickWand) GetFilename() string { return C.GoString(cstr) } -// Returns the font associated with the MagickWand. +// GetFont Returns the font associated with the MagickWand. func (mw *MagickWand) GetFont() string { cstr := C.MagickGetFont(mw.mw) runtime.KeepAlive(mw) @@ -90,7 +90,7 @@ func (mw *MagickWand) GetFont() string { return C.GoString(cstr) } -// Returns the format of the magick wand. +// GetFormat Returns the format of the magick wand. func (mw *MagickWand) GetFormat() string { cstr := C.MagickGetFormat(mw.mw) runtime.KeepAlive(mw) @@ -98,14 +98,14 @@ func (mw *MagickWand) GetFormat() string { return C.GoString(cstr) } -// Gets the wand gravity. +// GetGravity Gets the wand gravity. func (mw *MagickWand) GetGravity() GravityType { ret := GravityType(C.MagickGetGravity(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns a value associated with the specified artifact. +// GetImageArtifact Returns a value associated with the specified artifact. func (mw *MagickWand) GetImageArtifact(artifact string) string { csartifact := C.CString(artifact) defer C.free(unsafe.Pointer(csartifact)) @@ -115,7 +115,7 @@ func (mw *MagickWand) GetImageArtifact(artifact string) string { return C.GoString(cstr) } -// Returns all the artifact names that match the specified pattern associated +// GetImageArtifacts Returns all the artifact names that match the specified pattern associated // with a wand. Use GetImageProperty() to return the value of a particular // artifact. func (mw *MagickWand) GetImageArtifacts(pattern string) (artifacts []string) { @@ -129,9 +129,9 @@ func (mw *MagickWand) GetImageArtifacts(pattern string) (artifacts []string) { return } -// Returns the named image profile. +// GetImageProfile Returns the named image profile. // -// name: Name of profile to return: ICC, IPTC, or generic profile. +// name: Name of profile to return: ICC, IPTC, or generic profile. func (mw *MagickWand) GetImageProfile(name string) string { csname := C.CString(name) defer C.free(unsafe.Pointer(csname)) @@ -142,7 +142,7 @@ func (mw *MagickWand) GetImageProfile(name string) string { return C.GoStringN((*C.char)((unsafe.Pointer)(csprofile)), C.int(szlen)) } -// Returns all the profile names that match the specified pattern associated +// GetImageProfiles Returns all the profile names that match the specified pattern associated // with a wand. Use GetImageProfile() to return the value of a particular // property. func (mw *MagickWand) GetImageProfiles(pattern string) (profiles []string) { @@ -156,7 +156,7 @@ func (mw *MagickWand) GetImageProfiles(pattern string) (profiles []string) { return } -// Returns a value associated with the specified property. +// GetImageProperty Returns a value associated with the specified property. func (mw *MagickWand) GetImageProperty(property string) string { csproperty := C.CString(property) defer C.free(unsafe.Pointer(csproperty)) @@ -166,7 +166,7 @@ func (mw *MagickWand) GetImageProperty(property string) string { return C.GoString(cspv) } -// Returns all the property names that match the specified pattern associated +// GetImageProperties Returns all the property names that match the specified pattern associated // with a wand. Use GetImageProperty() to return the value of a particular // property. func (mw *MagickWand) GetImageProperties(pattern string) (properties []string) { @@ -180,21 +180,21 @@ func (mw *MagickWand) GetImageProperties(pattern string) (properties []string) { return } -// Gets the wand interlace scheme. +// GetInterlaceScheme Gets the wand interlace scheme. func (mw *MagickWand) GetInterlaceScheme() InterlaceType { ret := InterlaceType(C.MagickGetInterlaceScheme(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the wand compression. +// GetInterpolateMethod Gets the wand compression. func (mw *MagickWand) GetInterpolateMethod() PixelInterpolateMethod { ret := PixelInterpolateMethod(C.MagickGetInterpolateMethod(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns a value associated with a wand and the specified key. +// GetOption Returns a value associated with a wand and the specified key. func (mw *MagickWand) GetOption(key string) string { cskey := C.CString(key) defer C.free(unsafe.Pointer(cskey)) @@ -204,7 +204,7 @@ func (mw *MagickWand) GetOption(key string) string { return C.GoString(csval) } -// Returns all the option names that match the specified pattern associated +// GetOptions Returns all the option names that match the specified pattern associated // with a wand. Use GetOption() to return the value of a particular option. func (mw *MagickWand) GetOptions(pattern string) (options []string) { cspattern := C.CString(pattern) @@ -217,14 +217,14 @@ func (mw *MagickWand) GetOptions(pattern string) (options []string) { return } -// Gets the wand orientation type. +// GetOrientation Gets the wand orientation type. func (mw *MagickWand) GetOrientation() OrientationType { ret := OrientationType(C.MagickGetOrientation(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns the page geometry associated with the magick wand. +// GetPage Returns the page geometry associated with the magick wand. func (mw *MagickWand) GetPage() (width, height uint, x, y int, err error) { var cw, ch C.size_t var cx, cy C.ssize_t @@ -234,21 +234,21 @@ func (mw *MagickWand) GetPage() (width, height uint, x, y int, err error) { return } -// Returns the font pointsize associated with the MagickWand. +// GetPointsize Returns the font pointsize associated with the MagickWand. func (mw *MagickWand) GetPointsize() float64 { ret := float64(C.MagickGetPointsize(mw.mw)) runtime.KeepAlive(mw) return ret } -// Gets the image X and Y resolution. +// GetResolution Gets the image X and Y resolution. func (mw *MagickWand) GetResolution() (x, y float64, err error) { ok := C.MagickGetResolution(mw.mw, (*C.double)(&x), (*C.double)(&y)) err = mw.getLastErrorIfFailed(ok) return } -// Gets the horizontal and vertical sampling factor. +// GetSamplingFactors Gets the horizontal and vertical sampling factor. func (mw *MagickWand) GetSamplingFactors() (factors []float64) { num := C.size_t(0) pd := C.MagickGetSamplingFactors(mw.mw, &num) @@ -257,7 +257,7 @@ func (mw *MagickWand) GetSamplingFactors() (factors []float64) { return } -// Returns the size associated with the magick wand. +// GetSize Returns the size associated with the magick wand. func (mw *MagickWand) GetSize() (cols, rows uint, err error) { var cc, cr C.size_t ok := C.MagickGetSize(mw.mw, &cc, &cr) @@ -265,7 +265,7 @@ func (mw *MagickWand) GetSize() (cols, rows uint, err error) { return } -// Returns the size offset associated with the magick wand. +// GetSizeOffset Returns the size offset associated with the magick wand. func (mw *MagickWand) GetSizeOffset() (offset int, err error) { var co C.ssize_t ok := C.MagickGetSizeOffset(mw.mw, &co) @@ -273,19 +273,18 @@ func (mw *MagickWand) GetSizeOffset() (offset int, err error) { return } -// Returns the wand type. +// GetType Returns the wand type. func (mw *MagickWand) GetType() ImageType { ret := ImageType(C.MagickGetType(mw.mw)) runtime.KeepAlive(mw) return ret } -// Adds or removes a ICC, IPTC, or generic profile from an image. If the +// ProfileImage Adds or removes a ICC, IPTC, or generic profile from an image. If the // profile is empty, it is removed from the image otherwise added. Use a name // of '*' and an empty profile to remove all profiles from the image. // -// name: Name of profile to add or remove: ICC, IPTC, or generic profile. -// +// name: Name of profile to add or remove: ICC, IPTC, or generic profile. func (mw *MagickWand) ProfileImage(name string, profile []byte) error { if len(profile) == 0 { return errors.New("zero-length profile not permitted") @@ -296,10 +295,9 @@ func (mw *MagickWand) ProfileImage(name string, profile []byte) error { return mw.getLastErrorIfFailed(ok) } -// Removes the named image profile and returns it. +// RemoveImageProfile Removes the named image profile and returns it. // // name: name of profile to return: ICC, IPTC, or generic profile. -// func (mw *MagickWand) RemoveImageProfile(name string) []byte { csname := C.CString(name) defer C.free(unsafe.Pointer(csname)) @@ -310,44 +308,44 @@ func (mw *MagickWand) RemoveImageProfile(name string) []byte { return C.GoBytes(unsafe.Pointer(profile), C.int(clen)) } -// Sets the antialias propery of the wand. +// SetAntialias Sets the antialias propery of the wand. func (mw *MagickWand) SetAntialias(antialias bool) error { ok := C.MagickSetAntialias(mw.mw, b2i(antialias)) return mw.getLastErrorIfFailed(ok) } -// Sets the wand background color. +// SetBackgroundColor Sets the wand background color. func (mw *MagickWand) SetBackgroundColor(background *PixelWand) error { ok := C.MagickSetBackgroundColor(mw.mw, background.pw) runtime.KeepAlive(background) return mw.getLastErrorIfFailed(ok) } -// Sets the wand colorspace type. +// SetColorspace Sets the wand colorspace type. func (mw *MagickWand) SetColorspace(colorspace ColorspaceType) error { ok := C.MagickSetColorspace(mw.mw, C.ColorspaceType(colorspace)) return mw.getLastErrorIfFailed(ok) } -// Sets the wand compression type. +// SetCompression Sets the wand compression type. func (mw *MagickWand) SetCompression(compression CompressionType) error { ok := C.MagickSetCompression(mw.mw, C.CompressionType(compression)) return mw.getLastErrorIfFailed(ok) } -// Sets the wand compression quality. +// SetCompressionQuality Sets the wand compression quality. func (mw *MagickWand) SetCompressionQuality(quality uint) error { ok := C.MagickSetCompressionQuality(mw.mw, C.size_t(quality)) return mw.getLastErrorIfFailed(ok) } -// Sets the wand pixel depth. +// SetDepth Sets the wand pixel depth. func (mw *MagickWand) SetDepth(depth uint) error { ok := C.MagickSetDepth(mw.mw, C.size_t(depth)) return mw.getLastErrorIfFailed(ok) } -// Sets the extract geometry before you read or write an image file. Use it for +// SetExtract Sets the extract geometry before you read or write an image file. Use it for // inline cropping (e.g. 200x200+0+0) or resizing (e.g.200x200). func (mw *MagickWand) SetExtract(geometry string) error { csgeometry := C.CString(geometry) @@ -356,7 +354,7 @@ func (mw *MagickWand) SetExtract(geometry string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the filename before you read or write an image file. +// SetFilename Sets the filename before you read or write an image file. func (mw *MagickWand) SetFilename(filename string) error { csfilename := C.CString(filename) defer C.free(unsafe.Pointer(csfilename)) @@ -364,7 +362,7 @@ func (mw *MagickWand) SetFilename(filename string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the font associated with the MagickWand. +// SetFont Sets the font associated with the MagickWand. func (mw *MagickWand) SetFont(font string) error { csfont := C.CString(font) defer C.free(unsafe.Pointer(csfont)) @@ -372,7 +370,7 @@ func (mw *MagickWand) SetFont(font string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the format of the magick wand. +// SetFormat Sets the format of the magick wand. func (mw *MagickWand) SetFormat(format string) error { csformat := C.CString(format) defer C.free(unsafe.Pointer(csformat)) @@ -380,13 +378,13 @@ func (mw *MagickWand) SetFormat(format string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the gravity type. +// SetGravity Sets the gravity type. func (mw *MagickWand) SetGravity(gtype GravityType) error { ok := C.MagickSetGravity(mw.mw, C.GravityType(gtype)) return mw.getLastErrorIfFailed(ok) } -// Associates a artifact with an image. +// SetImageArtifact Associates a artifact with an image. func (mw *MagickWand) SetImageArtifact(artifact, value string) error { csartifact := C.CString(artifact) defer C.free(unsafe.Pointer(csartifact)) @@ -396,11 +394,11 @@ func (mw *MagickWand) SetImageArtifact(artifact, value string) error { return mw.getLastErrorIfFailed(ok) } -// Adds a named profile to the magick wand. If a profile with the same name +// SetImageProfile Adds a named profile to the magick wand. If a profile with the same name // already exists, it is replaced. This method differs from the ProfileImage() // method in that it does not apply any CMS color profiles. // -// name: Name of profile to add or remove: ICC, IPTC, or generic profile. +// name: Name of profile to add or remove: ICC, IPTC, or generic profile. func (mw *MagickWand) SetImageProfile(name string, profile []byte) error { if len(profile) == 0 { return errors.New("zero-length profile not permitted") @@ -411,7 +409,7 @@ func (mw *MagickWand) SetImageProfile(name string, profile []byte) error { return mw.getLastErrorIfFailed(ok) } -// Associates a property with an image. +// SetImageProperty Associates a property with an image. func (mw *MagickWand) SetImageProperty(property, value string) error { csproperty := C.CString(property) defer C.free(unsafe.Pointer(csproperty)) @@ -421,19 +419,19 @@ func (mw *MagickWand) SetImageProperty(property, value string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the image interlacing scheme +// SetInterlaceScheme Sets the image interlacing scheme func (mw *MagickWand) SetInterlaceScheme(scheme InterlaceType) error { ok := C.MagickSetInterlaceScheme(mw.mw, C.InterlaceType(scheme)) return mw.getLastErrorIfFailed(ok) } -// Sets the interpolate pixel method. +// SetInterpolateMethod Sets the interpolate pixel method. func (mw *MagickWand) SetInterpolateMethod(method PixelInterpolateMethod) error { ok := C.MagickSetInterpolateMethod(mw.mw, C.PixelInterpolateMethod(method)) return mw.getLastErrorIfFailed(ok) } -// Associates one or options with the wand (.e.g +// SetOption Associates one or options with the wand (.e.g // SetOption(wand, "jpeg:perserve", "yes")). func (mw *MagickWand) SetOption(key, value string) error { cskey := C.CString(key) @@ -444,19 +442,19 @@ func (mw *MagickWand) SetOption(key, value string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the wand orientation type. +// SetOrientation Sets the wand orientation type. func (mw *MagickWand) SetOrientation(orientation OrientationType) error { ok := C.MagickSetOrientation(mw.mw, C.OrientationType(orientation)) return mw.getLastErrorIfFailed(ok) } -// Sets the page geometry of the magick wand. +// SetPage Sets the page geometry of the magick wand. func (mw *MagickWand) SetPage(width, height uint, x, y int) error { ok := C.MagickSetPage(mw.mw, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y)) return mw.getLastErrorIfFailed(ok) } -// Sets the passphrase. +// SetPassphrase Sets the passphrase. func (mw *MagickWand) SetPassphrase(passphrase string) error { cspassphrase := C.CString(passphrase) defer C.free(unsafe.Pointer(cspassphrase)) @@ -464,25 +462,25 @@ func (mw *MagickWand) SetPassphrase(passphrase string) error { return mw.getLastErrorIfFailed(ok) } -// Sets the font pointsize associated with the MagickWand. +// SetPointsize Sets the font pointsize associated with the MagickWand. func (mw *MagickWand) SetPointsize(pointSize float64) error { ok := C.MagickSetPointsize(mw.mw, C.double(pointSize)) return mw.getLastErrorIfFailed(ok) } -// Sets the limit for a particular resource in megabytes. +// SetResourceLimit Sets the limit for a particular resource in megabytes. func (mw *MagickWand) SetResourceLimit(rtype ResourceType, limit int64) error { ok := C.MagickSetResourceLimit(C.ResourceType(rtype), C.MagickSizeType(limit)) return mw.getLastErrorIfFailed(ok) } -// Sets the image resolution. +// SetResolution Sets the image resolution. func (mw *MagickWand) SetResolution(xRes, yRes float64) error { ok := C.MagickSetResolution(mw.mw, C.double(xRes), C.double(yRes)) return mw.getLastErrorIfFailed(ok) } -// Sets the image sampling factors. +// SetSamplingFactors Sets the image sampling factors. // // samplingFactors: An array of floats representing the sampling factor for // each color component (in RGB order). @@ -491,21 +489,21 @@ func (mw *MagickWand) SetSamplingFactors(samplingFactors []float64) error { return mw.getLastErrorIfFailed(ok) } -// Sets the size of the magick wand. Set it before you read a raw image format +// SetSize Sets the size of the magick wand. Set it before you read a raw image format // such as RGB, GRAY, or CMYK. func (mw *MagickWand) SetSize(cols, rows uint) error { ok := C.MagickSetSize(mw.mw, C.size_t(cols), C.size_t(rows)) return mw.getLastErrorIfFailed(ok) } -// Sets the size and offset of the magick wand. Set it before you read a raw +// SetSizeOffset Sets the size and offset of the magick wand. Set it before you read a raw // image format such as RGB, GRAY, or CMYK. func (mw *MagickWand) SetSizeOffset(cols, rows uint, offset int) error { ok := C.MagickSetSizeOffset(mw.mw, C.size_t(cols), C.size_t(rows), C.ssize_t(offset)) return mw.getLastErrorIfFailed(ok) } -// Sets the image type attribute. +// SetType Sets the image type attribute. func (mw *MagickWand) SetType(itype ImageType) error { ok := C.MagickSetType(mw.mw, C.ImageType(itype)) return mw.getLastErrorIfFailed(ok) diff --git a/imagick/memory.go b/imagick/memory.go index e7fa52d..f3bb708 100644 --- a/imagick/memory.go +++ b/imagick/memory.go @@ -25,7 +25,7 @@ func relinquishMemory(ptr unsafe.Pointer) { func relinquishMemoryCStringArray(p **C.char) { if p == nil { return - } + } defer relinquishMemory(unsafe.Pointer(p)) for *p != nil { relinquishMemory(unsafe.Pointer(*p)) diff --git a/imagick/pixel_iterator.go b/imagick/pixel_iterator.go index 684c37b..e38f8b1 100644 --- a/imagick/pixel_iterator.go +++ b/imagick/pixel_iterator.go @@ -32,21 +32,19 @@ func newPixelIterator(cpi *C.PixelIterator) *PixelIterator { return pi } -// Returns a new pixel iterator -// -// mw: the magick wand to iterate on +// NewPixelIterator Returns a new pixel iterator // +// mw: the magick wand to iterate on func (mw *MagickWand) NewPixelIterator() *PixelIterator { ret := newPixelIterator(C.NewPixelIterator(mw.mw)) runtime.KeepAlive(mw) return ret } -// Returns a new pixel iterator -// -// mw: the magick wand to iterate on -// x, y, cols, rows: there values define the perimeter of a region of pixels +// NewPixelRegionIterator Returns a new pixel iterator // +// mw: the magick wand to iterate on +// x, y, cols, rows: there values define the perimeter of a region of pixels func (mw *MagickWand) NewPixelRegionIterator(x, y int, width, height uint) *PixelIterator { ret := newPixelIterator(C.NewPixelRegionIterator(mw.mw, C.ssize_t(x), C.ssize_t(y), C.size_t(width), C.size_t(height))) runtime.KeepAlive(mw) @@ -59,14 +57,14 @@ func (pi *PixelIterator) Clear() { runtime.KeepAlive(pi) } -// Makes an exact copy of the specified iterator. +// Clone Makes an exact copy of the specified iterator. func (pi *PixelIterator) Clone() *PixelIterator { ret := newPixelIterator(C.ClonePixelIterator(pi.pi)) runtime.KeepAlive(pi) return ret } -// Deallocates resources associated with a PixelIterator. +// Destroy Deallocates resources associated with a PixelIterator. func (pi *PixelIterator) Destroy() { if pi.pi == nil { return @@ -82,7 +80,7 @@ func (pi *PixelIterator) Destroy() { }) } -// Returns true if the iterator is verified as a pixel iterator. +// IsVerified Returns true if the iterator is verified as a pixel iterator. func (pi *PixelIterator) IsVerified() bool { if pi.pi == nil { return false @@ -92,19 +90,19 @@ func (pi *PixelIterator) IsVerified() bool { return ret } -// Increase PixelIterator ref counter and set according "can`t be terminated status" +// IncreaseCount Increase PixelIterator ref counter and set according "can`t be terminated status" func (pi *PixelIterator) IncreaseCount() { atomic.AddInt64(&pixelIteratorCounter, int64(1)) unsetCanTerminate() } -// Decrease DrawingWand ref counter and set according "can be terminated status" +// DecreaseCount Decrease DrawingWand ref counter and set according "can be terminated status" func (pi *PixelIterator) DecreaseCount() { atomic.AddInt64(&pixelIteratorCounter, int64(-1)) setCanTerminate() } -// Returns the current row as an array of pixel wands from the pixel iterator. +// GetCurrentIteratorRow Returns the current row as an array of pixel wands from the pixel iterator. func (pi *PixelIterator) GetCurrentIteratorRow() (pws []*PixelWand) { num := C.size_t(0) pp := C.PixelGetCurrentIteratorRow(pi.pi, &num) @@ -122,14 +120,14 @@ func (pi *PixelIterator) GetCurrentIteratorRow() (pws []*PixelWand) { return } -// Returns the current pixel iterator row. +// GetIteratorRow Returns the current pixel iterator row. func (pi *PixelIterator) GetIteratorRow() int { ret := int(C.PixelGetIteratorRow(pi.pi)) runtime.KeepAlive(pi) return ret } -// Returns the next row as an array of pixel wands from the pixel iterator. +// GetNextIteratorRow Returns the next row as an array of pixel wands from the pixel iterator. func (pi *PixelIterator) GetNextIteratorRow() (pws []*PixelWand) { num := C.size_t(0) pp := C.PixelGetNextIteratorRow(pi.pi, &num) @@ -147,7 +145,7 @@ func (pi *PixelIterator) GetNextIteratorRow() (pws []*PixelWand) { return } -// Returns the previous row as an array of pixel wands from the pixel iterator. +// GetPreviousIteratorRow Returns the previous row as an array of pixel wands from the pixel iterator. func (pi *PixelIterator) GetPreviousIteratorRow() (pws []*PixelWand) { num := C.size_t(0) pp := C.PixelGetPreviousIteratorRow(pi.pi, &num) @@ -165,32 +163,32 @@ func (pi *PixelIterator) GetPreviousIteratorRow() (pws []*PixelWand) { return } -// Resets the pixel iterator. Use it in conjunction with GetNextIteratorRow() +// Reset Resets the pixel iterator. Use it in conjunction with GetNextIteratorRow() // to iterate over all the pixels in a pixel container. func (pi *PixelIterator) Reset() { C.PixelResetIterator(pi.pi) runtime.KeepAlive(pi) } -// Sets the pixel iterator to the first pixel row. +// SetFirstIteratorRow Sets the pixel iterator to the first pixel row. func (pi *PixelIterator) SetFirstIteratorRow() { C.PixelSetFirstIteratorRow(pi.pi) runtime.KeepAlive(pi) } -// Set the pixel iterator row. +// SetIteratorRow Set the pixel iterator row. func (pi *PixelIterator) SetIteratorRow(row int) error { ok := C.PixelSetIteratorRow(pi.pi, C.ssize_t(row)) return pi.getLastErrorIfFailed(ok) } -// Sets the pixel iterator to the last pixel row. +// SetLastIteratorRow Sets the pixel iterator to the last pixel row. func (pi *PixelIterator) SetLastIteratorRow() { C.PixelSetLastIteratorRow(pi.pi) runtime.KeepAlive(pi) } -// Syncs the pixel iterator. +// SyncIterator Syncs the pixel iterator. func (pi *PixelIterator) SyncIterator() error { ok := C.PixelSyncIterator(pi.pi) return pi.getLastErrorIfFailed(ok)