The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

101 lines
3.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCE_LOWLEVELGRAPHICSSOFTWARERENDERER_JUCEHEADER__
  19. #define __JUCE_LOWLEVELGRAPHICSSOFTWARERENDERER_JUCEHEADER__
  20. #include "juce_LowLevelGraphicsContext.h"
  21. #ifndef DOXYGEN
  22. #include "../native/juce_RenderingHelpers.h"
  23. #endif
  24. //==============================================================================
  25. /**
  26. A lowest-common-denominator implementation of LowLevelGraphicsContext that does all
  27. its rendering in memory.
  28. User code is not supposed to create instances of this class directly - do all your
  29. rendering via the Graphics class instead.
  30. */
  31. class JUCE_API LowLevelGraphicsSoftwareRenderer : public LowLevelGraphicsContext
  32. {
  33. public:
  34. //==============================================================================
  35. LowLevelGraphicsSoftwareRenderer (const Image& imageToRenderOn);
  36. LowLevelGraphicsSoftwareRenderer (const Image& imageToRenderOn, const Point<int>& origin, const RectangleList& initialClip);
  37. ~LowLevelGraphicsSoftwareRenderer();
  38. bool isVectorDevice() const;
  39. void setOrigin (int x, int y);
  40. void addTransform (const AffineTransform&);
  41. float getScaleFactor();
  42. bool clipToRectangle (const Rectangle<int>&);
  43. bool clipToRectangleList (const RectangleList&);
  44. void excludeClipRectangle (const Rectangle<int>&);
  45. void clipToPath (const Path&, const AffineTransform&);
  46. void clipToImageAlpha (const Image&, const AffineTransform&);
  47. bool clipRegionIntersects (const Rectangle<int>&);
  48. Rectangle<int> getClipBounds() const;
  49. bool isClipEmpty() const;
  50. void saveState();
  51. void restoreState();
  52. void beginTransparencyLayer (float opacity);
  53. void endTransparencyLayer();
  54. void setFill (const FillType&);
  55. void setOpacity (float opacity);
  56. void setInterpolationQuality (Graphics::ResamplingQuality);
  57. void fillRect (const Rectangle<int>&, bool replaceExistingContents);
  58. void fillPath (const Path&, const AffineTransform&);
  59. void drawImage (const Image&, const AffineTransform&);
  60. void drawLine (const Line <float>& line);
  61. void drawVerticalLine (int x, float top, float bottom);
  62. void drawHorizontalLine (int x, float top, float bottom);
  63. void setFont (const Font&);
  64. const Font& getFont();
  65. void drawGlyph (int glyphNumber, float x, float y);
  66. void drawGlyph (int glyphNumber, const AffineTransform&);
  67. #ifndef DOXYGEN
  68. class SavedState;
  69. #endif
  70. protected:
  71. RenderingHelpers::SavedStateStack<SavedState> savedState;
  72. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LowLevelGraphicsSoftwareRenderer);
  73. };
  74. #endif // __JUCE_LOWLEVELGRAPHICSSOFTWARERENDERER_JUCEHEADER__