Article View: borland.public.cppbuilder.multimedia
Article #326Re: jpg to bmp from FrameCallbackProc without fileio
From: Peter Fagerbrant
Date: Wed, 19 Jan 2005 08:56
Date: Wed, 19 Jan 2005 08:56
30 lines
2155 bytes
2155 bytes
I Use this for storing the bitmapinfo in a array:
for( int y=0;y<CAMRESY;y++){
xoffsIn = 0;
BYTE* pLine = (BYTE*) ((THackJPEGImage*)JPEGImage)->Bitmap->ScanLine[y];
for( int x=0;x<CAMRESX;x++){
int r = pLine[ xoffsIn + 0];
int g = pLine[ xoffsIn + 1];
int b = pLine[ xoffsIn + 2];
int iGrey = b*0.11 + g*0.59 + r*0.30;
pData8Out[ x + yoffsOut ] = iGrey;
xoffsIn += 3;
}
yoffsIn += CAMRESX+CAMRESX+CAMRESX;
yoffsOut += CAMRESX;
}
I do it in realtime. Unfortenly its impacts performens more then I want. The
camera delivers 30 fps and with this aproach I can only process 12-15 fps.
Is there a faster way to do this?
Is it for example possible to set the bit depht and greyscale directly in
the JPEGImage component and would it be faster?
Any idοΏ½es?
reg
/PFa
Technical Details
Message-ID:
<41ee20a3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!213.73.255.4.MISMATCH!newsfeed.multikabel.nl!lightspeed.eweka.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41ebb760@newsgroups.borland.com> <41ebbf15$1@newsgroups.borland.com> <41ebc6d3$1@newsgroups.borland.com> <41ebcb8c$1@newsgroups.borland.com> <41ebce5b$1@newsgroups.borland.com> <41ebd086$1@newsgroups.borland.com> <41ebd7a4@newsgroups.borland.com> <41ebdb02@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,e7775a35dcf064b6 X-Google-Attributes: gid10d0fc,public X-Google-Language: ENGLISH,ASCII From: "Peter Fagerbrant" <peter@fagerbrant.com> Newsgroups: borland.public.cppbuilder.multimedia References: <41ebb760@newsgroups.borland.com> <41ebbf15$1@newsgroups.borland.com> <41ebc6d3$1@newsgroups.borland.com> <41ebcb8c$1@newsgroups.borland.com> <41ebce5b$1@newsgroups.borland.com> <41ebd086$1@newsgroups.borland.com> <41ebd7a4@newsgroups.borland.com> <41ebdb02@newsgroups.borland.com> Subject: Re: jpg to bmp from FrameCallbackProc without fileio Date: Wed, 19 Jan 2005 09:56:04 +0100 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 193.14.171.139 Message-ID: <41ee20a3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1106124963 193.14.171.139 (19 Jan 2005 00:56:03 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!213.73.255.4.MISMATCH!newsfeed.multikabel.nl!lightspeed.eweka.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail