add imagemagick linking

This commit is contained in:
Luna 2019-07-22 19:28:55 -03:00
parent 67c9f425bb
commit b056a0edb3
4 changed files with 30 additions and 1 deletions

9
src/magick.zig Normal file
View file

@ -0,0 +1,9 @@
// imagemagick plugins
const std = @import("std");
const images = @import("image.zig");
const Image = images.Image;
pub fn runRotate(image: *Image) !void {
return error.NotImplementedYet;
}

View file

@ -3,6 +3,7 @@ const lang = @import("lang.zig");
const images = @import("image.zig");
const plugin = @import("plugin.zig");
const custom = @import("custom.zig");
const magick = @import("magick.zig");
const Position = plugin.Position;
const ParamList = plugin.ParamList;
@ -257,6 +258,11 @@ pub const Runner = struct {
try image.runCustomPlugin(custom.WildNoise, pos, map);
}
fn rotateCmd(self: *Runner) !void {
var image = try self.getImage();
try magick.runRotate(image);
}
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
var params = ParamList.init(self.allocator);
defer params.deinit();
@ -418,6 +424,8 @@ pub const Runner = struct {
try self.wildNoiseCmd(pos, &map);
},
.Rotate => try self.rotateCmd(),
else => blk: {
std.debug.warn("Unsupported command: {}\n", cmd.command);
break :blk RunError.UnknownCommand;