class LottieRepeaterProcesser : public LOTDataVisitor {
public:
- LottieRepeaterProcesser() : mRepeaterFound(false) {}
void visit(LOTCompositionData *) override {}
void visit(LOTLayerData *) override {}
void visit(LOTTransformData *) override {}
}
public:
- bool mRepeaterFound;
+ bool mRepeaterFound{false};
};
class LottieColor
{
public:
- LottieColor():r(1),g(1), b(1){}
+ LottieColor() = default;
LottieColor(float red, float green , float blue):r(red), g(green),b(blue){}
VColor toColor(float a=1){ return VColor((255 * r), (255 * g), (255 * b), (255 * a));}
friend inline LottieColor operator+(const LottieColor &c1, const LottieColor &c2);
friend inline LottieColor operator-(const LottieColor &c1, const LottieColor &c2);
public:
- float r;
- float g;
- float b;
+ float r{1};
+ float g{1};
+ float b{1};
};
inline LottieColor operator-(const LottieColor &c1, const LottieColor &c2)
class LOTKeyFrame
{
public:
- LOTKeyFrame(): mStartFrame(0),
- mEndFrame(0),
- mInterpolator(nullptr){}
-
T value(int frameNo) const {
float progress = mInterpolator->value(float(frameNo - mStartFrame) / float(mEndFrame - mStartFrame));
return mValue.value(progress);
}
public:
- int mStartFrame;
- int mEndFrame;
+ int mStartFrame{0};
+ int mEndFrame{0};
std::shared_ptr<VInterpolator> mInterpolator;
LOTKeyFrameValue<T> mValue;
};
class VBrush {
public:
enum class Type { NoBrush, Solid, LinearGradient, RadialGradient, Texture };
- VBrush() : mType(Type::NoBrush) {}
+ VBrush() = default;
VBrush(const VColor &color);
VBrush(const VGradient *gradient);
VBrush(int r, int g, int b, int a);
inline VBrush::Type type() const { return mType; }
public:
- VBrush::Type mType;
+ VBrush::Type mType{Type::NoBrush};
VColor mColor;
const VGradient *mGradient;
};
class VElapsedTimer {
public:
- VElapsedTimer() : m_valid(false) {}
double elapsed() const;
bool hasExpired(double millsec);
void start();
private:
std::chrono::high_resolution_clock::time_point clock;
- bool m_valid;
+ bool m_valid{false};
};
#endif // VELAPSEDTIMER_H
class VPointF {
public:
- constexpr inline VPointF() noexcept : mx(0), my(0) {}
+ VPointF() = default;
constexpr inline VPointF(float x, float y) noexcept : mx(x), my(y) {}
constexpr inline float x() const noexcept { return mx; }
constexpr inline float y() const noexcept { return my; }
friend inline const VPointF operator/(float val, const VPointF &);
private:
- float mx;
- float my;
+ float mx{0};
+ float my{0};
};
inline bool fuzzyCompare(const VPointF &p1, const VPointF &p2)
class VPoint {
public:
- constexpr inline VPoint() noexcept : mx(0), my(0) {}
+ VPoint() = default;
constexpr inline VPoint(int x, int y) noexcept : mx(x), my(y) {}
constexpr inline int x() const noexcept { return mx; }
constexpr inline int y() const noexcept { return my; }
inline friend VDebug &operator<<(VDebug &os, const VPoint &o);
private:
- int mx;
- int my;
+ int mx{0};
+ int my{0};
};
inline VDebug &operator<<(VDebug &os, const VPoint &o)
{
class VSize {
public:
- constexpr inline VSize() noexcept : mw(0), mh(0) {}
+ VSize() = default;
constexpr inline VSize(int w, int h) noexcept : mw(w), mh(h) {}
bool isEmpty() const {return (mw <= 0 || mh <= 0);}
constexpr inline int width() const noexcept { return mw; }
inline friend VDebug &operator<<(VDebug &os, const VSize &o);
private:
- int mw;
- int mh;
+ int mw{0};
+ int mh{0};
};
inline VDebug &operator<<(VDebug &os, const VSize &o)
{
class VRect {
public:
- V_CONSTEXPR VRect() : x1(0), y1(0), x2(-1), y2(-1) {}
+ VRect() = default;
V_CONSTEXPR VRect(int left, int top, int width, int height);
V_CONSTEXPR inline bool isEmpty() const;
V_CONSTEXPR inline bool isNull() const;
friend VDebug & operator<<(VDebug &os, const VRect &o);
private:
- int x1;
- int y1;
- int x2;
- int y2;
+ int x1{0};
+ int y1{0};
+ int x2{-1};
+ int y2{-1};
};
inline bool VRect::intersects(const VRect &r)
class VRectF {
public:
- V_CONSTEXPR VRectF() : x1(0), y1(0), x2(-1), y2(-1) {}
+ VRectF() = default;
VRectF(float left, float top, float width, float height)
{
x1 = left;
}
private:
- float x1;
- float y1;
- float x2;
- float y2;
+ float x1{0};
+ float y1{0};
+ float x2{-1};
+ float y2{-1};
};
V_CONSTEXPR inline bool VRectF::isEmpty() const