Shop OBEX P1 Docs P2 Docs Learn Events
New Silicon LUT>colorspace? — Parallax Forums

New Silicon LUT>colorspace?

rjo__rjo__ Posts: 2,114
edited 2019-11-19 00:38 in Propeller 2
BIG THANKS to Brian and Ray for the HyperRam examples.

Quite useful since I couldn't get regular VGA working on my shiny new ES:)

I started modifying Ray's code to get my Stereo PropCam going... and immediately I ran into an itsy bitsy, tiny, tiny issue with the LUT.

I converted the 8 bit 640x480 color "bitmap2.bmp" to grayscale in ImageJ and re-exported it as "bitmap2g.bmp"

The Image was fine... except absolute white(255). Which appears pure blue... on two different monitors.

I wrote a routine to force the lut values to be in the 0 to 255 range and the little spot on the bird's head still appears blue.
            waitx   ##50000000
        
            mov x,#0

            rep @.end,#$100
    
            setbyte y,x,#0
            setbyte y,x,#1
            setbyte y,x,#2
            shl y,#8
            wrlut   y,x
            add x,#1
.end

I have turn the ES off and back on to rerun the code. No joy.

>PS in my routine there is a legacy line using rdfast… which I neglected to omit. It is harmless:)

Comments

  • rjo__rjo__ Posts: 2,114
    edited 2019-11-19 00:49
    I'm bumping this because I think it might be a hardware issue.

    The attached program is from Ray. I have commented out the cognew for HyperRam. So it is essentially VGA:)

    What I am finding is that the grayscale with other apps the bitmap is fine, but with the attached app, pixels with value of 255 are pure blue.

    To try to fix this, I generate my own lut values, but it doesn't help.

    So... if you have VGA 640x480 going... trying loading this bmp and see what you see:)

  • roglohrogloh Posts: 5,170
    edited 2019-11-19 01:16
    So are you saying that in a 256 palette LUT mode, colour index entry 255 always comes out blue independent of what is in the LUTRAM? I've not seen that, but would need to run a specific experiment to prove it.

    Not seeing it on my setup. Generated a grayscale sequence from 0-255 and don't see any blue line on the LCD monitor. Might possibly be some range or colour setting on your monitor(s) perhaps.
    PUB demo | x,y
    	repeat x from 0 to 255
    		mypalette[x]:=x*$1010100 '$ffffff_00
    	repeat x from 0 to 511
    	   repeat y from 0 to 128
    		byte[@screen][x+640*y]:=x
    
            clkset(_clkmode, _clkfreq)
    	initDisplay(@display1, O_VGA, @vga_timing, VGA_BASE_PIN, VGA_VSYNC_PIN, F_RGBHV, @lineBuffer, 0)	' create a VGA display
    	initRegion(@first, 0, 3, 0, @mypalette, @fontega14, 14, @screen) 		' create first region
    
  • RaymanRayman Posts: 13,898
    Try with the code here: http://forums.parallax.com/discussion/170782/rev-b-asm-spin-examples-that-run-under-flexgui#latest

    Look for "Here's the original VGA example, modified for Rev.B "

    See how that works with your bitmap image....
  • rjo__rjo__ Posts: 2,114
    That fixed it. Thanks Jesus.

Sign In or Register to comment.