POV-Ray : Newsgroups : povray.general : string code to load consecutive image_maps into array : Re: string code to load consecutive image_maps into array Server Time
19 Apr 2024 10:55:34 EDT (-0400)
  Re: string code to load consecutive image_maps into array  
From: jr
Date: 10 Oct 2020 11:55:01
Message: <web.5f81d8c729a401cca8a81eb0@news.povray.org>
hi,

"Kenneth" <kdw### [at] gmailcom> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > #macro mkPigment(i_)
> > ...
>
> Oops, I just noticed the difference between this macro and my array idea-- ...
> the various images might be used *repetitively* in a scene (which I forgot to
> mention!)...

ouch, yes.  although I've followed the thread(s), I completely lost sight of the


> For the macro, I came up with a slight change which *might* make it work
> likewise... but I don't think so:
>
> #macro mkPigment(i_)
> #declare IMG =
> pigment {image_map {jpeg concat("my image ",str(i_,0,0)," example.jpg")
> interpolate 2}}
> IMG
> #end
>
> That would just re-#declare the image for each macro call, with the same(?)
> memory increase...unless each 'newly-#declared' identical IMG just takes the
> place of the previous one in memory?

not sure, would expect the old to be de-allocated.  in case it helps, the name
too could be supplied, eg:

#macro mkPigment(n_, i_)
  #local n_ = pigment {...};
#end

but wrt reducing memory, (guessing) an array will be best.


regards, jr.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.