On Fri, Jul 18, 2014 at 10:42:08AM +0200, Mathias Müller wrote:
> I just wanted to write kind of module for gwyddion. However, I got
> stuck at the point where data is displayed which is physically squared
> but not pixel size. Looking into the API it says one can get the
> pixel and physical size of a GwyDataView. How is it possible to
> reshape the view to make it squared (setting pixel size?)?
The style is controled by /0/data/realsquare (for channel 0). TRUE
means physical; FALSE or unset means pixelwise. The function
gwy_app_data_window_change_square() only changes how the channel is
displayed and if this is what you need it is easy.
Otherwise I'm not sure what you want to change:
(a) The physical dimensions, but not the number of pixels, i.e. fix the
pixel size. This can be easily done by gwy_data_field_set_xreal() or
gwy_data_field_set_yreal().
(b) The number of pixels, but not the physical dimensions of the entire
image. This requires resampling. See e.g. square_samples() in
basicops.c.
> I found some hints in the gwyddion source, but really don't wanna copy
> paste foreign code. This simply bloats up the code for this module.
Well, you may want a different logic of what and how to resample than
square_samples(). I would make a standard library function for squaring
the pixels if I was sure what it should do in all cases...
Regards,
Yeti
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Gwyddion-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwyddion-users