On Feb 23, 5:45 pm, jkj <ke...@vexona.com> wrote:
> Hi,
>
> I have a need to reproduce an image like this:
>
> http://diamondhead.org/linear_logspace.png
>
> beginning with data like this:
>
> http://diamondhead.org/linear_linearspace.png
>
> Using logarithmic scaling, the first image (produced by a custom
> graphics package) expands lower frequency components while contracting
> the higher frequency components. To do this in object graphics, I
> believe I will have to reconstruct the image data so that the lower
> frequency [the bottom] information is replicated according to a log
> scaling scheme.
>
> I can think of some [tortured] ways to do this but keep thinking there
> must be some sophisticated way to handle this in IDL. Any thoughts
> would be appreciated.
>
> Thanks,
> -Kevin
Hi,
I think I would use a flat filled IDLgrSurface that is projected as
one might view an image - with a log scaled y axis. Then use the
TEXTURE_MAP property to show the image data.
The example below uses XOBJVIEW to show the same image twice. The
bottom is "regular" and the top is stretched like in your example.
Note that I had to stretch the second model so you can see the
effect. I can't recall at this late hour how to get better control of
that, but it can be done much better.
Ben
**BEGIN
rose = READ_IMAGE(FILEPATH('rose.jpg',
SUBDIRECTORY=['examples','data']))
dim = SIZE(rose,/DIM)
nx = dim[1] & ny = dim[2]
x = findgen(nx)+1
y = findgen(ny)+1
s = replicate(1,nx,ny)
;the first surface is "regular"
o1 = OBJ_NEW("IDLgrSurface", s, x, y, $
color = [255,255,255], style = 2, $
texture_map = obj_new("IDLgrImage", rose))
model_1 = OBJ_NEW("IDLgrModel")
model_1->Add,o1
model_1->Translate, 0, -ny/2. - 10, 0
;the second surface is log scale in y
o2 = OBJ_NEW("IDLgrSurface", s, x, alog10(y), $
color = [255,255,255], style = 2, $
texture_map = obj_new("IDLgrImage", rose))
model_2 = OBJ_NEW("IDLgrModel")
model_2->Add,o2
model_2->Scale, 1, 100, 1 ;<<<< cheat here to make effect big enough
to see
model_2->Translate, 0,ny/2. + 10, 0
xobjview, [model_1, model_2] , /BLOCK
OBJ_DESTROY, [model_1, model_2]
**END
|