Flutter Engine
The Flutter Engine
third_party
skia
include
private
base
SkTPin.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef SkTPin_DEFINED
9
#define SkTPin_DEFINED
10
11
#include <algorithm>
12
13
/** @return x pinned (clamped) between lo and hi, inclusively.
14
15
Unlike std::clamp(), SkTPin() always returns a value between lo and hi.
16
If x is NaN, SkTPin() returns lo but std::clamp() returns NaN.
17
*/
18
template
<
typename
T>
19
static
constexpr
const
T
&
SkTPin
(
const
T
&
x
,
const
T
& lo,
const
T
& hi) {
20
return
std::max
(lo,
std::min
(
x
, hi));
21
}
22
23
#endif
SkTPin
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
Definition:
SkTPin.h:19
max
static float max(float r, float g, float b)
Definition:
hsl.cpp:49
min
static float min(float r, float g, float b)
Definition:
hsl.cpp:48
x
double x
Definition:
mouse-input-test.cc:82
T
#define T
Definition:
precompiler.cc:65
Generated on Sun Jun 23 2024 21:56:03 for Flutter Engine by
1.9.4