Notes |
|
(0000820)
|
andras
|
2013-11-12 12:36
(edited on: 2013-11-12 12:38) |
|
Results of a brief investigation:
GIF files (e.g. old/*) seem to be displayed correctly.
In the Aloha sample, background/terrain.png appears OK, but module icons are missing. The difference between terrain.png and other PNGs (e.g. block/*) is depth: terrain.png is 8-bit, others are 32-bit. Converting block/queue.png to 8-bit PNG confirms that indeed 8-bit PNGs are displayed correctly.
Thus a possible workaround: convert all PNGs to 8-bit.
|
|
|
(0000821)
|
andras
|
2013-11-12 12:46
|
|
Since the same OMNeT++ version works on previous versions of OS X, problem is likely outside OMNeT++, e.g. in the shipped Tcl/Tk Aqua framework or (unlikely) OS X.
Upgrading TkPNG inside Tkenv to the latest version (1.6 to 1.18, see http://tkpng.cvs.sourceforge.net/viewvc/tkpng/tkpng/generic/ [^]) did not help.
Regarding the fact that only 8-bit images work, the strange thing is that Tk internally converts all images to 32-bit (see e.g. the colorize and resize functions in tkenv/tkcmd.cc -- they work on 4 bytes per pixel buffers).
Apparently the loading of 32-bit images results in a bogus data structure, different from the result of converting 8-bit images to 32 bits internally. |
|
|
(0000822)
|
andras
|
2013-11-12 13:18
|
|
Tk_PhotoGetImage + Tk_PhotoPutBlock doesn't fix a bogus image. |
|
|
(0000823)
|
andras
|
2013-11-15 16:10
|
|
Real cause: images with partial transparency are not displayed. I.e. if image contains 1 pixel where alpha is neither 0 not 255, it is not displayed!
Workaround: convert all alpha values to 0 or 255 on OS X. |
|
|
|
|
|
(0000830)
|
andras
|
2013-11-19 11:57
|
|
But the macports version is X11 not the Aqua version, right? So it doesn't look as nice :)
Meanwhile I implemented quantizing the alpha channel to 1 bit in all images in the Tkenv code when the TkAqua lib is in use. |
|
|
|
With homebrew tcl-tck(aqua tk 8.6.0) and xcode 5.0, omnetpp 4.3 can be successfully compiled on Mac OS X Mavericks. And there is no image display problem. However, the C indexer problem of ide seems to remaim. |
|
|
(0000838)
|
andras
|
2013-11-26 19:44
|
|
Thank you, we'll try it. Maybe it also solves other issues we have with Tkenv on OS X. |
|
|
|
Sorry, I forgot to mention that, to compile omnetpp 4.3, I have edited two files as follow:
omnetpp-4.3/src/nedxml/nederror.h add #include <string>
omnetpp-4.3/include/simutil.h #include <string.h> ----> #include <string> |
|
|
(0000840)
|
andras
|
2013-11-27 12:46
|
|
For OMNeT++ 4.4, we'll continue to use the bundled Apple Tcl/Tk version. I tried Tk 8.6.1 from MacPorts. It's TkAqua not X11, but it's no better than the Apple one with the Tkenv fixes I already implemented since 4.3.1. Still no partial transparency (it forces alpha to be 0 or 255 on images), Tkenv still comes up in the background, '-relief sunken' still not implemented for buttons, etc. In only fixes one minor issue, the flickering of the OK button on the initial 'choose config' dialog. |
|
|
|
8 bit alpha channel is converted to 1 bit transparency aon Mac OS X as Tkenv in 10.9 does not display those images. |
|