lv_barcode.h

API reference for lv_barcode.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_barcode_private.h

Functions

lv_barcode_set_dark_color

Set the dark color of a barcode object. Only rewrites the palette, so it takes effect before or after the data and never regenerates the bars.

 
void lv_barcode_set_dark_color(lv_obj_t *obj, lv_color_t color)
Parameters
NameTypeDescription
objlv_obj_t *pointer to barcode object
colorlv_color_tdark color of the barcode

lv_barcode_set_light_color

Set the light color of a barcode object. Only rewrites the palette, so it takes effect before or after the data and never regenerates the bars.

 
void lv_barcode_set_light_color(lv_obj_t *obj, lv_color_t color)
Parameters
NameTypeDescription
objlv_obj_t *pointer to barcode object
colorlv_color_tlight color of the barcode

lv_barcode_set_scale

Set the scale of a barcode object, i.e. the pixel width of a single bar. The stored data is re-generated, so this may be called before or after the data.

 
void lv_barcode_set_scale(lv_obj_t *obj, uint16_t scale)
Parameters
NameTypeDescription
objlv_obj_t *pointer to barcode object
scaleuint16_tscale factor; must be at least 1

lv_barcode_set_direction

Set the direction of a barcode object. The stored data is re-generated, so this may be called before or after the data.

 
void lv_barcode_set_direction(lv_obj_t *obj, lv_dir_t direction)
Parameters
NameTypeDescription
objlv_obj_t *pointer to barcode object
directionlv_dir_tdraw direction (LV_DIR_HOR or LV_DIR_VER)

lv_barcode_set_tiled

Set the tiled mode of a barcode object. The stored data is re-generated, so this may be called before or after the data.

 
void lv_barcode_set_tiled(lv_obj_t *obj, bool tiled)
Parameters
NameTypeDescription
objlv_obj_t *pointer to barcode object
tiledbooltrue: tiled mode, false: normal mode (default)

lv_barcode_set_encoding

Set the encoding of a barcode object. The stored data is re-generated, so this may be called before or after the data.

 
void lv_barcode_set_encoding(lv_obj_t *obj, lv_barcode_encoding_t encoding)
Parameters
NameTypeDescription
objlv_obj_t *pointer to barcode object
encodinglv_barcode_encoding_tencoding (default is LV_BARCODE_ENCODING_CODE128_GS1)

lv_barcode_set_update_mode

Set when a change is turned into a new barcode bitmap. Applies to the data and to the scale, direction, tiled mode and encoding; the colors are never affected.

 
void lv_barcode_set_update_mode(lv_obj_t *obj, lv_barcode_update_mode_t mode)
Parameters
NameTypeDescription
objlv_obj_t *pointer to barcode object
modelv_barcode_update_mode_tthe mode to use

Only the fill is deferred. The canvas is resized in the setter in both modes, because the draw pass cannot reallocate it.

Deferred mode expects an explicit lv_barcode_render(), which returns the result. Forgetting it still gives the right bitmap, but the redraw does the work and warns, and no caller is left to see a failure.

Switching back to IMMEDIATE while out of date also regenerates, but this returns void, so a failure is only logged. Render first to get the result.

Enums

lv_barcode_encoding_t

NameDescription
LV_BARCODE_ENCODING_CODE128_GS1Code 128 with GS1 encoding. Strips [FCN1] and spaces.
LV_BARCODE_ENCODING_CODE128_RAWCode 128 with raw encoding.
Used by 1 function
  • lv_barcode_set_encoding — param encoding

lv_barcode_update_mode_t

Controls when a change is turned into a new barcode bitmap. Applies to the data too. The colors are always a palette-only write, so they are never affected.

NameValueDescription
LV_BARCODE_UPDATE_MODE_IMMEDIATE0Re-generate as soon as a property changes (default)
LV_BARCODE_UPDATE_MODE_DEFERREDOnly mark the bitmap out of date and re-generate once, on the next redraw
Used by 1 function
  • lv_barcode_set_update_mode — param mode

Variables

lv_barcode_class

 
const lv_obj_class_t lv_barcode_class

Dependencies

Last updated on

On this page