- Radar *radar = level2->radar;
- g_debug("GisPluginRadar: _load_gui_success - %p", radar);
- /* Clear existing items */
- _load_gui_clear(self);
-
- gdouble elev;
- guint rows = 1, cols = 1, cur_cols;
- gchar row_label_str[64], col_label_str[64], button_str[64];
- GtkWidget *row_label, *col_label, *button = NULL, *elev_box = NULL;
- GtkWidget *table = gtk_table_new(rows, cols, FALSE);
-
- for (guint vi = 0; vi < radar->h.nvolumes; vi++) {
- Volume *vol = radar->v[vi];
- if (vol == NULL) continue;
- rows++; cols = 1; elev = 0;
-
- /* Row label */
- g_snprintf(row_label_str, 64, "<b>%s:</b>", vol->h.type_str);
- row_label = gtk_label_new(row_label_str);
- gtk_label_set_use_markup(GTK_LABEL(row_label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(row_label), 1, 0.5);
- gtk_table_attach(GTK_TABLE(table), row_label,
- 0,1, rows-1,rows, GTK_FILL,GTK_FILL, 5,0);
-
- for (guint si = 0; si < vol->h.nsweeps; si++) {
- Sweep *sweep = vol->sweep[si];
- if (sweep == NULL || sweep->h.elev == 0) continue;
- if (sweep->h.elev != elev) {
- cols++;
- elev = sweep->h.elev;
-
- /* Column label */
- g_object_get(table, "n-columns", &cur_cols, NULL);
- if (cols > cur_cols) {
- g_snprintf(col_label_str, 64, "<b>%.2f°</b>", elev);
- col_label = gtk_label_new(col_label_str);
- gtk_label_set_use_markup(GTK_LABEL(col_label), TRUE);
- gtk_widget_set_size_request(col_label, 50, -1);
- gtk_table_attach(GTK_TABLE(table), col_label,
- cols-1,cols, 0,1, GTK_FILL,GTK_FILL, 0,0);
- }
-
- elev_box = gtk_hbox_new(TRUE, 0);
- gtk_table_attach(GTK_TABLE(table), elev_box,
- cols-1,cols, rows-1,rows, GTK_FILL,GTK_FILL, 0,0);
- }
-
-
- /* Button */
- g_snprintf(button_str, 64, "%3.2f", elev);
- button = gtk_radio_button_new_with_label_from_widget(
- GTK_RADIO_BUTTON(button), button_str);
- gtk_widget_set_size_request(button, -1, 26);
- //button = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(button));
- //gtk_widget_set_size_request(button, -1, 22);
- g_object_set(button, "draw-indicator", FALSE, NULL);
- gtk_box_pack_end(GTK_BOX(elev_box), button, TRUE, TRUE, 0);
-
- g_object_set_data(G_OBJECT(button), "level2", (gpointer)level2);
- g_object_set_data(G_OBJECT(button), "type", (gpointer)vi);
- g_object_set_data(G_OBJECT(button), "elev", (gpointer)(int)(elev*100));
- g_signal_connect(button, "clicked", G_CALLBACK(_on_sweep_clicked), self);
+ g_debug("Conus: update_end_split");
+ guchar *out[] = {west,east};
+ const guchar alphamap[][4] = {
+ {0x04, 0xe9, 0xe7, 0x30},
+ {0x01, 0x9f, 0xf4, 0x60},
+ {0x03, 0x00, 0xf4, 0x90},
+ };
+ for (int y = 0; y < height; y++)
+ for (int x = 0; x < width; x++) {
+ gint subx = x % (width/2);
+ gint idx = x / (width/2);
+ guchar *src = &pixels[(y*width+x)*pxsize];
+ guchar *dst = &out[idx][(y*(width/2)+subx)*4];
+ if (src[0] > 0xe0 &&
+ src[1] > 0xe0 &&
+ src[2] > 0xe0) {
+ dst[3] = 0x00;
+ } else {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = 0xff;
+ for (int j = 0; j < G_N_ELEMENTS(alphamap); j++)
+ if (src[0] == alphamap[j][0] &&
+ src[1] == alphamap[j][1] &&
+ src[2] == alphamap[j][2])
+ dst[3] = alphamap[j][3];