Skip to content

Commit 07707f3

Browse files
committed
some complex improvements
1 parent b546407 commit 07707f3

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

TODO

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
- complex images:
2+
3+
- display sliders don't work?
4+
- falsecolour doesn't work?
5+
16

27
- get judder with rotate and images smaller than the window
38

src/tilesource.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -471,22 +471,6 @@ tilesource_image(Tilesource *tilesource, VipsImage **mask_out, int current_z)
471471
tilesource->image_height = image->Ysize;
472472
}
473473

474-
/* This has to be before the sink_screen since we need to find the image
475-
* maximum .... this sounds bad, but FFTs are image at a time anyway, so
476-
* the pipeline should be short.
477-
*/
478-
if (image->Type == VIPS_INTERPRETATION_FOURIER) {
479-
if (vips_abs(image, &x, NULL))
480-
return NULL;
481-
VIPS_UNREF(image);
482-
image = x;
483-
484-
if (vips_scale(image, &x, "log", TRUE, NULL))
485-
return NULL;
486-
VIPS_UNREF(image);
487-
image = x;
488-
}
489-
490474
if (current_z > 0) {
491475
/* We may have already zoomed out a bit because we've loaded
492476
* some layer other than the base one. Calculate the
@@ -666,6 +650,22 @@ tilesource_rgb(Tilesource *tilesource, VipsImage *in)
666650
}
667651
}
668652

653+
/* Complex -> real.
654+
*/
655+
if (vips_band_format_iscomplex(image->BandFmt)) {
656+
if (vips_abs(image, &x, NULL))
657+
return NULL;
658+
VIPS_UNREF(image);
659+
image = x;
660+
661+
if (image->Type == VIPS_INTERPRETATION_FOURIER) {
662+
if (!(x = tilesource_log(image)))
663+
return NULL;
664+
VIPS_UNREF(image);
665+
image = x;
666+
}
667+
}
668+
669669
/* Colour management to srgb.
670670
*/
671671
if (tilesource->active &&

0 commit comments

Comments
 (0)