Raptor Computing Systems Community Forums (BETA)

OpenPOWER ISA => General Discussion => Topic started by: MauryG5 on May 04, 2025, 04:30:27 pm

Title: Immages in C
Post by: MauryG5 on May 04, 2025, 04:30:27 pm
Sorry guys, I was trying to insert images in jpg format in a code written in C, but I can't figure out how to do it. I've read various information on the net but nothing that is really useful. I was wondering if it is possible to load images using C as a programming language...
Title: Re: Immages in C
Post by: ClassicHasClass on May 04, 2025, 09:23:52 pm
Yes, with libjpeg. Works pretty much anywhere.
Title: Re: Immages in C
Post by: MauryG5 on May 05, 2025, 12:56:15 am
Hi Classic, thank you for the information, I knew I could count on you. Listen, is there a general procedure or a written code to understand in detail how to write? Always thanks
Title: Re: Immages in C
Post by: ClassicHasClass on May 05, 2025, 08:51:39 pm
Something like this would give you a starting point: https://github.com/bitristan/libjpeg-sample/tree/master
Title: Re: Immages in C
Post by: MauryG5 on May 06, 2025, 12:18:46 am
Yes perfect thanks, yesterday I looked on github but I hadn't found this part yet. Above all I have to understand how to enter the path each time to make it send the photos I have to display to the screen. It seems that for each new photo I have to write all these lines of code, good work then... ;D
Title: Re: Immages in C
Post by: MauryG5 on May 06, 2025, 03:51:11 pm
I rewrote all that example code and entered the width and height in the required parameters, those of a photo that I'm trying to run.

Now I managed to get it to start, I made a mistake in the startup file after compiling and then I didn't understand where to put my file. I managed to get the image to start, everything is,
thank you very much Classic!