Rodrigo_Medeiros

ColorFixerController.cs

Aug 16th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.46 KB | None | 0 0
  1. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2. // END USER LICENSE / CREATIVE COMMONS by-sa v4.0 -> https://creativecommons.org/licenses/by/4.0/
  3. ////////////////////////////////////////////////////////////////////////////////////////////////////
  4. // With this license you are free to:
  5. // * Share — copy and redistribute the material in any medium or format
  6. // * Adapt — remix, transform, and build upon the material
  7. // for any purpose, even commercially.
  8. // The licensor cannot revoke these freedoms as long as you follow the license terms.
  9. //
  10. // Under the following terms:
  11. // * Attribution — You must give appropriate credit to Rodrigo M.Lehnemann and provide a link to the license. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  12. // No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.  
  13. //
  14. // Notices:
  15. // You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
  16. // No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
  17. ////////////////////////////////////////////////////////////////////////////////////////////////////
  18.  
  19. using System.ComponentModel;
  20. using SiliconStudio.Core;
  21. using SiliconStudio.Core.Annotations;
  22. using SiliconStudio.Xenko.Rendering.Images;
  23.  
  24. namespace XenkoTest.ColorTransforms
  25. {
  26.     class ColorFixerController
  27.     {
  28.         [DataContract("ColorFixer")]
  29.         public sealed class ColorFixer : ColorTransform
  30.         {
  31.             public ColorFixer() : this("ColorFixer")
  32.             {
  33.             }
  34.  
  35.             public ColorFixer(string effect) : base(effect)
  36.             {
  37.                 this.Intensity = 1.0f;
  38.             }
  39.  
  40.             [DataMember(10)]
  41.             [DefaultValue(1.0f)]
  42.             [DataMemberRange(-5f, 5f, 0.01f, 0.1f)]
  43.             public float Intensity { get; set; }
  44.  
  45.             public override void UpdateParameters(ColorTransformContext context)
  46.             {
  47.                 Parameters.Set(ColorFixerKeys.Intensity, Intensity);
  48.  
  49.                 base.UpdateParameters(context);
  50.             }
  51.         }
  52.     }
  53. }
Add Comment
Please, Sign In to add comment