utils

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package utils provides utility functions and types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableCurrentProcessWindowClickThrough

func EnableCurrentProcessWindowClickThrough()

func Transform added in v0.1.0

func Transform(val float64, iFrom, iTo *Interval) float64

Transform maps a value from one interval range to another

Types

type Interval

type Interval struct {
	Start, End float64
}

Interval defines a range with start and end values

func (*Interval) GetMinMax

func (i *Interval) GetMinMax() (min, max float64)

GetMinMax returns the minimum and maximum values of the interval

func (*Interval) Length

func (i *Interval) Length() float64

Length returns the length of the interval

func (*Interval) Sat

func (i *Interval) Sat(val float64) float64

Sat returns the nearest value to val that is within the interval range

type IntervalTransformer

type IntervalTransformer struct {
	IntervalFrom Interval
	IntervalTo   Interval
}

IntervalTransformer maps values from one interval range to another

func (*IntervalTransformer) TransformBackward

func (t *IntervalTransformer) TransformBackward(val float64) float64

TransformBackward maps a value from the "to" interval range to the "from" interval range

func (*IntervalTransformer) TransformForward

func (t *IntervalTransformer) TransformForward(val float64) float64

TransformForward maps a value from the "from" interval range to the "to" interval range

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL