🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #327

Re: jpg to bmp from FrameCallbackProc without fileio

#327
From: Hans Galema
Date: Wed, 19 Jan 2005 10:31
31 lines
2268 bytes
Peter Fagerbrant wrote:

>   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;

> 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?

Could you do a test to see what the impact on performance is by statement

   int iGrey = b*0.11 + g*0.59 + r*0.30;

Just make it int iGrey = 111; // value does not matter.

Think that those three multiplications are a performance break.

If so than there are possibilities.

> Is it for example possible to set the bit depht and greyscale directly in 
> the JPEGImage component and would it be faster?

Don't know that much about that. You better start a new thread in
borland.public.cppbuilder.graphics where you post your problem.

Please do the test. Could you spend an extra 16MB for a table ?

Hans.
Technical Details
Message-ID: <41ee3744$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
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> <41ee20a3$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,e7775a35dcf064b6
X-Google-Attributes: gid10d0fc,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 19 Jan 2005 11:31:36 +0100
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.multimedia
Subject: Re: jpg to bmp from FrameCallbackProc without fileio
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> <41ee20a3$1@newsgroups.borland.com>
In-Reply-To: <41ee20a3$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <41ee3744$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1106130756 129.125.201.248 (19 Jan 2005 02:32:36 -0800)
Lines: 32
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail