Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

juce_GlowEffect.h 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. A component effect that adds a coloured blur around the component's contents.
  18. (This will only work on non-opaque components).
  19. @see Component::setComponentEffect, DropShadowEffect
  20. @tags{Graphics}
  21. */
  22. class JUCE_API GlowEffect : public ImageEffectFilter
  23. {
  24. public:
  25. //==============================================================================
  26. /** Creates a default 'glow' effect.
  27. To customise its appearance, use the setGlowProperties() method.
  28. */
  29. GlowEffect();
  30. /** Destructor. */
  31. ~GlowEffect() override;
  32. //==============================================================================
  33. /** Sets the glow's radius and colour.
  34. The radius is how large the blur should be, and the colour is
  35. used to render it (for a less intense glow, lower the colour's
  36. opacity).
  37. */
  38. void setGlowProperties (float newRadius,
  39. Colour newColour,
  40. Point<int> offset = {});
  41. //==============================================================================
  42. /** @internal */
  43. void applyEffect (Image&, Graphics&, float scaleFactor, float alpha) override;
  44. private:
  45. //==============================================================================
  46. float radius = 2.0f;
  47. Colour colour { Colours::white };
  48. Point<int> offset;
  49. JUCE_LEAK_DETECTOR (GlowEffect)
  50. };
  51. } // namespace juce