Fix copyright headers.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Color.h"
|
||||
#include <algorithm>
|
||||
@@ -28,8 +27,9 @@ ColorHSB ColorHSB::FromRGB(Color rgb) {
|
||||
v = fmax(R, G);
|
||||
v = fmax(v, B);
|
||||
|
||||
if (v == x)
|
||||
if (v == x) {
|
||||
return ColorHSB(0.0, 0.0, v, rgb.alpha);
|
||||
}
|
||||
|
||||
f = (R == x) ? G - B : ((G == x) ? B - R : R - G);
|
||||
i = (R == x) ? 3 : ((G == x) ? 5 : 1);
|
||||
@@ -48,18 +48,21 @@ Color ColorHSB::toRGBA() const {
|
||||
|
||||
int64_t i = 0;
|
||||
|
||||
if (h == 0)
|
||||
if (h == 0) {
|
||||
h = 0.01;
|
||||
}
|
||||
|
||||
if (h == 0.0)
|
||||
if (h == 0.0) {
|
||||
return Color(v, v, v, alpha);
|
||||
}
|
||||
|
||||
i = static_cast<int64_t>(floor(h));
|
||||
|
||||
f = h - i;
|
||||
|
||||
if (!(i & 1))
|
||||
if (!(i & 1)) {
|
||||
f = 1 - f;
|
||||
}
|
||||
|
||||
m = v * (1 - s);
|
||||
n = v * (1 - s * f);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Entity.h"
|
||||
|
||||
namespace rl {
|
||||
namespace entity {
|
||||
|
||||
Entity::Entity()
|
||||
: _anchorPoint(geom::Point(0.5, 0.5)), _opacity(1.0), _strokeSize(1.0) {}
|
||||
|
||||
Entity::Entity(Entity&&) = default;
|
||||
Entity::Entity() = default;
|
||||
|
||||
Entity::~Entity() = default;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -16,50 +15,8 @@ namespace entity {
|
||||
|
||||
class Entity {
|
||||
public:
|
||||
using PropertyMaskType = uint16_t;
|
||||
|
||||
enum class Property : PropertyMaskType {
|
||||
None,
|
||||
|
||||
AddedTo,
|
||||
RemovedFrom,
|
||||
Bounds,
|
||||
Position,
|
||||
AnchorPoint,
|
||||
Transformation,
|
||||
BackgroundColor,
|
||||
Contents,
|
||||
Path,
|
||||
Opacity,
|
||||
StrokeSize,
|
||||
StrokeColor,
|
||||
MakeRoot,
|
||||
|
||||
Sentinel,
|
||||
};
|
||||
|
||||
#define RL_MASK(x) x##Mask = (1 << static_cast<uint32_t>(Property::x))
|
||||
enum PropertyMask {
|
||||
RL_MASK(AddedTo),
|
||||
RL_MASK(RemovedFrom),
|
||||
RL_MASK(Bounds),
|
||||
RL_MASK(Position),
|
||||
RL_MASK(AnchorPoint),
|
||||
RL_MASK(Transformation),
|
||||
RL_MASK(BackgroundColor),
|
||||
RL_MASK(Contents),
|
||||
RL_MASK(Path),
|
||||
RL_MASK(Opacity),
|
||||
RL_MASK(StrokeSize),
|
||||
RL_MASK(StrokeColor),
|
||||
RL_MASK(MakeRoot),
|
||||
};
|
||||
#undef RL_MASK
|
||||
|
||||
Entity();
|
||||
|
||||
Entity(Entity&& entity);
|
||||
|
||||
~Entity();
|
||||
|
||||
/**
|
||||
@@ -187,14 +144,14 @@ class Entity {
|
||||
private:
|
||||
geom::Rect _bounds;
|
||||
geom::Point _position;
|
||||
geom::Point _anchorPoint;
|
||||
geom::Point _anchorPoint = {0.5, 0.5};
|
||||
geom::Matrix _transformation;
|
||||
Color _backgroundColor;
|
||||
|
||||
geom::Path _path;
|
||||
double _opacity;
|
||||
Color _strokeColor;
|
||||
double _strokeSize;
|
||||
double _opacity = 1.0;
|
||||
Color _strokeColor = Color::Black();
|
||||
double _strokeSize = 1.0;
|
||||
|
||||
FML_DISALLOW_COPY_AND_ASSIGN(Entity);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Matrix.h"
|
||||
#include <climits>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Path.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "PathBuilder.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "PathComponent.h"
|
||||
#include <cmath>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Point.h"
|
||||
#include <sstream>
|
||||
@@ -22,5 +21,15 @@ void Point::fromString(const std::string& str) {
|
||||
stream >> y;
|
||||
}
|
||||
|
||||
double Point::distanceSquared(const Point& p) const {
|
||||
double dx = p.x - x;
|
||||
double dy = p.y - y;
|
||||
return dx * dx + dy * dy;
|
||||
}
|
||||
|
||||
double Point::distance(const Point& p) const {
|
||||
return sqrt(distanceSquared(p));
|
||||
}
|
||||
|
||||
} // namespace geom
|
||||
} // namespace rl
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -16,13 +15,15 @@ struct Point {
|
||||
double x;
|
||||
double y;
|
||||
|
||||
Point() : x(0.0), y(0.0) {}
|
||||
Point(double x, double y) : x(x), y(y) {}
|
||||
constexpr Point() : x(0.0), y(0.0) {}
|
||||
|
||||
constexpr Point(double x, double y) : x(x), y(y) {}
|
||||
|
||||
/*
|
||||
* Operator overloads
|
||||
*/
|
||||
bool operator==(const Point& p) const { return p.x == x && p.y == y; }
|
||||
|
||||
bool operator!=(const Point& p) const { return p.x != x || p.y != y; }
|
||||
|
||||
Point operator-() const { return {-x, -y}; }
|
||||
@@ -41,13 +42,9 @@ struct Point {
|
||||
Point operator/(const Point& p) const { return {x / p.x, y / p.y}; }
|
||||
Point operator/(const Size& s) const { return {x / s.width, y / s.height}; }
|
||||
|
||||
double distanceSquared(const Point& p) const {
|
||||
double dx = p.x - x;
|
||||
double dy = p.y - y;
|
||||
return dx * dx + dy * dy;
|
||||
}
|
||||
double distanceSquared(const Point& p) const;
|
||||
|
||||
double distance(const Point& p) const { return sqrt(distanceSquared(p)); }
|
||||
double distance(const Point& p) const;
|
||||
|
||||
std::string toString() const;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Quaternion.h"
|
||||
#include <sstream>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Rect.h"
|
||||
#include <sstream>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Shear.h"
|
||||
#include <sstream>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Size.h"
|
||||
#include <sstream>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Vector.h"
|
||||
#include <sstream>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "Image.h"
|
||||
#include <stb_image.h>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ImageResult.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* This source file is part of the Radar project.
|
||||
* Licensed under the MIT License. See LICENSE file for details.
|
||||
*/
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
Reference in New Issue
Block a user