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_LowLevelGraphicsContext.h 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. namespace juce
  20. {
  21. //==============================================================================
  22. /**
  23. Interface class for graphics context objects, used internally by the Graphics class.
  24. Users are not supposed to create instances of this class directly - do your drawing
  25. via the Graphics object instead.
  26. It's a base class for different types of graphics context, that may perform software-based
  27. or OS-accelerated rendering.
  28. E.g. the LowLevelGraphicsSoftwareRenderer renders onto an image in memory, but other
  29. subclasses could render directly to a windows HDC, a Quartz context, or an OpenGL
  30. context.
  31. */
  32. class JUCE_API LowLevelGraphicsContext
  33. {
  34. protected:
  35. //==============================================================================
  36. LowLevelGraphicsContext();
  37. public:
  38. virtual ~LowLevelGraphicsContext();
  39. /** Returns true if this device is vector-based, e.g. a printer. */
  40. virtual bool isVectorDevice() const = 0;
  41. //==============================================================================
  42. /** Moves the origin to a new position.
  43. The coordinates are relative to the current origin, and indicate the new position
  44. of (0, 0).
  45. */
  46. virtual void setOrigin (Point<int>) = 0;
  47. virtual void addTransform (const AffineTransform&) = 0;
  48. virtual float getPhysicalPixelScaleFactor() = 0;
  49. virtual bool clipToRectangle (const Rectangle<int>&) = 0;
  50. virtual bool clipToRectangleList (const RectangleList<int>&) = 0;
  51. virtual void excludeClipRectangle (const Rectangle<int>&) = 0;
  52. virtual void clipToPath (const Path&, const AffineTransform&) = 0;
  53. virtual void clipToImageAlpha (const Image&, const AffineTransform&) = 0;
  54. virtual bool clipRegionIntersects (const Rectangle<int>&) = 0;
  55. virtual Rectangle<int> getClipBounds() const = 0;
  56. virtual bool isClipEmpty() const = 0;
  57. virtual void saveState() = 0;
  58. virtual void restoreState() = 0;
  59. virtual void beginTransparencyLayer (float opacity) = 0;
  60. virtual void endTransparencyLayer() = 0;
  61. //==============================================================================
  62. virtual void setFill (const FillType&) = 0;
  63. virtual void setOpacity (float) = 0;
  64. virtual void setInterpolationQuality (Graphics::ResamplingQuality) = 0;
  65. //==============================================================================
  66. virtual void fillRect (const Rectangle<int>&, bool replaceExistingContents) = 0;
  67. virtual void fillRect (const Rectangle<float>&) = 0;
  68. virtual void fillRectList (const RectangleList<float>&) = 0;
  69. virtual void fillPath (const Path&, const AffineTransform&) = 0;
  70. virtual void drawImage (const Image&, const AffineTransform&) = 0;
  71. virtual void drawLine (const Line<float>&) = 0;
  72. virtual void setFont (const Font&) = 0;
  73. virtual const Font& getFont() = 0;
  74. virtual void drawGlyph (int glyphNumber, const AffineTransform&) = 0;
  75. virtual bool drawTextLayout (const AttributedString&, const Rectangle<float>&) { return false; }
  76. };
  77. } // namespace juce