8 #include "../nvidia/map.h"
12 #define RGBA8(r,g,b,a) (((r)&0xff)|(((g)&0xff)<<8)|(((b)&0xff)<<16)|(((a)&0xff)<<24))
15 #define RGBA8_MAXALPHA(r,g,b) RGBA8((r),(g),(b),0xff)
18 #define RGBX8(r,g,b) RGBA8((r),(g),(b),0)
21 #define RGB565(r,g,b) (((b)&0x1f)|(((g)&0x3f)<<5)|(((r)&0x1f)<<11))
24 #define RGB565_FROM_RGB8(r,g,b) RGB565((r)>>3,(g)>>2,(b)>>3)
27 #define BGRA8(r,g,b,a) RGBA8((b),(g),(r),(a))
30 #define BGRA8_MAXALPHA(r,g,b) RGBA8((b),(g),(r),0xff)
33 #define RGBA4(r,g,b,a) (((r)&0xf)|(((g)&0xf)<<4)|(((b)&0xf)<<8)|(((a)&0xf)<<12))
36 #define RGBA4_MAXALPHA(r,g,b) RGBA4((r),(g),(b),0xf)
39 #define RGBA4_FROM_RGBA8(r,g,b,a) RGBA4((r)>>4,(g)>>4,(b)>>4,(a)>>4)
42 #define RGBA4_FROM_RGBA8_MAXALPHA(r,g,b) RGBA4_MAXALPHA((r)>>4,(g)>>4,(b)>>4)
Result framebufferCreate(Framebuffer *fb, NWindow *win, u32 width, u32 height, u32 format, u32 num_fbs)
Creates a Framebuffer object.
void * framebufferBegin(Framebuffer *fb, u32 *out_stride)
Begins rendering a frame in a Framebuffer.
Result framebufferMakeLinear(Framebuffer *fb)
Enables linear framebuffer mode in a Framebuffer, allocating a shadow buffer in the process.
void framebufferEnd(Framebuffer *fb)
Finishes rendering a frame in a Framebuffer.
void framebufferClose(Framebuffer *fb)
Closes a Framebuffer object, freeing all resources associated with it.
Native window (NWindow) wrapper object, used for presenting images to the display (or other sinks).
Framebuffer structure.
Definition: framebuffer.h:45
Native window structure.
Definition: native_window.h:17
u32 Result
Function error code result type.
Definition: types.h:44
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21