Raw+srtm plugin for elevation maps

Plug-ins, add-ons, skins, icons, templates and other downloads. Contributions are welcome.

Moderators: XnTriq, helmut, xnview

User avatar
cameni
Posts: 4
Joined: Fri Sep 19, 2008 7:41 pm

Raw+srtm plugin for elevation maps

Post by cameni »

Hi,
I have plugin for reading raw files that contain elevation maps (raw or dem/srtm files).

Almost works now, but I have one problem - since these are raw files without a header, the plugin displays a dialog window first, allowing user to specify the dimensions, bit depth, various flags about the file (integer/floating point data, signedness, endianness) and rendering options (vertical flip, grayscale, clip ranges). The plugin can also autodetect the image dimensions according to the specified types, using correlation test.

However, herein lies the problem - XnView attempts to prefetch the next image, and if that happens to be a .raw file too, another dialog window is displayed as soon as the first file loads.
I wonder, would it be possible to for example to add something like GFP_NOPREFETCH flag to the support member of gfpGetPluginInfo function, that would turn off the prefetching for files with given extension? Or maybe there is some other solution ..

thanks
Last edited by cameni on Fri Nov 29, 2019 11:29 am, edited 4 times in total.
User avatar
xnview
Author of XnView
Posts: 44922
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Raw+srtm plugin for elevation maps

Post by xnview »

Perhaps you can disable 'read ahead'?
Pierre.
User avatar
cameni
Posts: 4
Joined: Fri Sep 19, 2008 7:41 pm

Post by cameni »

Yes I can .. but it affects everything. But I suppose there is no other option unless XnView and its plugin api is modified too :?
User avatar
cameni
Posts: 4
Joined: Fri Sep 19, 2008 7:41 pm

Re: Raw+srtm plugin for elevation maps

Post by cameni »

For anyone interested, here's the link to the raw/srtm elevation map reader plugin (I have also edited the link in the initial post).
There's also updated version with many fixes and some additional functionality, like automatic range detection and custom color mapping.
Last edited by cameni on Fri Nov 29, 2019 11:30 am, edited 1 time in total.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Raw+srtm plugin for elevation maps

Post by oops66 »

Thank you for the link
XnViewMP Linux X64 - Debian - X64
User avatar
cameni
Posts: 4
Joined: Fri Sep 19, 2008 7:41 pm

Re: Raw+srtm plugin for elevation maps

Post by cameni »

Added support for *.hgt extension, removed *.raw that was often conflicting with raw camera formats. Minor fixes.
New version xhgt.zip, description here.

Encountered an interesting problem - XnView refused to load the extension when it was named just "hgt.usr", I had to prefix it with 'x' making it "xhgt.usr", to force loading it.
Last edited by cameni on Fri Nov 29, 2019 11:44 am, edited 1 time in total.
Eduardo
Posts: 3
Joined: Wed Sep 07, 2011 9:50 am

Re: Raw+srtm plugin for elevation maps

Post by Eduardo »

Seeking for *.hgt extension support. Could u please redirect me to the thread it has been already mentioned? TIA.