PCL
Pen.h
Go to the documentation of this file.
1
// ____ ______ __
2
// / __ \ / ____// /
3
// / /_/ // / / /
4
// / ____// /___ / /___ PixInsight Class Library
5
// /_/ \____//_____/ PCL 2.7.0
6
// ----------------------------------------------------------------------------
7
// pcl/Pen.h - Released 2024-06-18T15:48:54Z
8
// ----------------------------------------------------------------------------
9
// This file is part of the PixInsight Class Library (PCL).
10
// PCL is a multiplatform C++ framework for development of PixInsight modules.
11
//
12
// Copyright (c) 2003-2024 Pleiades Astrophoto S.L. All Rights Reserved.
13
//
14
// Redistribution and use in both source and binary forms, with or without
15
// modification, is permitted provided that the following conditions are met:
16
//
17
// 1. All redistributions of source code must retain the above copyright
18
// notice, this list of conditions and the following disclaimer.
19
//
20
// 2. All redistributions in binary form must reproduce the above copyright
21
// notice, this list of conditions and the following disclaimer in the
22
// documentation and/or other materials provided with the distribution.
23
//
24
// 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25
// of their contributors, may be used to endorse or promote products derived
26
// from this software without specific prior written permission. For written
27
// permission, please contact info@pixinsight.com.
28
//
29
// 4. All products derived from this software, in any form whatsoever, must
30
// reproduce the following acknowledgment in the end-user documentation
31
// and/or other materials provided with the product:
32
//
33
// "This product is based on software from the PixInsight project, developed
34
// by Pleiades Astrophoto and its contributors (https://pixinsight.com/)."
35
//
36
// Alternatively, if that is where third-party acknowledgments normally
37
// appear, this acknowledgment must be reproduced in the product itself.
38
//
39
// THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44
// EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45
// INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46
// DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49
// POSSIBILITY OF SUCH DAMAGE.
50
// ----------------------------------------------------------------------------
51
52
#ifndef __PCL_Pen_h
53
#define __PCL_Pen_h
54
56
57
#ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
58
59
#include <
pcl/Defs.h
>
60
61
#include <
pcl/Brush.h
>
62
#include <
pcl/Color.h
>
63
#include <
pcl/UIObject.h
>
64
65
#endif
// __PCL_BUILDING_PIXINSIGHT_APPLICATION
66
67
namespace
pcl
68
{
69
70
// ----------------------------------------------------------------------------
71
85
namespace
PenStyle
86
{
87
enum
value_type
88
{
89
Empty,
// Nothing drawn
90
Solid,
// _____________
91
Dash,
// _ _ _ _ _ _ _
92
Dot,
// .............
93
DashDot,
// _._._._._._._
94
DashDotDot,
// _.._.._.._.._
95
96
NumberOfPenStyles
97
};
98
}
99
100
// ----------------------------------------------------------------------------
101
112
namespace
PenCap
113
{
114
enum
value_type
115
{
116
Flat,
// Square caps not reaching the end points of lines
117
Square,
// Square caps extending beyond end points by half the line width
118
Round,
// Round caps centered at the line end points
119
120
NumberOfPenCaps
121
};
122
}
123
124
// ----------------------------------------------------------------------------
125
136
namespace
PenJoin
137
{
138
enum
value_type
139
{
140
Miter,
// Lines are joined by sharp corners
141
Bevel,
// Lines are joined by flat corners
142
Round,
// Circular arcs are drawn between lines
143
144
NumberOfPenJoins
145
};
146
}
147
148
// ----------------------------------------------------------------------------
149
150
#ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
151
152
class
PCL_CLASS Brush;
153
154
// ----------------------------------------------------------------------------
155
162
class
PCL_CLASS
Pen
:
public
UIObject
163
{
164
public
:
165
169
using
style = PenStyle::value_type;
170
174
using
cap = PenCap::value_type;
175
179
using
join = PenJoin::value_type;
180
185
Pen
(
RGBA
color = 0xff000000,
float
width = 0, style s = PenStyle::Solid,
186
cap c = PenCap::Square, join j = PenJoin::Miter );
187
192
Pen
(
const
Pen
& p ) :
UIObject
( p )
193
{
194
}
195
201
~Pen
()
override
202
{
203
}
204
212
Pen
& operator =(
const
Pen
& p )
213
{
214
SetHandle( p.handle );
215
return
*
this
;
216
}
217
222
static
Pen
&
Null
();
223
233
float
Width
()
const
;
234
244
void
SetWidth
(
float
w );
245
251
RGBA
Color
()
const
;
252
258
void
SetColor
(
RGBA
color );
259
265
style
Style
()
const
;
266
273
bool
IsSolid
()
const
274
{
275
return
Style() == PenStyle::Solid;
276
}
277
284
bool
IsEmpty
()
const
285
{
286
return
Style() == PenStyle::Empty;
287
}
288
294
void
SetStyle
( style );
295
301
cap
Cap
()
const
;
302
308
void
SetCap
( cap c );
309
315
join
Join
()
const
;
316
322
void
SetJoin
( join j );
323
329
pcl::Brush
Brush
()
const
;
330
337
pcl::Brush
GetBrush
()
const
338
{
339
return
this->
Brush
();
340
}
341
347
void
SetBrush
(
const
pcl::Brush
& brush );
348
349
private
:
350
351
Pen
(
void
* h ) :
UIObject
( h )
352
{
353
}
354
355
void
* CloneHandle()
const override
;
356
357
friend
class
GraphicsContextBase
;
358
friend
class
Graphics
;
359
friend
class
VectorGraphics
;
360
};
361
362
// ----------------------------------------------------------------------------
363
364
#endif
// __PCL_BUILDING_PIXINSIGHT_APPLICATION
365
366
}
// pcl
367
368
#endif
// __PCL_Pen_h
369
370
// ----------------------------------------------------------------------------
371
// EOF pcl/Pen.h - Released 2024-06-18T15:48:54Z
Brush.h
Color.h
Defs.h
UIObject.h
pcl::Brush
Client-side interface to a PixInsight Brush object.
Definition:
Brush.h:158
pcl::GraphicsContextBase
Base class of client-side interface classes to PixInsight graphics contexts
Definition:
Graphics.h:208
pcl::Graphics
Client-side interface to a PixInsight graphics context object.
Definition:
Graphics.h:646
pcl::Pen
Client-side interface to a PixInsight Pen object.
Definition:
Pen.h:163
pcl::Pen::Color
RGBA Color() const
pcl::Pen::GetBrush
pcl::Brush GetBrush() const
Definition:
Pen.h:337
pcl::Pen::SetCap
void SetCap(cap c)
pcl::Pen::SetWidth
void SetWidth(float w)
pcl::Pen::SetBrush
void SetBrush(const pcl::Brush &brush)
pcl::Pen::Join
join Join() const
pcl::Pen::IsSolid
bool IsSolid() const
Definition:
Pen.h:273
pcl::Pen::Pen
Pen(const Pen &p)
Definition:
Pen.h:192
pcl::Pen::Pen
Pen(RGBA color=0xff000000, float width=0, style s=PenStyle::Solid, cap c=PenCap::Square, join j=PenJoin::Miter)
pcl::Pen::Style
style Style() const
pcl::Pen::Brush
pcl::Brush Brush() const
pcl::Pen::Null
static Pen & Null()
pcl::Pen::SetJoin
void SetJoin(join j)
pcl::Pen::IsEmpty
bool IsEmpty() const
Definition:
Pen.h:284
pcl::Pen::SetColor
void SetColor(RGBA color)
pcl::Pen::Width
float Width() const
pcl::Pen::SetStyle
void SetStyle(style)
pcl::Pen::Cap
cap Cap() const
pcl::Pen::~Pen
~Pen() override
Definition:
Pen.h:201
pcl::UIObject
Root base class for all user interface objects.
Definition:
UIObject.h:95
pcl::VectorGraphics
Client-side interface to a PixInsight vector graphics context.
Definition:
Graphics.h:1463
pcl::RGBA
uint32 RGBA
Definition:
Color.h:92
pcl
PCL root namespace.
Definition:
AbstractImage.h:77
Pen.h
Generated on Wed Jul 3 2024 16:34:47 for PCL by
1.9.1