🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.image.processing
Article #554

Re: image processing loops: a c programming question

#554
From: Maynard J. Handley
Date: Sat, 22 Aug 1992 05:17
25 lines
1818 bytes
In article <ben.714157437@galaxy>, ben@ph.tn.tudelft.nl (Ben Verwer)
writes:
>The basic question is how to program for images with variable sizes. The 
>solution presented by the author here (malloc a linear array of
>xsize*ysize) is
>imo the best. Those numerical recipies in C readers who propose the famous
>>array of pointers solution are thinking rather 2d. What if you go to 3d:
>an 
>image of pointers? Which is of course implemented as an array of pointers
>to 
>pointers. Good luck!
>As for the author who proposed the function call in the innerloop: you
>must 
>drink lots of coffee at work :)
>
Why not do what I do and have the best of both worlds? Allocate one long
array of nx*ny doubles, then an array of nx double*s, each of which points
to the appropriate section of the previous array. Operations that naturally
run across the entire array can be coded like that, and operations that
make use of the 2Dness of the array can be coded like that. You also have
something you can pass to Fortran. Of course I wrap it up in a C++ class to
hide the ugly details of creating and destroying the objects each time I
use them.

Maynard Handley
Technical Details
Message-ID: <1992Aug22.051723.28817@msc.cornell.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!swrinde!mips!darwin.sura.net!europa.asd.contel.com!emory!sol.ctr.columbia.edu!news.columbia.edu!rpi!batcomputer!lynx.msc.cornell.edu!tamar.msc.cornell.edu!maynard
References: <SLEHAR.92Aug7111245@kendall.bu.edu> <ben.714157437@galaxy>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!swrinde!mips!darwin.sura.net!europa.asd.contel.com!emory!sol.ctr.columbia.edu!news.columbia.edu!rpi!batcomputer!lynx.msc.cornell.edu!tamar.msc.cornell.edu!maynard
From: maynard@tamar.msc.cornell.edu (Maynard J. Handley)
Newsgroups: sci.image.processing
Subject: Re: image processing loops: a c programming question
Message-ID: <1992Aug22.051723.28817@msc.cornell.edu>
Date: 22 Aug 92 05:17:23 GMT
References: <SLEHAR.92Aug7111245@kendall.bu.edu> <ben.714157437@galaxy>
Sender: news@msc.cornell.edu
Distribution: sci.image.processing
Organization: Cornell-Materials-Science-Center
Lines: 25