PixelMath: calculating image wide values only once

Hello, 

I was looking at the PixelMath checkerboard video and got a little overboard because in my mind a chessboard is 8x8. 
So I came up with: 

sqcnt=8;

sqxsize=width()/sqcnt;

sqysize=height()/sqcnt;

sqx=floor(x()/sqxsize);

sqy=floor(y()/sqysize);

iif((sqx+sqy)%2 , 1, 0)


Now the values of sqcnt, sqxsize and sqysize are constant for the entire image. I'm under the impression that all the expressions are calculated for each pixel, but that's a waste of CPU cycles as far as the image constants go. Is there a way to prevent this? (I'm a software guy and this doesn't feel right in my OCD mind :-) )


Comments

Sign In or Register to comment.