<commit_before>/* Picasso - a vector graphics library
 * 
 * Copyright (C) 2014 <NAME>
 * Contact: <EMAIL>
 */

#include "common.h"

#include "gfx_math.h"
#include "gfx_gradient_adapter.h"
#include "gfx_line_generator.h"

namespace gfx {

// gradient functions

// gradient_x
class gradient_x
{
public:
    void init(scalar, scalar, scalar) { }
    static int calculate(int x, int, int) { return x; }
};

// gradient_conic
class gradient_conic
{
public:
    void init(scalar, scalar, scalar) { }
    static int calculate(int x, int y, int d)
    {
        return uround(Fabs(Atan2(INT_TO_SCALAR(y), INT_TO_SCALAR(x))) * INT_TO_SCALAR(d) * _1divPI);
    }
};

class gradient_conic_vg
{
public:
    void init(scalar, scalar, scalar) { }
    static int calculate(int x, int y, int d)
    {
        scalar a = Atan2(INT_TO_SCALAR(y), INT_TO_SCALAR(x));
        if (a < 0) a = _2PI + a;
        return round(a * INT_TO_SCALAR(d) * _1div2PI);
    }
};


// gradient_radial
class gradient_radial
{
public:
    void init(scalar, scalar, scalar) { }
    static int calculate(int x, int y, int d)
    {
        return (int)fast_sqrt(x*x + y*y);
    }
};

// gradient_radial_focus
class gradient_radial_focus
{
public:
    gradient_radial_focus()
        : m_r(100 * gradient_subpixel_scale)
        , m_fx(0)
        , m_fy(0)
    {
        update_values();
    }

    void init(scalar r, scalar fx, scalar fy)<commit_msg>fix win32 gyp build<commit_after>/* Picasso - a vector graphics library
 * 
 * Copyright (C) 2014 <NAME>
 * Contact: <EMAIL>
 */

#include "common.h"

#include "gfx_math.h"
#include "gfx_gradient_adapter.h"
#include "gfx_line_generator.h"

namespace gfx {

// gradient functions

// gradient_x
class gradient_x
{
public:
    void init(scalar, scalar, scalar) { }
    static int calculate(int x, int, int) { return x; }
};

// gradient_conic
class gradient_conic
{
public:
    void init(scalar, scalar, scalar) { }
    static int calculate(int x, int y, int d)
    {
        return uround(Fabs(Atan2(INT_TO_SCALAR(y), INT_TO_SCALAR(x))) * INT_TO_SCALAR(d) * _1divPI);
    }
};

class gradient_conic_vg
{
public:
    void init(scalar, scalar, scalar) { }
    static int calculate(int x, int y, int d)
    {
        scalar a = Atan2(INT_TO_SCALAR(y), INT_TO_SCALAR(x));
        if (a < 0) a = _2PI + a;
        return iround(a * INT_TO_SCALAR(d) * _1div2PI);
    }
};


// gradient_radial
class gradient_radial
{
public:
    void init(scalar, scalar, scalar) { }
    static int calculate(int x, int y, int d)
    {
        return (int)fast_sqrt(x*x + y*y);
    }
};

// gradient_radial_focus
class gradient_radial_focus
{
public:
    gradient_radial_focus()
        : m_r(100 * gradient_subpixel_scale)
        , m_fx(0)
        , m_fy(0)
    {
        update_values();
    }

    void init(scalar r, scalar fx, scalar fy)
{'fraction_non_alphanumeric': 0.12645708230307312, 'fraction_numerical': 0.012009890498057224, 'mean_word_length': 2.988732394366197, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6624514', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1071, 'n_words': 254}