27 #if !defined(__LWS_DLO_H__)
41 #define LWSDC_RGBA(_r, _g, _b, _a) (((uint32_t)(_r) & 0xff) | \
42 (((uint32_t)(_g) & 0xff) << 8) | \
43 (((uint32_t)(_b) & 0xff) << 16) | \
44 (((uint32_t)(_a) & 0xff) << 24))
46 #define LWSDC_R(_c) ((_c) & 0xff)
47 #define LWSDC_G(_c) ((_c >> 8) & 0xff)
48 #define LWSDC_B(_c) ((_c >> 16) & 0xff)
49 #define LWSDC_ALPHA(_c) ((_c >> 24) & 0xff)
51 #define RGB_TO_Y(_r, _g, _b) ((((_r) * 299) + ((_g) * 587) + ((_b) * 114)) / 1000)
53 #define PALETTE_RGBY(_r, _g, _b) LWSDC_RGBA(_r, _g, _b, (RGB_TO_Y(_r, _g, _b)))
205 #define LWSDLO_TEXT_FLAG_WRAP (1 << 0)
401 lws_fx_t indent,
const char *utf8,
size_t text_len);
447 struct lws_context *
cx;
470 #define lws_dlo_image_width(_u) ((_u)->failed ? -1 : \
471 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
472 (int)lws_jpeg_get_width((_u)->u.dlo_jpeg->j) : \
473 (int)lws_upng_get_width((_u)->u.dlo_png->png)))
474 #define lws_dlo_image_height(_u) ((_u)->failed ? -1 : \
475 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
476 (int)lws_jpeg_get_height((_u)->u.dlo_jpeg->j) : \
477 (int)lws_upng_get_height((_u)->u.dlo_png->png)))
479 #define lws_dlo_image_metadata_scan(_u) ((_u)->failed ? LWS_SRET_FATAL : \
480 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
481 lws_display_dlo_jpeg_metadata_scan((_u)->u.dlo_jpeg) : \
482 lws_display_dlo_png_metadata_scan((_u)->u.dlo_png)))
uint32_t lws_display_colour_t
int16_t lws_display_list_coord_t
uint16_t lws_display_scalar
LWS_VISIBLE LWS_EXTERN int lws_display_dlo_text_update(lws_dlo_text_t *text, lws_display_colour_t dc, lws_fx_t indent, const char *utf8, size_t text_len)
lws_display_render_stack_t st[12]
LWS_VISIBLE LWS_EXTERN int lws_dlo_ss_find(struct lws_context *cx, const char *url, lws_dlo_image_t *u)
LWS_VISIBLE LWS_EXTERN lws_dlo_text_t * lws_display_dlo_text_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box, const lws_display_font_t *font)
LWS_VISIBLE LWS_EXTERN void lws_display_dl_init(lws_displaylist_t *dl, struct lws_display_state *ds)
LWS_VISIBLE LWS_EXTERN void lws_dlo_contents(lws_dlo_t *parent, lws_dlo_dim_t *dim)
lws_displaylist_t displaylist
LWS_VISIBLE LWS_EXTERN void lws_display_dl_dump(lws_displaylist_t *dl)
LWS_VISIBLE const struct lws_plat_file_ops lws_dlo_fops
LWS_VISIBLE LWS_EXTERN lws_display_id_t * lws_display_render_get_id(lws_display_render_state_t *rs, const char *id)
struct lws_dlo_jpeg lws_dlo_jpeg_t
lws_display_scalar lowest_id_y
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_jpeg_destroy(struct lws_dlo *dlo)
lws_sorted_usec_list_t sul
lws_font_glyph_t *(* lws_dlo_image_glyph_t)(struct lws_dlo_text *text, uint32_t unicode, char attach)
LWS_VISIBLE LWS_EXTERN const lws_display_font_t * lws_font_choose(struct lws_context *cx, const lws_font_choice_t *hints)
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_get_ids_boxes(lws_display_render_state_t *rs)
LWS_VISIBLE LWS_EXTERN int lws_dlo_ensure_err_diff(lws_dlo_t *dlo)
LWS_VISIBLE LWS_EXTERN lws_display_id_t * lws_display_render_add_id(lws_display_render_state_t *rs, const char *id, void *priv)
lws_dlo_renderer_t render
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_text_destroy(struct lws_dlo *dlo)
lws_display_list_coord_t clkernpx
const struct lws_surface_info * ic
struct lws_display_id lws_display_id_t
LWS_VISIBLE LWS_EXTERN lws_dlo_rect_t * lws_display_dlo_rect_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box, const lws_fx_t *radii, lws_display_colour_t dc)
LWS_VISIBLE LWS_EXTERN void lws_display_render_dump_ids(lws_dll2_owner_t *ids)
void(* lws_dlo_destroy_t)(struct lws_dlo *dlo)
const char * generic_name
LWS_VISIBLE LWS_EXTERN const lws_dlo_filesystem_t * lws_dlo_file_choose(struct lws_context *cx, const char *name)
LWS_VISIBLE LWS_EXTERN void lws_display_list_destroy(lws_displaylist_t *dl)
LWS_VISIBLE LWS_EXTERN int lws_font_register(struct lws_context *cx, const uint8_t *data, size_t data_len)
struct lws_font_choice lws_font_choice_t
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_destroy(lws_dlo_t **r)
lws_sorted_usec_list_t sul
lws_dll2_owner_t table_rows
lws_sorted_usec_list_t * on_rx_sul
struct lws_dlo_filesystem lws_dlo_filesystem_t
struct lws_display_font lws_display_font_t
LWS_VISIBLE LWS_EXTERN void lws_dlo_file_unregister(lws_dlo_filesystem_t **f)
struct lws_dlo_png lws_dlo_png_t
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_list_render_line(lws_display_render_state_t *rs)
struct lws_dlo_rect lws_dlo_rect_t
LWS_VISIBLE LWS_EXTERN void lws_dlo_file_unregister_by_name(struct lws_context *cx, const char *name)
const struct lws_surface_info * ic
struct lws_display_state * ds
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_dlo_png_metadata_scan(lws_dlo_png_t *dp)
LWS_VISIBLE LWS_EXTERN int lws_dlo_ss_create(lws_dlo_ss_create_info_t *i, lws_dlo_t **pdlo)
lws_dlo_image_type_t type
lws_display_list_coord_t cwidth
const lws_display_font_t * font
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_adjust_dims(lws_dlo_t *dlo, lws_dlo_dim_t *dim)
lws_dlo_destroy_t _destroy
struct lws_display_state * lds
LWS_VISIBLE LWS_EXTERN int lws_display_dlo_add(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_dlo_t *dlo)
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_png(struct lws_display_render_state *rs)
lws_dlo_renderer_t renderer
LWS_VISIBLE LWS_EXTERN void lws_fonts_destroy(struct lws_context *cx)
struct lws_dlo_circle lws_dlo_circle_t
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_png_destroy(struct lws_dlo *dlo)
lws_dlo_image_glyph_t image_glyph
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_dlo_jpeg_metadata_scan(lws_dlo_jpeg_t *dj)
struct lws_circle lws_circle_t
lws_dll2_owner_t children
lws_stateful_ret_t(* lws_dlo_renderer_t)(struct lws_display_render_state *rs)
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_jpeg(struct lws_display_render_state *rs)
LWS_VISIBLE LWS_EXTERN lws_dlo_jpeg_t * lws_display_dlo_jpeg_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box)
struct lws_dl_rend lws_dl_rend_t
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_rect(struct lws_display_render_state *rs)
struct lws_font_glyph lws_font_glyph_t
LWS_VISIBLE LWS_EXTERN lws_dlo_png_t * lws_display_dlo_png_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box)
LWS_VISIBLE LWS_EXTERN lws_dlo_filesystem_t * lws_dlo_file_register(struct lws_context *cx, const lws_dlo_filesystem_t *f)
struct lws_dlo_rasterize lws_dlo_rasterize_t
lws_dll2_owner_t table_cols
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lhp_displaylist_layout(struct lhp_ctx *ctx, char reason)
LWS_VISIBLE LWS_EXTERN void lws_display_render_free_ids(lws_display_render_state_t *rs)
struct lws_dlo_text lws_dlo_text_t
struct lws_displaylist lws_displaylist_t
struct lws_display_render_stack lws_display_render_stack_t
LWS_VISIBLE LWS_EXTERN void lws_dlo_file_destroy(struct lws_context *cx)
struct lws_display_render_state lws_display_render_state_t
struct lws_jpeg lws_jpeg_t
void(* sul_cb_t)(struct lws_sorted_usec_list *sul)
struct lws_upng_t lws_upng_t