Einzelnen Beitrag anzeigen

Medium

Registriert seit: 23. Jan 2008
3.686 Beiträge
 
Delphi 2007 Enterprise
 
#8

AW: 3-dimensional array to list?

  Alt 1. Jun 2011, 16:32
Arrays are already the most compact structure here. And it's not even the arrays (memorywise) that are your problem, the problem is, that the algorithm is constrained to a certain size. (You didn't write it yourself i guess.)

Currently, your arrays are sized like this:
Noise: 8*127*127
Layers: 8*128*128
These are fixed values, and do not depend on image size anywhere in the code you've shown. But because Layers[a, x, y] sometimes is accessed with image width and height for x and y, you run out of bounds on images larger than 128 pixel in any axis. (InterpolateRect() is such a candidate for example, if the passed Rect is >128².) You either need to make the current algo depend on image size, or upsample from 128x128. A list however, won't do anything at all. Especially nothing good.
"When one person suffers from a delusion, it is called insanity. When a million people suffer from a delusion, it is called religion." (Richard Dawkins)

Geändert von Medium ( 1. Jun 2011 um 16:37 Uhr)
  Mit Zitat antworten Zitat