Jump to content

BoltBait

Administrator
  • Posts

    15,654
  • Joined

  • Last visited

  • Days Won

    390

Everything posted by BoltBait

  1. Try this: viewtopic.php?f=15&t=21605 or this: http://www.getpaint.net/doc/latest/en/index.html
  2. Hex value input would be a job for Rick. I am simply using the IndirectUI color control. If he was to enhance it to allow for hex input, my effect would automatically use it.
  3. Thanks! That's about the best way to adjust the amount of the effect. I'm glad you figured it out. Don't make me hurt you. I don't think you have any idea how complicated this effect is... to give you an idea, most of my plugins are in the 50 line range. This one is over 600 lines. :shock: By using the "Use alternate lighting direction" check box and swapping the Highlight and Shadow colors, you do have 4 different lighting directions. More than that would make me tear out all of my hair. Sorry, if 4 isn't enough, try what Oma suggests (rotating the layer, do the effect, rotate back, etc.)
  4. If the tools menu looked like this: I would never open the tools docker window. I almost always have it closed anyway and just use the keyboard shortcuts. Of course, there's a few I don't know...
  5. Ugh! Just what I need... more features when I haven't even debugged the current features yet! :evil:
  6. I recommend reading this page: http://boltbait.googlepages.com/install And, if that doesn't work for you, post your problems here: viewtopic.php?f=16&t=2023
  7. So when's it coming? :wink: Well, everything's ready on my end. However, Curtis was working on the text editor itself and and added some pretty cool features, however it is in a pretty bad shape right now. I have some bugs to track down in that space before I can release CodeLab v1.3.
  8. Can we start a list of plugins that are not working? If known, can we also list the authors of those plugins?
  9. Wow! I'm impressed. It is fast, MUCH better than the built-in effect, and easier to use. I tried it on a bunch of my own pictures (I never use red-eye flash) and it worked perfectly. I rarely had to change it from the default setting. It just did the job.
  10. Sounds like you need to update your drop-shadow plugin... viewtopic.php?f=16&t=22881
  11. Heh, no wonder then - all my plugin designs are learnt from your examples! :wink: Well, that's what you get for listening to me...
  12. Object > Feather uses transparency to determine where to feather. Selection > Feather uses the "marching ants" selection to determine where to feather. Both are useful in different situations.
  13. Please read the rules: viewtopic.php?f=20&t=3446 See #6.
  14. I'm writing a page to describe how to write complex effects with CodeLab ("complex" meaning effects that call other effects). Here's the script I plan on using: #region UICode int Amount1=10; // [0,100] Blur Amount #endregion // Setup for using a specific blend op private UserBlendOps.DarkenBlendOp darkenOp = new UserBlendOps.DarkenBlendOp(); unsafe void Render(Surface dst, Surface src, Rectangle rect) { // Setup for calling the Gaussian Blur effect GaussianBlurEffect blurEffect = new GaussianBlurEffect(); PaintDotNet.PropertySystem.PropertyCollection blurProps; // Call the Gaussian Blur function blurProps = blurEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken BlurParameters = new PropertyBasedEffectConfigToken(blurProps); BlurParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount1); blurEffect.SetRenderInfo(BlurParameters, new RenderArgs(dst), new RenderArgs(src)); blurEffect.Render(new Rectangle[1] {rect},0,1); // Now in the main render loop, the dst canvas has a blurred version of the src canvas for (int y = rect.Top; y { ColorBgra* srcPtr = src.GetPointAddressUnchecked(rect.Left, y); ColorBgra* dstPtr = dst.GetPointAddressUnchecked(rect.Left, y); for (int x = rect.Left; x { ColorBgra CurrentPixel = *srcPtr; // TODO: Add additional pixel processing code here CurrentPixel = darkenOp.Apply(*dstPtr, CurrentPixel); *dstPtr = CurrentPixel; srcPtr++; dstPtr++; } } } Perhaps, you can get something out of the sample code without all of my flowery speech... I think you're really going to like the next version of CodeLab
  15. Fixed: using System; using System.Drawing; using PaintDotNet; using PaintDotNet.Effects; using PaintDotNet.PropertySystem; using System.Collections.Generic; namespace Sharpen_ { public class EffectPlugin : PaintDotNet.Effects.Effect { public static string StaticName { get { return "Sharpen+"; } } public static Bitmap StaticImage { get { return new Bitmap(typeof(EffectPlugin), "EffectPluginIcon.png"); } } public static string StaticSubMenuName { get { return SubmenuNames.Photo; } } public EffectPlugin() : base(StaticName, StaticImage, StaticSubMenuName, EffectFlags.Configurable) { this.blurEffect = new GaussianBlurEffect(); this.blurProps = this.blurEffect.CreatePropertyCollection(); } public override EffectConfigDialog CreateConfigDialog() { return new EffectPluginConfigDialog(); } private GaussianBlurEffect blurEffect; private PropertyCollection blurProps; public override unsafe void Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, int startIndex, int length) { EffectPluginConfigToken token = (EffectPluginConfigToken)parameters; PdnRegion selectionRegion = EnvironmentParameters.GetSelection(srcArgs.Bounds); Rectangle selection = EnvironmentParameters.GetSelection(srcArgs.Bounds).GetBoundsInt(); int rad = token.Radius; int amt = token.Amount; this.blurEffect.Render(rois, startIndex, length); for (int i = startIndex; i { Rectangle roi = rois[i]; for (int y = roi.Top; y { ColorBgra* srcPtr = srcArgs.Surface.GetPointAddressUnchecked(roi.Left, y); ColorBgra* dstPtr = dstArgs.Surface.GetPointAddressUnchecked(roi.Left, y); ColorBgra CurrentPixel; ColorBgra OrigPixel; byte r, g, b, ro, go, bo, ao, ry, by, gy; for (int x = roi.Left; x { CurrentPixel = dstArgs.Surface[x, y]; r = CurrentPixel.R; g = CurrentPixel.G; b = CurrentPixel.B; vf = (float)CurrentPixel.GetIntensityByte(); if (selectionRegion.IsVisible(x, y)) { OrigPixel = srcArgs.Surface[x, y]; ro = OrigPixel.R; go = OrigPixel.G; bo = OrigPixel.B; ao = OrigPixel.A; // ..... // pixel level calculations here // ..... OrigPixel = ColorBgra.FromBgra(by, gy, ry, ao); *dstPtr = OrigPixel; ++srcPtr; ++dstPtr; } } } } } } } The problem is in the unsafe pointers template. The bug is in these two lines: ColorBgra* srcPtr = srcArgs.Surface.GetPointAddress(roi.X, roi.Y); ColorBgra* dstPtr = dstArgs.Surface.GetPointAddress(roi.X, roi.Y); They should read: ColorBgra* srcPtr = srcArgs.Surface.GetPointAddressUnchecked(roi.Left, y); ColorBgra* dstPtr = dstArgs.Surface.GetPointAddressUnchecked(roi.Left, y); You see where those new values come from? See, roi.Left is the definition of x from the next line, y is from the previous line. Also, you'll want to use GetPointAddressUnchecked for full speed benefit. I fell victim to this error as well. I rebuilt all of my plugins last night. BTW, the reason for this is simple. Prior to 3.36, Paint.NET always called your render loop with ROI's of 1px tall. Now, it calls it with ROI's of 2px tall. So, the error in the template was always getting the address of the first line of the ROI for processing. With the change I show, you now get the address of the proper line to work on.
  16. Major update to the plugin pack today. I rewrote most stuff, added some stuff, and fixed my Rainbow Palette file. Enjoy. 8) P.S. I know the effects are good, give me some feedback on the new Palette file!
  17. It really depends. They are both different effects. Personally, I use both depending on the situation.
  18. Yes. There is a programming issue with the plugin that surfaced with the new way plugins are rendered with Paint.NET 3.36. I have a fix and will update the first post in this thread with the fix right now.
  19. More info here: viewtopic.php?f=10&t=23939 Yes, screenshots would be great!
×
×
  • Create New...