Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: C graphics ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 7 Topic 26104 of 26821
Post > Topic >>

Re: C graphics image to JPEG

by "cr88192" <cr88192@[EMAIL PROTECTED] > May 8, 2008 at 04:37 PM

"Morris Dovey" <mrdovey@[EMAIL PROTECTED]
> wrote in message 
news:4821e36f$0$89866$815e3792@[EMAIL PROTECTED]
> jt wrote:
>> hey guys..
>> can anybody suggest a code tht would save the graphics image saved in
>> C to jpg file.
>> is it available in the net.
>> plz tell the links.
>
> If you already have the data in your C program, all you need to do is
use 
> fopen() to open the file, fwrite() to move the data into the file, and 
> fclose() to finish.
>
> Much easier than you were expecting, yes?
>

if you have a valid jpeg bitstream in the buffer, but if it is actual 
graphical data (say, an image rendered into a buffer), then a little more
is 
needed than this.

as noted by others, IJG's libjpeg is a common option for loading/saving
jpeg 
files.

at least a few of us here have written custom load/save code as well (the 
advantage of going this route is that one can do a single-file 
implementation of the thing and avoid the dependency/liscense/bulk/... 
issues involved with using a 3rd party library).

of course, be warned that writing code to encode/decode a jpeg bitstream 
isn't exactly a newbie friendly task (at least a few of us are probably
also 
likely to make such code available on request as well).

my particular case:
I can send my version if asked via email.


I have been using it fairly effectively for both encoding and decoding for
a 
few years now.

it also has a faster encoder (lower quality/conpression tradeoff), which
was 
tweaked mostly for the task of encoding images to be used in MJPEG videos 
(basically, when I was trying to minimize the performance impact when
doing 
real-time video recording/encoding in my apps, albeit glReadPixels is the 
main bottleneck IME).

or such...


> -- 
> Morris Dovey
> DeSoto Solar
> DeSoto, Iowa USA
> http://www.iedu.com/DeSoto/
 




 7 Posts in Topic:
C graphics image to JPEG
jt <karthiks.840@[EMAI  2008-05-07 09:08:14 
Re: C graphics image to JPEG
jt@[EMAIL PROTECTED] (Je  2008-05-07 17:09:16 
Re: C graphics image to JPEG
richard@[EMAIL PROTECTED]  2008-05-07 17:24:45 
Re: C graphics image to JPEG
Morris Dovey <mrdovey@  2008-05-07 12:13:46 
Re: C graphics image to JPEG
"cr88192" <c  2008-05-08 16:37:32 
Re: C graphics image to JPEG
"soscpd@[EMAIL PROTE  2008-05-07 10:31:07 
Re: C graphics image to JPEG
"Malcolm McLean"  2008-05-07 20:55:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 1:20:27 CDT 2008.