|
|
@ -2,7 +2,6 @@ |
|
|
// Copyright (c) James Jackson-South and contributors.
|
|
|
// Copyright (c) James Jackson-South and contributors.
|
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
// </copyright>
|
|
|
// </copyright>
|
|
|
|
|
|
|
|
|
namespace ImageProcessorCore.Samplers |
|
|
namespace ImageProcessorCore.Samplers |
|
|
{ |
|
|
{ |
|
|
using System; |
|
|
using System; |
|
|
@ -43,13 +42,13 @@ namespace ImageProcessorCore.Samplers |
|
|
switch (this.RotateType) |
|
|
switch (this.RotateType) |
|
|
{ |
|
|
{ |
|
|
case RotateType.Rotate90: |
|
|
case RotateType.Rotate90: |
|
|
Rotate90(target, source); |
|
|
this.Rotate90(target, source); |
|
|
break; |
|
|
break; |
|
|
case RotateType.Rotate180: |
|
|
case RotateType.Rotate180: |
|
|
Rotate180(target, source); |
|
|
this.Rotate180(target, source); |
|
|
break; |
|
|
break; |
|
|
case RotateType.Rotate270: |
|
|
case RotateType.Rotate270: |
|
|
Rotate270(target, source); |
|
|
this.Rotate270(target, source); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
target.ClonePixels(target.Width, target.Height, source.Pixels); |
|
|
target.ClonePixels(target.Width, target.Height, source.Pixels); |
|
|
@ -60,10 +59,10 @@ namespace ImageProcessorCore.Samplers |
|
|
{ |
|
|
{ |
|
|
// No default needed as we have already set the pixels.
|
|
|
// No default needed as we have already set the pixels.
|
|
|
case FlipType.Vertical: |
|
|
case FlipType.Vertical: |
|
|
FlipX(target); |
|
|
this.FlipX(target); |
|
|
break; |
|
|
break; |
|
|
case FlipType.Horizontal: |
|
|
case FlipType.Horizontal: |
|
|
FlipY(target); |
|
|
this.FlipY(target); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -90,6 +89,7 @@ namespace ImageProcessorCore.Samplers |
|
|
newY = width - newY - 1; |
|
|
newY = width - newY - 1; |
|
|
temp[newX, newY] = source[x, y]; |
|
|
temp[newX, newY] = source[x, y]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.OnRowProcessed(); |
|
|
this.OnRowProcessed(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -115,6 +115,7 @@ namespace ImageProcessorCore.Samplers |
|
|
int newY = height - y - 1; |
|
|
int newY = height - y - 1; |
|
|
target[newX, newY] = source[x, y]; |
|
|
target[newX, newY] = source[x, y]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.OnRowProcessed(); |
|
|
this.OnRowProcessed(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
@ -138,6 +139,7 @@ namespace ImageProcessorCore.Samplers |
|
|
int newX = height - y - 1; |
|
|
int newX = height - y - 1; |
|
|
temp[newX, x] = source[x, y]; |
|
|
temp[newX, x] = source[x, y]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.OnRowProcessed(); |
|
|
this.OnRowProcessed(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -166,6 +168,7 @@ namespace ImageProcessorCore.Samplers |
|
|
target[x, y] = temp[x, newY]; |
|
|
target[x, y] = temp[x, newY]; |
|
|
target[x, newY] = temp[x, y]; |
|
|
target[x, newY] = temp[x, y]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.OnRowProcessed(); |
|
|
this.OnRowProcessed(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
@ -192,6 +195,7 @@ namespace ImageProcessorCore.Samplers |
|
|
target[x, y] = temp[newX, y]; |
|
|
target[x, y] = temp[newX, y]; |
|
|
target[newX, y] = temp[x, y]; |
|
|
target[newX, y] = temp[x, y]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.OnRowProcessed(); |
|
|
this.OnRowProcessed(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|