Commit Graph

19 Commits

Author SHA1 Message Date
bjorn 90a14478a3 lovrImageCreateRaw takes sRGB flag; Fix readback encoding;
Roundtripping pixels through a readback preserves sRGB encoding.
2023-11-02 13:38:21 -07:00
bjorn e9776f98c6 Fix compatibility with Lua 5.2, 5.3, 5.4;
Part of this involved putting the Lua header back in api.h, since we
need to know the Lua version to define some macros properly.
2022-11-24 14:33:55 -08:00
bjorn dd8d8fe67e Adjust; 2022-07-04 15:22:54 -07:00
bjorn 1f8d37a160 Font:getKerning; 2022-06-29 21:49:55 -07:00
bjorn fa2bd2b05c Shuffle around Rasterizer;
Shorter names, ditch linegap
2022-06-28 20:18:45 -07:00
bjorn cbe24f482f Adjust font uvs;
- Padding is automatically computed from spread.
  - Spread increases detail at small sizes.
  - Remove failure cases where padding < spread/2
- UVs are un16x2, making room for color
- Don't center glyphs inside their atlas bounding box
- Cache normalized UVs and update them (for glyphs and vertices) when
  the atlas changes size.
  - Updating the UVs is UGLY and duplicates a lot of code.  It may be
    better to normalize the UVs on the fly, or just re-render the entire
    string if the atlas is updated.
2022-06-26 20:28:30 -07:00
bjorn 756b184306 Some font cleanup; 2022-06-25 19:54:13 -07:00
bjorn 71f6a88a62 Font uses padding; 2022-06-20 19:24:41 -07:00
bjorn 7625ef9bd8 Rasterizer:getGlyphImage; 2022-06-20 18:24:12 -07:00
bjorn 0d7fed1fa7 Rasterizer:getBoundingBox;
For the global bounding box
2022-06-18 17:40:14 -07:00
bjorn 717f95f6bd Start updating Rasterizer; 2022-06-17 17:43:58 -07:00
bjorn 2da18d419b mv util src; 2022-03-22 00:13:38 -07:00
bjorn b22dbd8f0c Add luax_checku32 and luax_optu32;
These functions read an unsigned 32 bit integer from the Lua stack
and error if the value is negative or too big.  Currently converting
Lua numbers to integers will silently wrap or invoke undefined behavior
when they are outside of the acceptable range.

For projects that don't want the overhead of type/bounds checks, the
supercharge build option (LOVR_UNCHECKED) can now be used to skip all
type/bounds checks.
2022-02-21 14:19:24 -08:00
bjorn 20e4567bd6 Merge branch 'master' into dev 2021-12-20 17:12:39 +02:00
Josip Miskovic 09cc73a988 Move text measuring to Rasterizer 2021-10-21 10:42:11 -07:00
bjorn e63099ba6a Flatten api.h; 2021-03-15 18:54:27 -06:00
bjorn 0e318aa46e Make Rasterizer opaque; 2021-02-08 10:58:39 -07:00
bjorn 3bc2c00b79 api doesn't include util; 2020-12-25 12:50:26 -07:00
bjorn c9b1f257bf api: try new file naming convention; Tupfile: cleanup;
I assume full responsibility for any catastrophes this causes.
2019-12-31 19:31:44 -08:00
Renamed from src/api/l_rasterizer.c (Browse further)