-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added gradient drawing support for ImageMagick 6. (#162)
* Added gradient drawing support. * Update travis to use ImageMagick-6.9.9-40 * Update travis yml to derive ImageMagick version from external dashboard * Remove unnecessary containers.
- Loading branch information
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"gopkg.in/gographics/imagick.v2/imagick" | ||
) | ||
|
||
// Demonstrate creating a gradient image including artifact mods. | ||
func main() { | ||
imagick.Initialize() | ||
defer imagick.Terminate() | ||
|
||
mw := imagick.NewMagickWand() | ||
mw.SetSize(300,300) | ||
|
||
fc := imagick.NewPixelWand() | ||
fc.SetColor("none") | ||
mw.NewImage(300, 300, fc) | ||
mw.SetImageArtifact("gradient:angle", "35") | ||
|
||
mw.GradientImage(imagick.GRADIENT_TYPE_LINEAR, imagick.SPREAD_METHOD_PAD, "#ff0000", "#0000ff") | ||
|
||
mw.WriteImage("out.png") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package imagick | ||
|
||
/* | ||
#include <wand/MagickWand.h> | ||
*/ | ||
import "C" | ||
|
||
type GradientType int | ||
|
||
const ( | ||
GRADIENT_TYPE_UNDEFINED GradientType = C.UndefinedGradient | ||
GRADIENT_TYPE_LINEAR GradientType = C.LinearGradient | ||
GRADIENT_TYPE_RADIAL GradientType = C.RadialGradient | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package imagick | ||
|
||
/* | ||
#include <wand/MagickWand.h> | ||
*/ | ||
import "C" | ||
|
||
type SpreadMethod int | ||
|
||
const ( | ||
SPREAD_METHOD_UNDEFINED SpreadMethod = C.UndefinedGradient | ||
SPREAD_METHOD_PAD SpreadMethod = C.PadSpread | ||
SPREAD_METHOD_REFLECT SpreadMethod = C.ReflectSpread | ||
SPREAD_METHOD_REPEAT SpreadMethod = C.RepeatSpread | ||
) |