-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lightspotview.hpp
75 lines (53 loc) · 2.27 KB
/
lightspotview.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Copyright (c) 2017-2023 plan44.ch / Lukas Zeller, Zurich, Switzerland
//
// Author: Lukas Zeller <[email protected]>
//
// This file is part of p44lrgraphics.
//
// p44lrgraphics is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// p44lrgraphics is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with p44lrgraphics. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef __p44lrgraphics_lightspotview_hpp__
#define __p44lrgraphics_lightspotview_hpp__
#include "p44lrg_common.hpp"
#include "coloreffectview.hpp"
namespace p44 {
class LightSpotView : public ColorEffectView
{
typedef ColorEffectView inherited;
public :
LightSpotView();
virtual ~LightSpotView();
static const char* staticTypeName() { return "lightspot"; };
static P44View* newInstance() { return new LightSpotView; };
virtual const char* getTypeName() const P44_OVERRIDE { return staticTypeName(); }
/// get content pixel color
/// @param aPt content coordinate
/// @note aPt is NOT guaranteed to be within actual content as defined by contentSize
/// implementation must check this!
virtual PixelColor contentColorAt(PixelPoint aPt) P44_OVERRIDE;
protected:
/// color effect params have changed
virtual void recalculateColoring() P44_OVERRIDE;
/// set content size in a way following the appearance of the content, such that a relative size of 1 is the "correct" default
virtual void setContentAppearanceSize(double aRelDx, double aRelDy) P44_OVERRIDE;
/// geometry has changed
virtual void geometryChanged(PixelRect aOldFrame, PixelRect aOldContent) P44_OVERRIDE;
private:
void recalculateContentRect();
};
typedef boost::intrusive_ptr<LightSpotView> LightSpotViewPtr;
} // namespace p44
#endif /* __p44lrgraphics_lightspotview_hpp__ */