×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    31

    CameraWrapper TDesC8* vs. CFbsBitmap*

    Hi all,
    this should be a fairly straightforward question but i couldn't find anything that clarifies this for me. I am trying to fully understand the CameraWrapper example. Taking a picture in the default way, i.e. preparing the camera as in:
    Code:
    TRAPD(err,iCameraWrapper->PrepareL(iCaptureSize));
    let's me grab pictures really quickly but then i think that i get a compressed jpeg (the data is TDesC8*). Alternatively, I can do:
    Code:
    TRAPD(err,iCameraWrapper->PrepareL(iCaptureSize,CCamera::EFormatFbsBitmapColor16M));
    In this way i get a CFbsBitmap but it's much slower (~1 second for 1024x768), probably because the image is much larger.


    I need it to be fast so the second solution does not really work for me, but then i need to access the pixels of the image to do some image processing. I couldn't find a way of converting the compressed TDesC8* to uncompressed CFbsBitmap* or TUInt8*.

    Is my only option that of saving the compressed image and then reload it as CFbsBitmap? Also, other formats such as EFormatYUV422, don't appear to be supported.

    Does anybody have any idea?
    Thanks so much!!!
    pdcb

  2. #2
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267

    Re: CameraWrapper TDesC8* vs. CFbsBitmap*

    Hi,

    You can use CImageDecoder:ataNewL() to create a CImageDecoder object and then use it to convert the jpeg data to a CFbsBitmap object, but I'm afraid the jpeg decoding is not faster than asking the CCamera for a bitmap object. (I guess the CCamera will do the decoding internally if you ask for bitmap object, and that is why it is so slow).

    By the way you can use the following code to check the image formats supported by the camera.

    Code:
    ...
    iCamera->CameraInfo(info); // assume that iCamera is a valid CCamera object
    info.iImageFormatsSupported; // a combination of several CCamera::TFormat values
    Regards

    Ziteng Chen

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    31

    Re: CameraWrapper TDesC8* vs. CFbsBitmap*

    Thanks a lot Ziteng Chen,

    So I did understand correctly: if you keep the compressed version there is no way i can actually access the pixels, right?

    Thanks a lot for the other suggestion as well!
    pdcb

  4. #4
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267

    Re: CameraWrapper TDesC8* vs. CFbsBitmap*

    Quote Originally Posted by pdcb_pdcb View Post
    Thanks a lot Ziteng Chen,

    So I did understand correctly: if you keep the compressed version there is no way i can actually access the pixels, right?

    Thanks a lot for the other suggestion as well!
    pdcb
    Hi,

    I can not find any Symbian OS/S60 API to access the pixel values of jpeg data, but technically I think it is possible to do so. May be you should google for more information as this is a general image processing problem.

    Regards

    Ziteng Chen

  5. #5
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: CameraWrapper TDesC8* vs. CFbsBitmap*

    Quote Originally Posted by chenziteng View Post
    Hi,

    I can not find any Symbian OS/S60 API to access the pixel values of jpeg data, but technically I think it is possible to do so. May be you should google for more information as this is a general image processing problem.

    Regards

    Ziteng Chen
    Decompress it to memory (to get a bitmap). Then access the pixel data of the bitmap.

    JPG is like archive, needs to be decompressed to access!
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  6. #6
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267

    Re: CameraWrapper TDesC8* vs. CFbsBitmap*

    Quote Originally Posted by tamhanna View Post
    Decompress it to memory (to get a bitmap). Then access the pixel data of the bitmap.

    JPG is like archive, needs to be decompressed to access!
    Hi,

    I know jpeg data are compressed but I think technically it is still possible to get its pixel values.

    "JPEG Pixel Interpolator"
    http://www.zero-based.org/software/jpegpixi/

    Regards

    Ziteng Chen

  7. #7
    Registered User
    Join Date
    Aug 2009
    Posts
    25

    Re: CameraWrapper TDesC8* vs. CFbsBitmap*

    I am also interested in doing some image processing from a Tdesc8* structure. Did you find out a way to do that?

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,697

    Re: CameraWrapper TDesC8* vs. CFbsBitmap*

    Then you will have to use CImageDecoder - you can find examples/documentation everywhere (Wiki, Docs section above, SDK Help).

Similar Threads

  1. Camerawrapper: how to get the full resolution of camera?
    By markus_sunela in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2009-09-18, 04:11
  2. Replies: 2
    Last Post: 2009-07-13, 09:45

Posting Permissions

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