Pebble App Framework
main
How It Works
CLI
Device API
Phone API
C Coverage
TS Coverage
GitHub
Theme
Pebble App Framework: Device API
Toggle main menu visibility
Loading...
Searching...
No Matches
scale.h
Go to the documentation of this file.
1
12
#pragma once
13
18
27
int
clamp_int
(
int
value,
int
lo,
int
hi);
28
41
int
segment_width
(
int
total,
int
gap,
int
count);
42
51
int
fraction_px
(
int
total,
int
num,
int
den);
52
63
int
segments_filled
(
int
level,
int
segments);
64
79
int
plot_y
(
int
y0,
int
height,
int
lo,
int
hi,
int
value);
80
clamp_int
int clamp_int(int value, int lo, int hi)
Pin a value into a range, so it lands on the nearer end when it falls outside.
Definition
scale.c:9
segments_filled
int segments_filled(int level, int segments)
How many cells of a gauge a percentage lights, rounding up so any charge lights one.
Definition
scale.c:40
fraction_px
int fraction_px(int total, int num, int den)
A fraction of a length in pixels, e.g. how far along a bar a moment sits.
Definition
scale.c:31
segment_width
int segment_width(int total, int gap, int count)
The width of one cell when a strip is carved into evenly spaced segments.
Definition
scale.c:22
plot_y
int plot_y(int y0, int height, int lo, int hi, int value)
Map a reading to its pixel row in a plot, with the low end at the bottom.
Definition
scale.c:54
src
c
core
math
scale.h
Generated by
1.18.0