MCPcopy Create free account
hub / github.com/davisking/dlib / select_image

Method select_image

tools/imglab/src/metadata_editor.cpp:494–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492// ----------------------------------------------------------------------------------------
493
494void metadata_editor::
495select_image(
496 unsigned long idx
497)
498{
499 if (idx < lb_images.size())
500 {
501 // unselect all currently selected images
502 dlib::queue<unsigned long>::kernel_1a list;
503 lb_images.get_selected(list);
504 list.reset();
505 while (list.move_next())
506 {
507 lb_images.unselect(list.element());
508 }
509
510
511 lb_images.select(idx);
512 load_image(idx);
513 }
514 else if (lb_images.size() == 0)
515 {
516 display.clear_overlay();
517 array2d<unsigned char> empty_img;
518 display.set_image(empty_img);
519 }
520}
521
522// ----------------------------------------------------------------------------------------
523

Callers

nothing calls this directly

Calls 7

get_selectedMethod · 0.80
clear_overlayMethod · 0.80
load_imageFunction · 0.50
sizeMethod · 0.45
resetMethod · 0.45
move_nextMethod · 0.45
set_imageMethod · 0.45

Tested by

no test coverage detected