|
54 | 54 | PROP_ACTIVE, |
55 | 55 | PROP_LOADED, |
56 | 56 | PROP_VISIBLE, |
| 57 | + PROP_PRIORITY, |
57 | 58 |
|
58 | 59 | /* Signals. |
59 | 60 | */ |
@@ -452,7 +453,7 @@ tilesource_display_image(Tilesource *tilesource, VipsImage **mask_out) |
452 | 453 | x = vips_image_new(); |
453 | 454 | mask = vips_image_new(); |
454 | 455 | if (vips_sink_screen(image, x, mask, |
455 | | - TILE_SIZE, TILE_SIZE, MAX_TILES, 0, |
| 456 | + TILE_SIZE, TILE_SIZE, MAX_TILES, tilesource->priority, |
456 | 457 | tilesource_render_notify, update)) { |
457 | 458 | VIPS_UNREF(x); |
458 | 459 | VIPS_UNREF(mask); |
@@ -779,6 +780,10 @@ tilesource_property_name(guint prop_id) |
779 | 780 | return "VISIBLE"; |
780 | 781 | break; |
781 | 782 |
|
| 783 | + case PROP_PRIORITY: |
| 784 | + return "PRIORITY"; |
| 785 | + break; |
| 786 | + |
782 | 787 | default: |
783 | 788 | return "<unknown>"; |
784 | 789 | } |
@@ -970,6 +975,12 @@ tilesource_set_property(GObject *object, |
970 | 975 | tilesource->visible = b; |
971 | 976 | break; |
972 | 977 |
|
| 978 | + case PROP_PRIORITY: |
| 979 | + i = g_value_get_int(value); |
| 980 | + if (tilesource->priority != i) |
| 981 | + tilesource->priority = i; |
| 982 | + break; |
| 983 | + |
973 | 984 | default: |
974 | 985 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); |
975 | 986 | break; |
@@ -1023,6 +1034,10 @@ tilesource_get_property(GObject *object, |
1023 | 1034 | g_value_set_boolean(value, tilesource->visible); |
1024 | 1035 | break; |
1025 | 1036 |
|
| 1037 | + case PROP_PRIORITY: |
| 1038 | + g_value_set_int(value, tilesource->priority); |
| 1039 | + break; |
| 1040 | + |
1026 | 1041 | default: |
1027 | 1042 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); |
1028 | 1043 | break; |
@@ -1201,6 +1216,13 @@ tilesource_class_init(TilesourceClass *class) |
1201 | 1216 | FALSE, |
1202 | 1217 | G_PARAM_READWRITE)); |
1203 | 1218 |
|
| 1219 | + g_object_class_install_property(gobject_class, PROP_PRIORITY, |
| 1220 | + g_param_spec_int("priority", |
| 1221 | + _("priority"), |
| 1222 | + _("Render priority"), |
| 1223 | + -1000, 1000, 0, |
| 1224 | + G_PARAM_READWRITE)); |
| 1225 | + |
1204 | 1226 | tilesource_signals[SIG_PREEVAL] = g_signal_new("preeval", |
1205 | 1227 | G_TYPE_FROM_CLASS(class), |
1206 | 1228 | G_SIGNAL_RUN_LAST, |
@@ -1416,6 +1438,22 @@ tilesource_new_from_imageinfo(Imageinfo *ii) |
1416 | 1438 | return tilesource_new_from_image(ii->image); |
1417 | 1439 | } |
1418 | 1440 |
|
| 1441 | +Tilesource * |
| 1442 | +tilesource_new_from_iimage(iImage *iimage, int priority) |
| 1443 | +{ |
| 1444 | + Tilesource *tilesource = tilesource_new_from_imageinfo(iimage->value.ii); |
| 1445 | + |
| 1446 | + g_object_set(tilesource, |
| 1447 | + "active", TRUE, |
| 1448 | + "scale", iimage->scale, |
| 1449 | + "offset", iimage->offset, |
| 1450 | + "falsecolour", iimage->falsecolour, |
| 1451 | + "priority", priority, |
| 1452 | + NULL); |
| 1453 | + |
| 1454 | + return tilesource; |
| 1455 | +} |
| 1456 | + |
1419 | 1457 | gboolean |
1420 | 1458 | tilesource_has_imageinfo(Tilesource *tilesource, Imageinfo *ii) |
1421 | 1459 | { |
|
0 commit comments