comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » object oriented dilemma
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
object oriented dilemma [message #21927] Mon, 09 October 2000 00:00 Go to next message
Jason Li is currently offline  Jason Li
Messages: 7
Registered: April 1999
Junior Member
Dear fellow IDL lovers,

If I want to write an image processing software using OOP method, I would
normally define a structure in __define module:

PRO myProgram__define
struct = {imagePointer:Ptr_New()}
END

Traditionally, a pointer is used to take care of variable image size. Then
load an image to self.imagePointer in the myProgram__init module.

hugeImage = bytarr(huge, huge)
self.imagePointer = Ptr_New(hugeImage, /no_copy)


Now in my METHOD modules, I have to perform an operation on line by line
basis. I don't know how to get a line data out of this self.imagePointer
without making a copy (dereferencing) of it first. My image size is rather
large. I don't how to be more memory efficient.

Question: What is the solution to this?


thanks

Jason
Re: object oriented dilemma [message #22021 is a reply to message #21927] Mon, 09 October 2000 20:05 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Nick Bower" <bowern@ses.curtin.edu.au> wrote in message
news:39E27E1D.CBF04991@ses.curtin.edu.au...
>> line = (*self.imagePointer)[5,*]
>
> i wonder if this will ever be addressed so we can discard the parentheses.
> after all there couldn't be another meaning for,
>
> line = *self.imagePointer[5,*]
>
> could there?

No, but there could be another meaning for

line = *self.imagePointer[5]

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
Re: object oriented dilemma [message #22022 is a reply to message #21927] Mon, 09 October 2000 19:25 Go to previous messageGo to next message
Nick Bower is currently offline  Nick Bower
Messages: 43
Registered: June 1999
Member
> line = (*self.imagePointer)[5,*]

i wonder if this will ever be addressed so we can discard the parentheses.
after all there couldn't be another meaning for,

line = *self.imagePointer[5,*]

could there?

nick
Re: object oriented dilemma [message #22024 is a reply to message #22022] Mon, 09 October 2000 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Nick Bower (bowern@ses.curtin.edu.au) writes:

> i wonder if this will ever be addressed so we can discard the parentheses.
> after all there couldn't be another meaning for,
>
> line = *self.imagePointer[5,*]

Well, as a matter of fact, if you just rearranged that,
it would be the 6th column and all the rows of the
pointer array set to the value of line. :-)

*self.imagePointer[5,*] = line

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: object oriented dilemma [message #22249 is a reply to message #22022] Fri, 27 October 2000 12:56 Go to previous message
William Daffer is currently offline  William Daffer
Messages: 34
Registered: February 1999
Member
Nick Bower <bowern@ses.curtin.edu.au> writes:

>> line = (*self.imagePointer)[5,*]
>
> i wonder if this will ever be addressed so we can discard the parentheses.
> after all there couldn't be another meaning for,
>
> line = *self.imagePointer[5,*]

> could there?
>
>

what if self.imagepointer = ptrarr(10,10) ?


whd
--
Ab hoc possum videre domum tuum.
Public Key: http://home.earthlink.net/~whdaffer/#PGP-public-key
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Cylindrical Equidistant.
Next Topic: IDL 5.4. Neato.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:49:30 PDT 2025

Total time taken to generate the page: 0.00688 seconds