add proper support on rotateCmd for lang.Command.Rotate
This commit is contained in:
parent
54919110a5
commit
b0525f2386
1 changed files with 8 additions and 11 deletions
|
@ -190,16 +190,14 @@ pub const Runner = struct {
|
||||||
_ = try proc.spawnAndWait();
|
_ = try proc.spawnAndWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rotateCmd(
|
fn rotateCmd(self: *Runner, cmd: lang.Command) !void {
|
||||||
self: *Runner,
|
const rotate_cmd = cmd.cast(lang.Command.Rotate).?;
|
||||||
deg: f32,
|
|
||||||
bgfill: []const u8,
|
|
||||||
) !void {
|
|
||||||
var image = try self.getImage();
|
var image = try self.getImage();
|
||||||
var c_bgfill = try std.cstr.addNullByte(self.allocator, bgfill);
|
var c_bgfill = try std.cstr.addNullByte(self.allocator, rotate_cmd.bgfill);
|
||||||
defer self.allocator.free(c_bgfill);
|
defer self.allocator.free(c_bgfill);
|
||||||
|
|
||||||
try magick.runRotate(image, deg, c_bgfill);
|
try magick.runRotate(image, rotate_cmd.deg, c_bgfill);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn executeLV2Command(self: *@This(), command: var) !void {
|
fn executeLV2Command(self: *@This(), command: var) !void {
|
||||||
|
@ -263,11 +261,10 @@ pub const Runner = struct {
|
||||||
const command = cmd.cast(lang.Command.Load).?;
|
const command = cmd.cast(lang.Command.Load).?;
|
||||||
try self.loadCmd(command.path);
|
try self.loadCmd(command.path);
|
||||||
},
|
},
|
||||||
.quicksave => {
|
.quicksave => try self.quicksaveCmd(),
|
||||||
try self.quicksaveCmd();
|
.rotate => try self.rotateCmd(cmd),
|
||||||
},
|
|
||||||
.amp => try self.runSingleCommand(cmd, .amp),
|
|
||||||
|
|
||||||
|
.amp => try self.runSingleCommand(cmd, .amp),
|
||||||
.rflanger => try self.runSingleCommand(cmd, .rflanger),
|
.rflanger => try self.runSingleCommand(cmd, .rflanger),
|
||||||
.eq => try self.runSingleCommand(cmd, .eq),
|
.eq => try self.runSingleCommand(cmd, .eq),
|
||||||
.phaser => try self.runSingleCommand(cmd, .phaser),
|
.phaser => try self.runSingleCommand(cmd, .phaser),
|
||||||
|
|
Loading…
Reference in a new issue