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.

102 lines
4.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_LOWLEVELGRAPHICSCONTEXT_H_INCLUDED
  18. #define JUCE_LOWLEVELGRAPHICSCONTEXT_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. Interface class for graphics context objects, used internally by the Graphics class.
  22. Users are not supposed to create instances of this class directly - do your drawing
  23. via the Graphics object instead.
  24. It's a base class for different types of graphics context, that may perform software-based
  25. or OS-accelerated rendering.
  26. E.g. the LowLevelGraphicsSoftwareRenderer renders onto an image in memory, but other
  27. subclasses could render directly to a windows HDC, a Quartz context, or an OpenGL
  28. context.
  29. */
  30. class JUCE_API LowLevelGraphicsContext
  31. {
  32. protected:
  33. //==============================================================================
  34. LowLevelGraphicsContext();
  35. public:
  36. virtual ~LowLevelGraphicsContext();
  37. /** Returns true if this device is vector-based, e.g. a printer. */
  38. virtual bool isVectorDevice() const = 0;
  39. //==============================================================================
  40. /** Moves the origin to a new position.
  41. The coordinates are relative to the current origin, and indicate the new position
  42. of (0, 0).
  43. */
  44. virtual void setOrigin (Point<int>) = 0;
  45. virtual void addTransform (const AffineTransform&) = 0;
  46. virtual float getPhysicalPixelScaleFactor() = 0;
  47. virtual bool clipToRectangle (const Rectangle<int>&) = 0;
  48. virtual bool clipToRectangleList (const RectangleList<int>&) = 0;
  49. virtual void excludeClipRectangle (const Rectangle<int>&) = 0;
  50. virtual void clipToPath (const Path&, const AffineTransform&) = 0;
  51. virtual void clipToImageAlpha (const Image&, const AffineTransform&) = 0;
  52. virtual bool clipRegionIntersects (const Rectangle<int>&) = 0;
  53. virtual Rectangle<int> getClipBounds() const = 0;
  54. virtual bool isClipEmpty() const = 0;
  55. virtual void saveState() = 0;
  56. virtual void restoreState() = 0;
  57. virtual void beginTransparencyLayer (float opacity) = 0;
  58. virtual void endTransparencyLayer() = 0;
  59. //==============================================================================
  60. virtual void setFill (const FillType&) = 0;
  61. virtual void setOpacity (float) = 0;
  62. virtual void setInterpolationQuality (Graphics::ResamplingQuality) = 0;
  63. //==============================================================================
  64. virtual void fillRect (const Rectangle<int>&, bool replaceExistingContents) = 0;
  65. virtual void fillRect (const Rectangle<float>&) = 0;
  66. virtual void fillRectList (const RectangleList<float>&) = 0;
  67. virtual void fillPath (const Path&, const AffineTransform&) = 0;
  68. virtual void drawImage (const Image&, const AffineTransform&) = 0;
  69. virtual void drawLine (const Line<float>&) = 0;
  70. virtual void setFont (const Font&) = 0;
  71. virtual const Font& getFont() = 0;
  72. virtual void drawGlyph (int glyphNumber, const AffineTransform&) = 0;
  73. virtual bool drawTextLayout (const AttributedString&, const Rectangle<float>&) { return false; }
  74. };
  75. #endif // JUCE_LOWLEVELGRAPHICSCONTEXT_H_INCLUDED