Good news: I think I have managed to achieve an optimal solution for high-dpi modes on OS X. Here is an example:
http://forum-images.pixinsight.com/20151112/1.8.4-osx/Desktop-lena.pngThis is a screenshot taken on a 27" iMac working in an emulated 1280x720 high-dpi mode. The physical resolution on this machine is 2560x1440, so one logical pixel corresponds to 2x2 physical pixels in this emulated mode. This is how a typical Retina display works on OS X.
The classic Lena image used for this example is an 8-bit grayscale image of 512x512 pixels. To understand how the new version works, look at the above screenshot at full size. When working on Retina displays in high-dpi modes, the new version 1.8.4 of PixInsight for OS X renders zoomed out images using the full physical monitor resolution. In this way, at 1:2 zoom ratio the image is actually represented 1:1 using physical pixels. For odd reduction zoom ratios 1:3, 1:5, etc, a fast nearest neighbor interpolation is used to achieve effective ratios of 1:1.5, 1:2.5, etc. For zoom ratios of 1:1 and above, images are represented using logical pixels. So at 1:1 the image is actually represented 2:1 on the physical screen using logical pixels.
This feature gives us access to the full display resolution without modifying the existing viewport and image coordinate systems at a high level. This means that all existing modules and scripts will continue working unmodified, with just one exception. The only exception is the
pcl::ImageWindow::ViewportBitmap() member function. in Retina high-dpi modes, this function returns now a bitmap with twice the specified dimensions for viewport zoom ratios equal to or smaller than 1:2. This is a breaking change that has to be taken into account by all modules using this function. Since I already had modified all standard modules with dynamic image generation capabilities to draw directly on viewports, the incidence of this change is very limited (only the Annotation tool uses explicit double buffering at this point, and hence it's the only one needing some work). This function has no PJSR counterpart, so it does not affect JavaScript scripts.
Fortunately, the internal screen rendering routines are highly modular, which has allowed me to implement this change in less than one day of work, including exhaustive testing. I'm starting to prepare a full rebuild of 1.8.4.1190 for Linux, OS X and Windows right now... after a good cup of coffee and a walk to stretch the legs...