aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkDQuadImplicit.h
blob: 24f1aac2ef880fdf1984d38d2f6916b728fabefe (plain)
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
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#ifndef SkDQuadImplicit_DEFINED
#define SkDQuadImplicit_DEFINED

#include "SkPathOpsQuad.h"

class SkDQuadImplicit {
public:
    explicit SkDQuadImplicit(const SkDQuad& q);

    bool match(const SkDQuadImplicit& two) const;
    static bool Match(const SkDQuad& quad1, const SkDQuad& quad2);

    double x2() const { return fP[kXx_Coeff]; }
    double xy() const { return fP[kXy_Coeff]; }
    double y2() const { return fP[kYy_Coeff]; }
    double x() const { return fP[kX_Coeff]; }
    double y() const { return fP[kY_Coeff]; }
    double c() const { return fP[kC_Coeff]; }

private:
    enum Coeffs {
        kXx_Coeff,
        kXy_Coeff,
        kYy_Coeff,
        kX_Coeff,
        kY_Coeff,
        kC_Coeff,
    };

    double fP[kC_Coeff + 1];
};

#endif