×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    73

    How do i create TDes8 array

    i have something like this:
    TDes8 ?* & ? pdata;
    pdata.SetLength(aFrameW);
    TPoint px = TPoint(0,0);

    bmp = new (ELeave)CFbsBitmap;
    bmp->Create(TSize(aFrameW,aFrameH),EColor16MU);
    bmp->GetScanLine(pdata,TPoint(0,0),aFrameW,EColor16MU);

    i am unable to compile TDes8 pdata; i used & and * but according to what i wrote bmp->GetScanLine gives me an error during compile.

    Cheers.

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: How do i create TDes8 array

    You should instead try using RPointerArray & HBufC variables stored inside of it. And then use the Des() function from the HBufC to get the TPtr pointer out, which you should be able to use in the GetScanline.

    Anyway, what is the point of reading the scanlines and storing them ?
    if you are doing some pucture conversions, maybe you could just work one line at the time, and set it to new image afetr you have done with the line.

  3. #3
    Registered User
    Join Date
    Jul 2013
    Posts
    73

    Re: How do i create TDes8 array

    Thats what i want to achieve - get one line of Byte * pdata; then check it, get to other line and check it again etc.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: How do i create TDes8 array

    I would suggest continuing with the DataAddress-approach you have in the other thread. These GetScanLine stuff are overcomplicated. Especially as you ask about arrays, I assume you want the entire image, having it as a single block is much more convenient than in an array.
    TDes/8/16/C are all abstract parent types. They do not store data, they just provide the interface for handling read-only (C=const) or read-write data (the C-less variants). The basic read-write storage type with actual memory is TBuf/8/16.
    See diagram in http://developer.nokia.com/Community...2B/Descriptors, only the "leaf" types are meant to be instantiated.

  5. #5
    Registered User
    Join Date
    Jul 2013
    Posts
    73

    Re: How do i create TDes8 array

    If you moderators see the post edit history dont read it ;]
    i have two questions

    since DataAddress() is a TUint32 pointer. - note that i copy it because i will need it for further processing.

    int blen = eCamWidth * eCamHeight * 4;
    TUint32 * pdata = new TUint32[blen];
    Mem::Copy(pdata,image->DataAddress(),blen);
    Does my bit shifting is good and whats the order of RGB in cfsBitmap? RGBA or BGRA? (for EColor16MU displaymode)
    int ar = (TUint8)(pdata[0]);
    int ag = (TUint8)(pdata[0] >> 8);
    int ab = (TUint8)(pdata[0] >> 16);

    i found that bitshifting from GetRValue and others from MSDN sdk http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    but i am not sure what low order byte means. so i used single byte casting.

    cheers ;]
    Last edited by melepeta; 2013-10-27 at 02:07.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: How do i create TDes8 array

    I do not remember the exact byte order, but it is consistent over the various Symbian releases. So if you find the position of R/G/B for EColor16MU, that will continue to work on other Symbian devices too.
    The secret of U: unused. EColor16MU is a 32-bit format 1-1-1 byte for R-G-B components, and an unused one. This way it is easy to address with a TUint32 pointer. The other two variants are EColor16MA, which has alpha channel (transparency), and EColor16M which is a packed 24-bit format.

  7. #7
    Registered User
    Join Date
    Jul 2013
    Posts
    73

    Re: How do i create TDes8 array

    it seems to be BGRu format ;] u- unused


    Can anyone explain me why i copy width*height*bpp number of indexes when i have
    width * height pixels that each consist of T32Uint.

    int ar = (TUint8)(pdata[0]);
    int ag = (TUint8)(pdata[0] >> 8);
    int ab = (TUint8)(pdata[0] >> 16);


    shouldnt it be then


    int ar = (TUint8)(pdata[2]>> 16);
    int ag = (TUint8)(pdata[1]>> 8);
    int ab = (TUint8)(pdata[0]);

    for pixel 0,0 color?
    Last edited by melepeta; 2013-10-27 at 19:34.

Similar Threads

  1. How should we create a Array of ListModel ?
    By biren in forum [Archived] Qt Quick
    Replies: 5
    Last Post: 2011-11-22, 09:14
  2. How to create dynamic array ?
    By rohanwaugh in forum Symbian C++
    Replies: 2
    Last Post: 2009-07-06, 16:11
  3. how to create double array
    By ceehira in forum Symbian C++
    Replies: 1
    Last Post: 2005-08-23, 10:49
  4. TBTDevAddr to TDes8, convert number to TDes8
    By ranux in forum Symbian C++
    Replies: 2
    Last Post: 2005-02-18, 08:55
  5. how to create an array?
    By sumn79 in forum Symbian C++
    Replies: 4
    Last Post: 2004-02-26, 09:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •