aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Skinning.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-12 20:32:28 -0400
committerMichael <[email protected]>2017-05-12 20:32:28 -0400
commitc18c0fbc325b1c6a0864f88c6e2f4d2889d62e18 (patch)
tree1688b7c14f37fc0942e3b2c71a133aed3b9eee0e /ShiftOS_TheReturn/Skinning.cs
parentbded9d1250575e6b9824be9048ac7ac8669a303b (diff)
downloadshiftos_thereturn-c18c0fbc325b1c6a0864f88c6e2f4d2889d62e18.tar.gz
shiftos_thereturn-c18c0fbc325b1c6a0864f88c6e2f4d2889d62e18.tar.bz2
shiftos_thereturn-c18c0fbc325b1c6a0864f88c6e2f4d2889d62e18.zip
dithering revamp
Diffstat (limited to 'ShiftOS_TheReturn/Skinning.cs')
-rw-r--r--ShiftOS_TheReturn/Skinning.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs
index b731c4f..548e80f 100644
--- a/ShiftOS_TheReturn/Skinning.cs
+++ b/ShiftOS_TheReturn/Skinning.cs
@@ -66,6 +66,13 @@ namespace ShiftOS.Engine
public static class SkinEngine
{
+ private static ISkinPostProcessor processor = null;
+
+ public static void SetPostProcessor(ISkinPostProcessor _processor)
+ {
+ processor = _processor;
+ }
+
public static ImageLayout GetImageLayout(string img)
{
if (LoadedSkin.SkinImageLayouts.ContainsKey(img))
@@ -93,6 +100,8 @@ namespace ShiftOS.Engine
if (iattr.Name == img)
{
byte[] image = (byte[])field.GetValue(LoadedSkin);
+ if (processor != null)
+ image = processor.ProcessImage(image);
return ImageFromBinary(image);
}
}
@@ -1323,6 +1332,16 @@ namespace ShiftOS.Engine
public string Category { get; set; }
}
+ public interface ISkinPostProcessor
+ {
+ /// <summary>
+ /// Perform algorithmic operations at the bit level on a ShiftOS skin image.
+ /// </summary>
+ /// <param name="original">The image, as loaded by the engine, as a 32-bit ARGB byte array.</param>
+ /// <returns>The processed image.</returns>
+ byte[] ProcessImage(byte[] original);
+ }
+
public class ShifterMetaAttribute : Attribute
{