I'm experiencing the following when using LoadNormalizedGammaTable in the latest beta
on OS X. I found the same behavior on a Dual 1.8 G5 GeForce FX5200 and on an iMac
Core 2 Duo Radeon X1600.
After loading a 256-line clut:
Anything I draw with color values 1-6 is drawn with the color on line 1 of the lookup table.
Anything I draw with color values 249-256 is drawn with the color on line 256
Accordingly, approximately every 20th line of the clut is never used.
If I understand how things are supposed work, the following code should make 10
columns of squares with colors vertically aligned. But I get the first six squares the same
and the last eight squares same, and a color gets skipped a little less than every two rows.
Am I doing something wrong?
Daw-An Wu
Caltech
%make table of 10 repeating colors, cut it at 256 rows
testClut= repmat([.4 .2 .2; 1 0 0; 1 .4 0; 1 1 0; 0 1 0;...
0 0 1; .8 .4 1; .6 .6 .6; 1 1 1; 0 0 0], [26 1]);
testClut= testClut(1:256,:);
%open window, load clut
win = screen('OpenWindow',0,1,[],8);
oldTable=screen('ReadNormalizedGammaTable',win);
screen('LoadNormalizedGammaTable',win,testClut);
%draw one square of each index color, in rows of 10.
for i = 1:256
screen('FillRect',win,i,[0 0 20 20] + [22 0 22 0]*rem(i-1,10) + [0 22 0 22]*fix((i-1)/10))
end
screen('Flip',win);
%show until mouse click
FlushEvents('mouseDown', 'mouseUp')
GetClicks;
%clean up
screen('LoadNormalizedGammaTable',win,oldTable);
screen CloseAll
on OS X. I found the same behavior on a Dual 1.8 G5 GeForce FX5200 and on an iMac
Core 2 Duo Radeon X1600.
After loading a 256-line clut:
Anything I draw with color values 1-6 is drawn with the color on line 1 of the lookup table.
Anything I draw with color values 249-256 is drawn with the color on line 256
Accordingly, approximately every 20th line of the clut is never used.
If I understand how things are supposed work, the following code should make 10
columns of squares with colors vertically aligned. But I get the first six squares the same
and the last eight squares same, and a color gets skipped a little less than every two rows.
Am I doing something wrong?
Daw-An Wu
Caltech
%make table of 10 repeating colors, cut it at 256 rows
testClut= repmat([.4 .2 .2; 1 0 0; 1 .4 0; 1 1 0; 0 1 0;...
0 0 1; .8 .4 1; .6 .6 .6; 1 1 1; 0 0 0], [26 1]);
testClut= testClut(1:256,:);
%open window, load clut
win = screen('OpenWindow',0,1,[],8);
oldTable=screen('ReadNormalizedGammaTable',win);
screen('LoadNormalizedGammaTable',win,testClut);
%draw one square of each index color, in rows of 10.
for i = 1:256
screen('FillRect',win,i,[0 0 20 20] + [22 0 22 0]*rem(i-1,10) + [0 22 0 22]*fix((i-1)/10))
end
screen('Flip',win);
%show until mouse click
FlushEvents('mouseDown', 'mouseUp')
GetClicks;
%clean up
screen('LoadNormalizedGammaTable',win,oldTable);
screen CloseAll