About Store Forum Documentation Contact



Post Reply 
fxBegin/fxEnd crop
Author Message
MrPi Offline
Member

Post: #1
fxBegin/fxEnd crop
What's the most efficient way to copy only parts of the image returned from D.fxEnd() to another image?

I would like to call crop directly on fxEnd() to only copy specific areas.
But In my tests only copying the full screen image to another image and then cropping that worked.

PHP Code:
D.fxEnd().copy(m_AggregatedImage, -1, -1, -1, -1IMAGE_2D, -1);
m_AggregatedImage.crop(m_AggregatedImage0001331631); 

But always copying the entire screen is not efficient enough for me.
(This post was last modified: 03-13-2014 10:50 PM by MrPi.)
03-13-2014 10:45 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #2
RE: fxBegin/fxEnd crop
You probably need to lock the image that .fxEnd() returns using .lock().
03-14-2014 01:59 PM
Find all posts by this user Quote this message in a reply
MrPi Offline
Member

Post: #3
RE: fxBegin/fxEnd crop
You can't lock the image that fxEnd() returns as it's const. You could only do lockRead(). But nothing without copy works. If the image wasn't const, I probably could do the cropping on itself.

I've experimented some more and this seems to be working:
PHP Code:
C ImageD.fxEnd();
   
i.lockRead();
   if (
m_AggregatedImage.lock())
   {
      for (
Int x 0133; ++x)
         for (
Int y 0163; ++y)
            
m_AggregatedImage.color(xyi.color(xy));
      
m_AggregatedImage.unlock();
   }
   
i.unlock(); 

Greg, would you say that's the most efficient way?
(This post was last modified: 03-14-2014 04:38 PM by MrPi.)
03-14-2014 04:30 PM
Find all posts by this user Quote this message in a reply
Post Reply