mcap/check_targets.jai
Musa Mahmood 56588ff5e3 [0.0.15] Segmentation phase 6: the segments overlay in the Capture window, colours to choose
- The Capture window draws a segmented image's segments over it: each class in its colour, a shade
  of it for each instance, edges darker; under the OCR boxes, at any fit and zoom. A viewer worker
  reads the segs and mask chunks (never the images); the main thread makes the texture from the
  mask when the capture, the opacity or the classes hidden change.
- Above the image: Segments on or off, the opacity, and a legend of the classes (largest first,
  with counts): untick one to hide it, right click it to search has: for it. Hovering the image
  shows the segment's class, score and share of the image.
- Colours: a class's own is a hue from its name's hash. Its legend swatch is a colour picker
  (ImGui ColorEdit3) to choose another, kept in %APPDATA%\mcap\segment-colours.config for every
  image and library; right click it to go back to its own.
- Tests: the overlay's pixels (shades, edges, hidden classes, opacity), reading a file's segments
  for it, and chosen colours.
- This completes segmentation-plan.html's six phases.
2026-10-10 04:44:05 +01:00

52 lines
1.6 KiB
Plaintext

// Type-checks src/App.jai for another OS without producing or linking a binary, to catch errors
// in code your machine does not build:
//
// jai check_targets.jai - linux (from any OS)
// jai check_targets.jai - macos (from a Mac only: the Objective_C module runs code at compile time)
//
// The constants below stand in for the ones first.jai generates; keep their names in step.
#run,stallable {
set_build_options_dc(.{do_output = false});
args := get_build_options().compile_time_command_line;
target := Operating_System_Tag.LINUX;
cpu := CPU_Tag.X64;
if array_find(args, "macos") { target = .MACOS; cpu = .ARM64; }
options := get_build_options();
options.os_target = target;
options.cpu_target = cpu;
options.output_type = .NO_OUTPUT;
options.backend = .LLVM;
options.output_executable_name = "check";
options.output_path = ".build";
w := compiler_create_workspace("check");
set_build_options(options, w);
compiler_begin_intercept(w);
add_build_file("src/App.jai", w);
add_build_string(#string S
APP_NAME :: "mcap";
APP_FOLDER_NAME :: "mcap";
GIT_BRANCH :: "check";
GIT_HASH :: "-";
VERSION :: "0.0.15";
BUILD_DATE :: "-";
DEBUG :: true;
COMPILE_TESTS :: true;
COMPILE_ARGS :: "";
NO_CRASH_DIALOG :: false;
S, w);
while true {
message := compiler_wait_for_message();
if message.kind == .COMPLETE {
m := cast(*Message_Complete) message;
log("% check: %", target, m.error_code);
break;
}
}
compiler_end_intercept(w);
}
#import "Basic";
#import "Compiler";