Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Aug 11, 2023
1 parent ec9ed84 commit 7322b63
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ end
Struct to hold all relevant matrices and additional parameters, to let backends
apply camera based transformations.
## Fields
$(TYPEDFIELDS)
"""
struct Camera
"""
Expand Down Expand Up @@ -381,11 +385,34 @@ const RGBColors = Union{RGBAf, Vector{RGBAf}, Vector{Float32}}

const LogFunctions = Union{typeof(log10), typeof(log2), typeof(log)}

"""
ReversibleScale
Custom scale struct, taking a scaling (forward) and an inverse (backward) arbitrary scale function.
## Fields
$(TYPEDFIELDS)
"""
struct ReversibleScale{F <: Function, B <: Function, I <: AbstractInterval}
"""
forward transformation (e.g. `log10`)
"""
forward::F
"""
inverse transformation (e.g. `exp10` for `log10` such that backward ∘ forward ≡ identity)
"""
backward::B
"""
ticks base (e.g. "10" for pseudo `log10` ticks) (optional)
"""
logbase::String
"""
default limits (optional)
"""
limits::NTuple{2,Float32}
"""
valid limits interval (optional)
"""
interval::I
function ReversibleScale(forward, backward; logbase = "", limits = (0f0, 10f0), interval = (-Inf32, Inf32))
if !(interval isa AbstractInterval)
Expand Down

0 comments on commit 7322b63

Please sign in to comment.