openshot-audio  0.1.7
juce_LowLevelGraphicsPostScriptRenderer.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_LOWLEVELGRAPHICSPOSTSCRIPTRENDERER_H_INCLUDED
26 #define JUCE_LOWLEVELGRAPHICSPOSTSCRIPTRENDERER_H_INCLUDED
27 
28 
29 //==============================================================================
36 {
37 public:
38  //==============================================================================
40  const String& documentTitle,
41  int totalWidth,
42  int totalHeight);
43 
45 
46  //==============================================================================
47  bool isVectorDevice() const override;
48  void setOrigin (Point<int>) override;
49  void addTransform (const AffineTransform&) override;
50  float getPhysicalPixelScaleFactor() override;
51 
52  bool clipToRectangle (const Rectangle<int>&) override;
53  bool clipToRectangleList (const RectangleList<int>&) override;
54  void excludeClipRectangle (const Rectangle<int>&) override;
55  void clipToPath (const Path&, const AffineTransform&) override;
56  void clipToImageAlpha (const Image&, const AffineTransform&) override;
57 
58  void saveState() override;
59  void restoreState() override;
60 
61  void beginTransparencyLayer (float) override;
62  void endTransparencyLayer() override;
63 
64  bool clipRegionIntersects (const Rectangle<int>&) override;
65  Rectangle<int> getClipBounds() const override;
66  bool isClipEmpty() const override;
67 
68  //==============================================================================
69  void setFill (const FillType&) override;
70  void setOpacity (float) override;
72 
73  //==============================================================================
74  void fillRect (const Rectangle<int>&, bool replaceExistingContents) override;
75  void fillRect (const Rectangle<float>&) override;
76  void fillRectList (const RectangleList<float>&) override;
77  void fillPath (const Path&, const AffineTransform&) override;
78  void drawImage (const Image&, const AffineTransform&) override;
79  void drawLine (const Line <float>&) override;
80 
81  //==============================================================================
82  const Font& getFont() override;
83  void setFont (const Font&) override;
84  void drawGlyph (int glyphNumber, const AffineTransform&) override;
85 
86 protected:
87  //==============================================================================
89  int totalWidth, totalHeight;
90  bool needToClip;
92 
93  struct SavedState
94  {
95  SavedState();
96  ~SavedState();
97 
99  int xOffset, yOffset;
102 
103  private:
104  SavedState& operator= (const SavedState&);
105  };
106 
108 
109  void writeClip();
110  void writeColour (Colour colour);
111  void writePath (const Path&) const;
112  void writeXY (float x, float y) const;
113  void writeTransform (const AffineTransform&) const;
114  void writeImage (const Image&, int sx, int sy, int maxW, int maxH) const;
115 
117 };
118 
119 
120 
121 #endif // JUCE_LOWLEVELGRAPHICSPOSTSCRIPTRENDERER_H_INCLUDED
virtual bool isClipEmpty() const =0
virtual bool clipToRectangleList(const RectangleList< int > &)=0
Colour lastColour
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:91
ResamplingQuality
Definition: juce_GraphicsContext.h:465
Definition: juce_Font.h:39
virtual void fillPath(const Path &, const AffineTransform &)=0
OutputStream & out
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:88
virtual void clipToPath(const Path &, const AffineTransform &)=0
Definition: juce_Line.h:44
virtual void drawGlyph(int glyphNumber, const AffineTransform &)=0
int totalWidth
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:89
virtual void fillRect(const Rectangle< int > &, bool replaceExistingContents)=0
virtual void restoreState()=0
virtual void setOpacity(float)=0
virtual void excludeClipRectangle(const Rectangle< int > &)=0
virtual void setInterpolationQuality(Graphics::ResamplingQuality)=0
Definition: juce_String.h:43
FillType fillType
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:100
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:93
virtual void clipToImageAlpha(const Image &, const AffineTransform &)=0
#define JUCE_API
Definition: juce_StandardHeader.h:139
virtual void setOrigin(Point< int >)=0
virtual void setFill(const FillType &)=0
virtual void addTransform(const AffineTransform &)=0
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:35
virtual Rectangle< int > getClipBounds() const =0
Font font
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:101
virtual void drawLine(const Line< float > &)=0
Definition: juce_Rectangle.h:36
virtual void drawImage(const Image &, const AffineTransform &)=0
Definition: juce_Path.h:62
Definition: juce_Colour.h:35
virtual void beginTransparencyLayer(float opacity)=0
virtual void endTransparencyLayer()=0
int yOffset
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:99
Definition: juce_OutputStream.h:42
virtual void setFont(const Font &)=0
Definition: juce_FillType.h:38
virtual float getPhysicalPixelScaleFactor()=0
virtual bool clipRegionIntersects(const Rectangle< int > &)=0
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
virtual bool isVectorDevice() const =0
Definition: juce_Image.h:54
virtual const Font & getFont()=0
virtual bool clipToRectangle(const Rectangle< int > &)=0
Definition: juce_LowLevelGraphicsContext.h:43
virtual void fillRectList(const RectangleList< float > &)=0
Definition: juce_AffineTransform.h:40
virtual void saveState()=0
OwnedArray< SavedState > stateStack
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:107
bool needToClip
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:90
RectangleList< int > clip
Definition: juce_LowLevelGraphicsPostScriptRenderer.h:98