All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.humbleui.skija.shaper.RunInfo Maven / Gradle / Ivy

// Generated by delombok at Wed Sep 14 01:50:49 UTC 2022
package io.github.humbleui.skija.shaper;

import lombok.*;
import org.jetbrains.annotations.*;
import io.github.humbleui.skija.*;
import io.github.humbleui.skija.impl.*;
import io.github.humbleui.types.*;

public class RunInfo {
    public long _fontPtr;
    public final int _bidiLevel;
    public final float _advanceX;
    public final float _advanceY;
    public final long _glyphCount;
    /**
     * WARN does not work in Shaper.makeCoreText https://bugs.chromium.org/p/skia/issues/detail?id=10899
     */
    public final int _rangeBegin;
    /**
     * WARN does not work in Shaper.makeCoreText https://bugs.chromium.org/p/skia/issues/detail?id=10899
     */
    public final int _rangeSize;

    public RunInfo(long fontPtr, int biDiLevel, float advanceX, float advanceY, long glyphCount, int rangeBegin, int rangeSize) {
        _fontPtr = fontPtr;
        _bidiLevel = biDiLevel;
        _advanceX = advanceX;
        _advanceY = advanceY;
        _glyphCount = glyphCount;
        _rangeBegin = rangeBegin;
        _rangeSize = rangeSize;
    }

    public Point getAdvance() {
        return new Point(_advanceX, _advanceY);
    }

    /**
     * WARN does not work in Shaper.makeCoreText https://bugs.chromium.org/p/skia/issues/detail?id=10899
     */
    public int getRangeEnd() {
        return _rangeBegin + _rangeSize;
    }

    public Font getFont() {
        if (_fontPtr == 0) throw new IllegalStateException("getFont() is only valid inside RunHandler callbacks");
        return Font.makeClone(_fontPtr);
    }

    @java.lang.SuppressWarnings("all")
    public int getBidiLevel() {
        return this._bidiLevel;
    }

    @java.lang.SuppressWarnings("all")
    public float getAdvanceX() {
        return this._advanceX;
    }

    @java.lang.SuppressWarnings("all")
    public float getAdvanceY() {
        return this._advanceY;
    }

    @java.lang.SuppressWarnings("all")
    public long getGlyphCount() {
        return this._glyphCount;
    }

    /**
     * WARN does not work in Shaper.makeCoreText https://bugs.chromium.org/p/skia/issues/detail?id=10899
     */
    @java.lang.SuppressWarnings("all")
    public int getRangeBegin() {
        return this._rangeBegin;
    }

    /**
     * WARN does not work in Shaper.makeCoreText https://bugs.chromium.org/p/skia/issues/detail?id=10899
     */
    @java.lang.SuppressWarnings("all")
    public int getRangeSize() {
        return this._rangeSize;
    }

    /**
     * @return {@code this}.
     */
    @java.lang.SuppressWarnings("all")
    public RunInfo setFontPtr(final long _fontPtr) {
        this._fontPtr = _fontPtr;
        return this;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof RunInfo)) return false;
        final RunInfo other = (RunInfo) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (this._fontPtr != other._fontPtr) return false;
        if (this.getBidiLevel() != other.getBidiLevel()) return false;
        if (java.lang.Float.compare(this.getAdvanceX(), other.getAdvanceX()) != 0) return false;
        if (java.lang.Float.compare(this.getAdvanceY(), other.getAdvanceY()) != 0) return false;
        if (this.getGlyphCount() != other.getGlyphCount()) return false;
        if (this.getRangeBegin() != other.getRangeBegin()) return false;
        if (this.getRangeSize() != other.getRangeSize()) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof RunInfo;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final long $_fontPtr = this._fontPtr;
        result = result * PRIME + (int) ($_fontPtr >>> 32 ^ $_fontPtr);
        result = result * PRIME + this.getBidiLevel();
        result = result * PRIME + java.lang.Float.floatToIntBits(this.getAdvanceX());
        result = result * PRIME + java.lang.Float.floatToIntBits(this.getAdvanceY());
        final long $_glyphCount = this.getGlyphCount();
        result = result * PRIME + (int) ($_glyphCount >>> 32 ^ $_glyphCount);
        result = result * PRIME + this.getRangeBegin();
        result = result * PRIME + this.getRangeSize();
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public java.lang.String toString() {
        return "RunInfo(_fontPtr=" + this._fontPtr + ", _bidiLevel=" + this.getBidiLevel() + ", _advanceX=" + this.getAdvanceX() + ", _advanceY=" + this.getAdvanceY() + ", _glyphCount=" + this.getGlyphCount() + ", _rangeBegin=" + this.getRangeBegin() + ", _rangeSize=" + this.getRangeSize() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy