nanogui: Thread: Concerning MWIMAGEHDR


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Concerning MWIMAGEHDR
From: Junior ####@####.####
Date: 5 Jan 2007 19:00:48 +0000
Message-Id: <ECFDB84D75A.00000388ejr@inbox.com>

I'm working on an optimize jpg decoder and I ran into a snag I'm not sure about.

In mwtypes.h, imagebits member of MWIMAGEHDR is defined as MWUCHAR which is unsigned char.
However, When I do my decoding, I'm producing the 16-bit RGB pixel value and I was expecting a pointer to a 16-bit var.
How do I get around this?
What format does nanoX expect the image memory to be in, a continuous memory arrangement or a matrix arrangement?

Thanks,
--Jr.
Subject: Re: [nanogui] Concerning MWIMAGEHDR
From: "Greg Haerr" ####@####.####
Date: 10 Jan 2007 04:44:17 +0000
Message-Id: <066601c73471$db4ffe30$2f01a8c0@HaydenLake>

> In mwtypes.h, imagebits member of MWIMAGEHDR is defined as MWUCHAR which 
> is unsigned char.
However, When I do my decoding, I'm producing the 16-bit RGB pixel value and 
I was expecting a pointer to a 16-bit var.
How do I get around this?

Just typecase it to (MWIMAGEBITS *)hdr->imagebits = ...

and you should be OK.  This pointer will always be to
an MWIMAGEBITS array, which will be dword
right aligned.


> What format does nanoX expect the image memory to be in, a continuous 
> memory arrangement or a matrix arrangement?

It is in continuous memory arrangement, laid out in
the same format as your target framebuffer memory is
laid out.  The width is defined by the 'pitch' member,
and the bytes per pixel by 'bytesperpixel'.

Regards,

Greg 

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.