test your physical color depth.

Previous topic - Next topic

sf-in-sf

This prints 256 squares. Look which ones are dithered or not, the repeating patterns. A repeat every 4 means 6 bits for that channel, every 8 means 5 bits for the physical screen. click/touch to change the channels.
My android Archos tablet 10.1 G9 does rgb666, so 18 bits altogether.

Code (glbasic) Select
// --------------------------------- //
// Project: bands
// Start: Friday, January 11, 2013
// IDE Version: 10.244


// SETCURRENTDIR("Media") // go to media files

SETSCREEN 320,480,0
//LIMITFPS 2

GLOBAL hue% =1 // 1->7 only.

WHILE TRUE
plot(hue)
PRINT hue, 150,30
SHOWSCREEN
GOSUB changecolor
WEND
END // (?)

FUNCTION plot: hue%
LOCAL r%, g%, b%
LOCAL shade%, color%, t$
r=bAND(hue, 0x001)
g=bAND(hue, 2)
IF g>0 THEN g=1
b=bAND(hue, 4)
IF b>0 THEN b=1

FOR i% = 0 TO 7 // 8 columns.

// 256/8 = 32 -> 32 rows.
FOR j% =0 TO 31
shade = i*32 +j // like a memory linear position
// from a n-dimension table

color= RGB(r*shade, g*shade, b*shade)
DRAWRECT i*40,j*15,38,15, color

NEXT
NEXT

t$="R:"+r+"   G:"+g+"   b:"+b
PRINT t$, 150,60
ENDFUNCTION

SUB changecolor:
LOCAL mx%, my%, b1%, b2%
REPEAT
HIBERNATE
MOUSESTATE mx,my,b1,b2
UNTIL b1+b2 >0 // click down
REPEAT
HIBERNATE
MOUSESTATE mx,my,b1,b2
UNTIL b1+b2 =0 // click released
INC hue, 1
IF hue >7 THEN hue=1
ENDSUB
//
// P.S.
//How TO use your own icons FOR android:
//1) clean project, "trash" icon.
//2) remove all types of icons IN project folder.
//3) IF you want the white frame, put there "icon.png"
// IF you don't want it put there the same image,
// with name "androidicon.png"
// The image must be PNG format, 72x72.
// [PNG is great FOR transparency AND other things]
//4) Rebuild FOR android, AND voila.

On the day the atom is a cube I will start believing in the square pixel.

Wampus