Bump version to 6.4-15
[LibreOffice.git] / include / basegfx / utils / b2dclipstate.hxx
blob66fe72d9506cb5b0a3efe8a5214c46c4e4f75fc5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_BASEGFX_UTILS_B2DCLIPSTATE_HXX
21 #define INCLUDED_BASEGFX_UTILS_B2DCLIPSTATE_HXX
23 #include <o3tl/cow_wrapper.hxx>
24 #include <basegfx/basegfxdllapi.h>
27 namespace basegfx
29 class B2DRange;
30 class B2DPolyPolygon;
31 class B2DHomMatrix;
33 namespace utils
35 class ImplB2DClipState;
37 /** This class provides an optimized, symbolic clip state for graphical output
39 Having a current 'clip' state is a common attribute of
40 almost all graphic output APIs, most of which internally
41 represent it via a list of rectangular bands. In contrast,
42 this implementation purely uses symbolic clips, but in a
43 quite efficient manner, deferring actual evaluation until
44 a clip representation is requested, and using faster code
45 paths for common special cases (like all-rectangle clips)
47 class BASEGFX_DLLPUBLIC B2DClipState
49 public:
50 typedef o3tl::cow_wrapper< ImplB2DClipState > ImplType;
52 private:
53 ImplType mpImpl;
55 public:
56 /// Init clip, in 'cleared' state - everything is visible
57 B2DClipState();
58 ~B2DClipState();
59 B2DClipState( const B2DClipState& );
60 B2DClipState( B2DClipState&& );
61 explicit B2DClipState( const B2DPolyPolygon& );
62 B2DClipState& operator=( const B2DClipState& );
63 B2DClipState& operator=( B2DClipState&& );
65 /// Set clip to 'null' - nothing is visible
66 void makeNull();
68 /// returns true when clip is 'cleared' - everything is visible
69 bool isCleared() const;
71 bool operator==(const B2DClipState&) const;
72 bool operator!=(const B2DClipState&) const;
74 void unionRange(const B2DRange& );
75 void unionPolyPolygon(const B2DPolyPolygon& );
77 void intersectRange(const B2DRange& );
78 void intersectPolyPolygon(const B2DPolyPolygon& );
80 void subtractRange(const B2DRange& );
81 void subtractPolyPolygon(const B2DPolyPolygon& );
83 void xorRange(const B2DRange& );
84 void xorPolyPolygon(const B2DPolyPolygon& );
86 void transform(const B2DHomMatrix& );
88 B2DPolyPolygon const & getClipPoly() const;
93 #endif // INCLUDED_BASEGFX_UTILS_B2DCLIPSTATE_HXX
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */