update helpers/location to 'frosted' ui
[carveJwlIkooP6JGAAIwe30JlM.git] / skaterift_lib.c
1 #define QOI_IMPLEMENTATION
2 #include "vg/submodules/qoi/qoi.h"
3 #include "vg/vg_platform.h"
4 #include "vg/vg_m.h"
5
6 u8 *qoi_encode_rgbaf32( f32 *data, u32 width, u32 height, int *length )
7 {
8 u8 *buf = (u8 *)data;
9 for( u32 i=0; i<width*height*4; i ++ )
10 {
11 buf[i] = vg_clampf( data[i] * 255.0f, 0.0f, 255.0f );
12 }
13
14 qoi_desc desc =
15 {
16 .channels=4,
17 .colorspace=0,
18 .width=width,
19 .height=height
20 };
21
22 return qoi_encode( buf, &desc, length );
23 }
24
25 void qoi_free( u8 *ptr )
26 {
27 free( ptr );
28 }
29
30 #include "vg/vg_tool.h"
31 #include "vg/vg_tool.c"