godot/thirdparty/graphite/src/inc/Intervals.h

// SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later
// Copyright 2010, SIL International, All rights reserved.

#pragma once

#include <utility>

#include "inc/Main.h"
#include "inc/List.h"
#include "inc/json.h"
#include "inc/Position.h"

// An IntervalSet represents the possible movement of a given glyph in a given direction
// (horizontally, vertically, or diagonally).
// A vector is needed to represent disjoint ranges, eg, -300..-150, 20..200, 500..750.
// Each pair represents the min/max of a sub-range.

namespace graphite2 {

class Segment;

enum zones_t {};

class Zones
{};


inline
Zones::Zones()
:{}

inline
Zones::Exclusion::Exclusion(float x_, float xm_, float smi, float smxi, float c_)
:{}

template<zones_t O>
inline
void Zones::initialise(float xmin, float xmax, float margin_len,
        float margin_weight, float a0)
{}

inline
void Zones::exclude(float xmin, float xmax) {}

template<zones_t O>
inline
void Zones::weighted(float xmin, float xmax, float f, float a0,
        float m, float xi, float ai, float c, bool nega) {}

inline
void Zones::weightedAxis(int axis, float xmin, float xmax, float f, float a0,
        float m, float xi, float ai, float c, bool nega) {}

#if !defined GRAPHITE2_NTRACING
inline
void Zones::addDebug(Exclusion *e) {
    if (_dbg)
        _dbgs.push_back(Debug(e, false, _dbg));
}

inline
void Zones::removeDebug(float pos, float posm) {
    if (_dbg)
    {
        Exclusion e(pos, posm, 0, 0, 0);
        _dbgs.push_back(Debug(&e, true, _dbg));
    }
}
#endif

template<>
inline
Zones::Exclusion Zones::Exclusion::weighted<XY>(float xmin, float xmax, float f, float a0,
        float m, float xi, GR_MAYBE_UNUSED float ai, float c, GR_MAYBE_UNUSED bool nega) {}

template<>
inline
Zones::Exclusion Zones::Exclusion::weighted<SD>(float xmin, float xmax, float f, float a0,
        float m, float xi, float ai,float c, bool nega) {}

} // end of namespace graphite2