Re: What decides the Mono LCD gray scale?

From: cool_harber (cool_harber_at_hotmail.com)
Date: 12/30/04


Date: Thu, 30 Dec 2004 22:37:41 +0800

You can try
// These masks are used to extract the color component for a 16 bit pixel
value. 5 bits red, 6 bits green, 5 bits blue.
ulong BitMasks[] = {0xFFF, 0xFFFF, 0xFFFF};

Someone told me it can improve display effect.But I just got all black.:)
By the way,I found there is something wrong with my hardware but not
software.
Thank you~

"voidcoder" <voidcoder@yahoo.com> 写入消息新闻:e$F8IXn7EHA.2552@TK2MSFTNGP09.phx.gbl...
> Yes, it looks better!!!!
>
> Looks better because 0.299*R + 0.587*G + 0.114*B does not
> produce dublicates (eg. RGB(255, 0, 0) != RGB(0, 0, 255) ) as
> (R+G+B)/3 does.
>
> Thanks again and Happy New Year!!!! :-)
>
>
>
>
> "cool_harber" <cool_harber@hotmail.com> wrote in message
> news:#FYjO0m7EHA.128@TK2MSFTNGP15.phx.gbl...
>> 3x,I have tested the palette as you said,but the display is also bad,
>> Maybe my lcd just can be used in 4bpp.
>> A few days ago,Someone told me another palette in newsgroup,here is the
>> code:
>> // RGB to YUV conversion is defined by CCIR 601 Standard as
>>
>> // Y = 0.299*R + 0.587*G + 0.114 B
>>
>> // Implementation :
>>
>> // scale= 15
>>
>> // Gray = (Red*299 + Green*587 + Blue*114)*scale/(1000*255);
>>
>>
>> By the way,I use v_pPaletteBuffer->palette[ 0xFF - i ] to inverted
> palette.
>>
>> "voidcoder" <voidcoder@yahoo.com>
> 写入消息新闻:ebnNysa7EHA.3820@TK2MSFTNGP11.phx.gbl...
>> > Nothing special. Don't really sure that it is right, but
>> > I'm using just everage RGB value for grayscale level.
>> >
>> > eg.
>> >
>> > for(i=firstEntry;i<end;i++)
>> > {
>> > v_pPaletteBuffer->palette[ i ] =
>> > (((unsigned short)source[i].peBlue + source[i].peGreen +
>> > source[i].peRed) / 3);
>> > }
>> >
>> > The better result is using inverted average value, eg
>> >
>> >
>> > v_pPaletteBuffer->palette[ i ] =
>> > 0x00FF ^ (((unsigned short)source[i].peBlue +
> source[i].peGreen
>> > +
>> > source[i].peRed) / 3);
>> >
>> > Please test it and come back with comments (since I think
>> > this is not really right way to calculate grayscale palette).
>> >
>> > May be any1 can share some ideas on "how to calculate right
>> > grayscale palette"?
>> >
>> >
>> >
>> > "cool_harber" <cool_harber@hotmail.com> wrote in message
>> > news:OnQDrka7EHA.2124@TK2MSFTNGP15.phx.gbl...
>> >> Thanks,But my lcd display looks so bad,
>> >> the text is more clear than the blurred icon or image!~
>> >> Can you share me your palette source code?
>> >> email:cool_harber@hotmail.com
>> >>
>> >> "voidcoder" <voidcoder@yahoo.com>
>> > 写入消息新闻:eLG5VDP7EHA.2316@TK2MSFTNGP15.phx.gbl...
>> >> > If You want to use SA_Lcd driver for that - you are out of luck.
>> >> > There are no support for true 4bpp mode. However you can use
>> >> > 8bpp mode and turn on monochrome mode in the controller.
>> >> > Then just setup your palette with grayscale entries
>> >> > (modify DispDrvrSetPalette function). In this case You will have
>> >> > 8bpp in frame buffer memory, 4bpp output and 16bit lookup palette
>> >> > (where only lower 8bits are grayscale values). And of course
>> >> > You have to setup other LCD contoller settings: timings, clocks etc.
>> >> >
>> >> > At least it works o.k. for me on PXA270.
>> >> >
>> >> >
>> >> >
>> >> > "cool_harber" <cool_harber@hotmail.com> wrote in message
>> >> > news:eN2ZwbO7EHA.3076@TK2MSFTNGP15.phx.gbl...
>> >> >> The mono lcd`s gray scale is decided by lcd controller or lcd
> itself?
>> >> >> I have a mono lcd with 4 data pins and about 70 Hz frame frequence
> ,I
>> >> >> want to use PXA255 to controll it.Do I get 256 scale gray?
>> >> >> Any suggestion is appreciated.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Relevant Pages

  • Re: Converting a GDI+ 24-bit RGB Bitmap to an Indexed Format Bitmap
    ... I created and populated a new palette and an array of indexed pixel ... method to create the new GDI+ "indexed" Bitmap. ... Is a stride necessary with indexed pixel data? ...
    (microsoft.public.win32.programmer.gdi)
  • Re: 8 bit to 18 bit per pixel lookup palette
    ... You may want to check what palette size you are ... Correct the frame buffer size to be, ... pixel format (see PXA documentation) and the actual LCD ...
    (microsoft.public.windowsce.platbuilder)
  • Re: HTML safe colors
    ... will be mapped to the nearest supported color. ... combinations of browser/display adapter tried to display the colour by ... 256 colour palette and if there are more than one of them on a page then the ... The first gif would display correctly as each of its colours (well most of ...
    (comp.infosystems.www.authoring.html)
  • Re: W98SE MCA Adapters
    ... Since there is no explicit bits-per-pixel register ... one just wonders how the card finds out the effective pixel width. ... a palette color is a 24-bit color, though only 256 palette colors are ...
    (comp.sys.ibm.ps2.hardware)
  • Re: FS-error diffusion (Was:Re: Different Implementations of VLIW .)
    ... You start with the top left pixel, pick the closest palette match (which ... except that the algorithm depends on it: ... The nice thing about ordered dithering is that it is completely parallizable. ...
    (comp.arch)