Sakana Oji Posted January 3, 2019 Share Posted January 3, 2019 (edited) On 11/16/2015 at 5:31 AM, MJW said: The following plugin has an initial blur, followed by a brightness and contrast adjustment Is there a way to call the brightness and contrast adjustment before applying the blur? I want to add this to my HDR effect, though I already built it without the adjustment and blur as Version 1.0 (I still haven't shared it btw) Edit: (Actually, I just already did - along with my Color Intensifier plugin.) Edited January 3, 2019 by Sakana Oji Already shared it. Quote Big McThankies From McSpankies! Link to comment Share on other sites More sharing options...
Sakana Oji Posted January 4, 2019 Author Share Posted January 4, 2019 How do i fix this error message? It appears in the error message box. Quote Unhandled Exception at line 0: System.InvalidOperationException: SetRenderInfo() was not called, nor was render info available implicitely at PaintDotNet.ExceptionUtil.ThrowInvalidOperationException(String message) in D:\src\pdn\src\Base\ExceptionUtil.cs:line 161 at PaintDotNet.Effects.Effect`1.Render(Rectangle[] renderRects, Int32 startIndex, Int32 length) in D:\src\pdn\src\Effects\Effect`1.cs:line 52 at PaintDotNet.Effects.UserScript.Render(Surface dst, Surface src, Rectangle rect) at PaintDotNet.Effects.UserScript.Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, Int32 startIndex, Int32 length) at PaintDotNet.Effects.CodeLab.Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, Int32 startIndex, Int32 length) Quote Big McThankies From McSpankies! Link to comment Share on other sites More sharing options...
BoltBait Posted January 4, 2019 Share Posted January 4, 2019 4 hours ago, Sakana Oji said: How do i fix this error message? Show us the script. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Sakana Oji Posted January 4, 2019 Author Share Posted January 4, 2019 I seem to have lost it somehow. Basically it's an effect that applies the Frosted Glass effect, followed by the Median effect. But I don't know how to show it to you. I apologize. Quote Big McThankies From McSpankies! Link to comment Share on other sites More sharing options...
BoltBait Posted January 4, 2019 Share Posted January 4, 2019 Well, we can't fix the error if you can't show us the script that is giving you the error. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Sakana Oji Posted January 4, 2019 Author Share Posted January 4, 2019 (edited) I tried my best to recreate it: // Name: Gaussian Blur with Brightness and Contrast // Submenu: Blurs // Author: MJW // Title: Gaussian Blur with Brighness and Contrast // Desc: Gaussian Blur with Brightness and Contrast (test multiple built-in effects) // Keywords: Gaussian blur contrast brightness test multiple built-in effects // URL: // Help: #region UICode DoubleSliderControl Amount1 = 3; // [0,5] Pressure DoubleSliderControl Amount2 = 0; // [0,200] Minimum Scatter Radius IntSliderControl Amount3 = 2; // [1,8] Quality IntSliderControl Amount4=1; // [1,200] Radius IntSliderControl Amount5=10; // [0,100] Percentile #endregion // Here is the main render loop function void Render(Surface dst, Surface src, Rectangle rect) { // Setup for calling the Frosted Glass effect FrostedGlassEffect frostedEffect = new FrostedGlassEffect(); PropertyCollection frostedProps = frostedEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken FrostedParameters = new PropertyBasedEffectConfigToken(frostedProps); FrostedParameters.SetPropertyValue(FrostedGlassEffect.PropertyNames.MaxScatterRadius, Amount1); FrostedParameters.SetPropertyValue(FrostedGlassEffect.PropertyNames.MinScatterRadius, Amount2); FrostedParameters.SetPropertyValue(FrostedGlassEffect.PropertyNames.NumSamples, Amount3); frostedEffect.SetRenderInfo(FrostedParameters, new RenderArgs(dst), new RenderArgs(src)); // Call the Frosted Glass function frostedEffect.Render(new Rectangle[1] {rect}, 0, 1); // Adjust median. MedianEffect medianEffect = new MedianEffect(); PropertyCollection medianProps = medianEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken medianParameters = new PropertyBasedEffectConfigToken(medianProps); medianParameters.SetPropertyValue(MedianEffect.PropertyNames.Radius, Amount4); medianParameters.SetPropertyValue(MedianEffect.PropertyNames.Percentile, Amount5); medianEffect.SetRenderInfo(medianParameters, new RenderArgs(dst), new RenderArgs(dst)); // Call the Median function medianEffect.Render(new Rectangle[1] {rect}, 0, 1); // Now in the main render loop, the dst canvas has a crayon version of the src canvas // The dst canvas has the contrast adjusted. } Edited January 4, 2019 by Sakana Oji Quote Big McThankies From McSpankies! Link to comment Share on other sites More sharing options...
Sakana Oji Posted January 4, 2019 Author Share Posted January 4, 2019 Weirdly the error seems to have gone, but now it makes the picture look all weird and glitchy - NOT the kind of effect I want. The picture below proves it: How to fix this, please? Quote Big McThankies From McSpankies! Link to comment Share on other sites More sharing options...
BoltBait Posted January 4, 2019 Share Posted January 4, 2019 4 minutes ago, Sakana Oji said: How to fix this, please? Here's your problem: medianEffect.SetRenderInfo(medianParameters, new RenderArgs(dst), new RenderArgs(dst)); You can't render the median effect to the same canvas you're rendering from. You should probably read the tutorials on my web site: https://boltbait.com/pdn/CodeLab/help/ (specifically part 3 & 7) Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Sakana Oji Posted January 4, 2019 Author Share Posted January 4, 2019 Okay Bolty Quote Big McThankies From McSpankies! Link to comment Share on other sites More sharing options...
Sakana Oji Posted January 13, 2019 Author Share Posted January 13, 2019 (edited) Okay here's my real actual code that I first worked on (not recreated): // Name: Crayon // Submenu: Artistic // Author: Sakana Oji // Title: Crayon // Desc: Gives the image a crayon effect // Keywords: crayon artistic // URL: // Help: #region UICode DoubleSliderControl Amount1 = 3; // [0,10] Thickness DoubleSliderControl Amount2 = 0; // [0,200] Minimum Scatter Radius IntSliderControl Amount3 = 2; // [1,8] Quality IntSliderControl Amount4=1; // [1,5] Radius IntSliderControl Amount5=10; // [0,100] Percentile #endregion // Here is the main render loop function void Render(Surface dst, Surface src, Rectangle rect) { // Setup for calling the Frosted Glass effect FrostedGlassEffect frostedEffect = new FrostedGlassEffect(); PropertyCollection frostedProps; // Call the Frosted Glass function frostedEffect.Render(new Rectangle[1] { rect }, 0, 1); // Adjust median MedianEffect medianEffect = new MedianEffect(); PropertyCollection medianProps = medianEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken medianParameters = new PropertyBasedEffectConfigToken(medianProps); medianParameters.SetPropertyValue(MedianEffect.PropertyNames.Radius, Amount4); medianParameters.SetPropertyValue(MedianEffect.PropertyNames.Percentile, Amount5); medianEffect.SetRenderInfo(medianParameters, new RenderArgs(dst), new RenderArgs(dst)); // Call the Median function medianEffect.Render(new Rectangle[1] {rect},0,1); } Edited January 13, 2019 by Sakana Oji Quote Big McThankies From McSpankies! Link to comment Share on other sites More sharing options...
ReMake Posted January 13, 2019 Share Posted January 13, 2019 @Sakana Oji, I appreciate your youthful enthusiasm and maximalism, but you are violating item 2) of The Rules (I hope the admins and mods will be lenient to you again - we all make mistakes sometimes). No offense, but I suggest you create your own topic in the proper thread as it did @xod with its Unfinished plugins. Quote Link to comment Share on other sites More sharing options...
Sakana Oji Posted January 13, 2019 Author Share Posted January 13, 2019 Okay, none taken Quote Big McThankies From McSpankies! Link to comment Share on other sites More sharing options...
ReMake Posted January 13, 2019 Share Posted January 13, 2019 Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 13, 2019 Share Posted January 13, 2019 As ReMake has indicated, this discussion has wandered off the original topic. I've split into it's own thread. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.