C++ image encode / decode library [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm developing a scientific application for image processing. It uses it's own simple data type for storing images (pixel data, number of channels, etc.). What I need is the ability to read images of common formats (bmp, jpeg, png, maybe others), convert to my internal format and then export them after processing back to one of common formats.
I want this app to be as lightweight, as possible so I don't want to include "heavy" libraries, such as OpenCV or ImageMagick just for this one purpose.
Is there any simple, light and efficient c++ library just for encoding and decoding images of popular formats? Or the only option I have is to use separate libs, such as libjpeg and libpng, for each format?

In order to open common formats, there are 2 ways: the separated libraries or, SOMETIMES, the operating system (you can open a JPEG with Windows API, for example).
There's no problem in using ImageMagick/OpenCV... they are very light! And even if you CONSIDER lighter to use the separated libraries, you will have to implement a common format of bitmap for you to obtain data from the output of each library (believe me, there are tricks here: number of channels, channels order, pixel order [from top-left to bottom-right], etc)... well, a lot of work!
So, why not use something already implemented like ImageMagick/OpenCV? All of this work is already done! I really believe this is a very good choice!

Use FreeImage.
FreeImage is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications. FreeImage is easy to use, fast, multithreading safe, compatible with all 32-bit or 64-bit versions of Windows, and cross-platform (works both with Linux and Mac OS X).
to download: http://freeimage.sourceforge.net/

Related

OSX Native API Video Decoding C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Recently, I completed an audio decoding task using Apple Core Audio C++ API.
Now I am interested in decoding and getting raw uncompressed data of frames of a video file again with native OSX API with C++ (the analog of DirectShow or Media Foundation on Windows OS).
I have looked at available APIs (AVFoundation, Core Video, etc.) but couldn't find the framework which will do the job and is accessible through C++.
So my question which is the most suitable framework to pick up for this task?
You can read raw video data from a file using AVFoundation's AVAssetReader.
You create an AVAssetReader, add a AVAssetReaderTrackOutput with nil output settings then call copyNextSampleBuffer() until finished.
However, unless you've got very specific needs, you're unlikely to find the raw codec video data very useful. Are you trying to display the video? In that case AVPlayerLayer / AVPlayer (AVFoundation once again) are probably what you're looking for. If you want something lower level, CoreMedia/VideoToolbox may be for you. AVFoundation is an objective c framework so you'll be using objective-c++, while CoreMedia and VideoToolbox are C frameworks.

create AAC file from raw data using Media Foundation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have raw audio data and I want to create a corresponding aac/m4a/mp4 file using Media Foundation.
This article describes all the settings and configurations.
I wonder if there is an example code or tutorial that shows how to do that?
I found this tutorial, but unfortunately, this is not raw data to mp4 file, but mp4 to another mp4 tutorial (changing the properties of an already existing file).
Thanks.
AAC file is basically the file with raw data. You don't need API to create such file, just write the data using file I/O functions. There is a delicate aspect about things like ADTS headers, but in general it is as simple as that.
With Media Foundation you can produce MP4 files, and most suitable API for that is Sink Writer. Apparently, raw data alone is insufficient to produce as you have to provide additional mandatory information, such as at the very least basic properties of the encoding. Once you are through with this, you write your AAC data in chunks and the API formats it as an MP4/M4A file. I am not aware of a tutorial which does exactly this, but it's a pretty straightforward use of the API.

PDF Rendering library [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I working on a Metro Style application that need to render PDF documents (only viewing). I am looking for a library to render a .pdf document on the screen, preferably one I can include in my "commercial" app (pdf viewing is only a side functionality). Unfortunately, Windows 8 (atleast in the Dev Preview) does not have native PDF support :(
Any suggestions for a library? I am writing my app in C++/Cx.
Minor addition: Third-party options shall not use APIs that are not allowed in Metro Style apps. :-/
Alternatively, I need a PDF parser and I will try to create my own Direct2D renderer (might work ok for simple PDFs).
You could use Ghostscript, or MuPDF, I'm sure there are others. Both will require programming on your part. Both are available under commercial licences as well as GPL.
Windows 8.1 (Blue) will include PDF viwer and editor APIs (WinRT based). Therefore, this seems to be the easiest solution for my scenario.
Here's a list of development libraries on wikipedia that lists the different license types and languages alongside. Quite useful, though probably not exhaustive.
At the time of writing, ones that much your requirements of C++, Windows with a commercial license are:
Adobe PDF Library
LEADTOOLS
PDFTron

How to write C++ audio processing applications? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm an Electronics and Telecommunications student, next to my graduation. I'm gonna work on a project that involves my knowledge about DSP, music and audio in general. I allready know all the basic mathematic instruments and all the stuff I need to manage it, such as FFT, circular convolution ecc ecc.
I want to learn C++ programming basically for one reason: it's very important in the professional world!!! And I think it's one of the most used to write applications working with audio, especially when it's about real time processing.
Ok, after this small introduction I would like to know first, which are the most used libraries to work with audio processing in c++?? I was longer looking on the web but i couldn't find a lo of working stuff. (I work under linux with eclipse CDT enviroment).
Then I would like to know if there are good sources to learn how to write some working code, such as for example how to write a simple low pass filter. Basically now i will not write real time applications, I would like to start from the processing of a WAV file, or even better an MP3 file, so basically on vectors of samples.
Let's say that basically for now I would like to extract the waveform from an audio file, and save it to a thumbnail or to a PNG image.
Ok, for now I think it's all I would need.
Any ideas, advices, libraries, books, interesting sources about that?
Thanks a lot in advance for any kind of answer.
Giovanni.
I would suggest for you to write your own WAVE file reader and writer in C++, without relying on external libraries. The WAVE format is fairly straight forward, at least if you only intend on supporting the most common wave files.
Then you'll have access to the audio data, which you can easily manipulate in C++. I would recommend starting by modifying the volume, the number of channels to calculating statistics on the audio. Creating a PNG of the audio waveform requires some more advanced C++ skills...
Checkout this link which will give you some information on the available (commercial and open source) audio editing softwares.
Some interesting open source audio editing tools which are written in c++,
Audacity
LMMS
Qtractor
Ardour
Rosegarden
C++ library for audio processing.
SndObj
The Synthesis ToolKit in C++
C++ Code and links related Filters and audio processing..
C++ code for Filter,Audio Processing
Code Guru,Low pass filter
I've used BASS with good results (there's a C/C++ API you can use).

Scatter Plots in C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
What is the best way to graph scatter plots in C++?
Do you write data to a file and use another tool? Is there a library like matplotlib in Python?
I always write out data and then using gnuplot to create my graphs. It is by far the best way I have found of producing graphs in a variety of formats: eps, png, jpeg, xpm, you name it.
gnuplot will do scatter plot very easily. Provided the x and y values are in 2 space-separated columnss, then
plot "data.txt" using 1:2
Will give you a quick scatter plot. Then you can adjust it and what not using other gnuplot commands.
If you are involved in sciences, then learning gnuplot will be very valuable to you. It kicks the crap out of doing excel plots for sure and it eases the task of making plots to include in papers.
If you are looking for a C++ library rather than I independent plotting tool like gnuplot, I would consider the following:
Koolplot
dislin (Wikipedia article on dislin)
dislin seems to be the more interesting of the two. Here is a description extracted from the wikipedia article:
DISLIN is a high-level and easy to use plotting library developed by Helmut Michels at the Max Planck Institute in Katlenburg-Lindau, Germany. Helmut Michels currently works as a mathematician and Unix system manager at the computer center of the institute.
The DISLIN library contains routines and functions for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours and maps. Several output formats are supported such as X11, VGA, PostScript, PDF, CGM, HPGL, SVG, PNG, BMP, PPM, GIF and TIFF.
DISLIN is available for the programming languages Fortran 77, Fortran 90/95 and C. Plotting extensions for the languages Perl, Python and Java are also supported for most operating systems. The current version of DISLIN is 9.4, released in October 2008. The first version 1.0 was released in December 1986.
The DISLIN software is free for non-commercial use.
Very heavy solution: you could link against ROOT, which will do just about anything you want:
runs on Mac, Windows and Linux
runs compiled or using the cint interperter
output to a file in encapsulated postscript, PDF, gif, png...
display to the screen using several different technologies
serialize the data in an internal format that can be manipulated later
Sure, its a bit much for most people, but it does do exactly what you asked for. I use it because I know it and it is already on my machines becase I'm that kind of physicist.
Good old GNU, they have everything...
http://directory.fsf.org/project/plotutils/
This is certainly not the best way but I usually write output files that can be read by R and use this, along with an appropriate script, to plot the graphs.
The problem here is that C++, unlike Java for example, does not have built-in GUI or graphics. If you want to generate graphs with C++ you would need to use a GUI library available for your OS. There are free GUI libraries, many cross-plaform such as Qt or GTK.
However, as other people have pointed out, the easiest thing for you to do would be to save the data into a text file, and use another program to generate the graph. gnuplot is definitely a good choice. It comes standard with most linux distros, and you get for Windows under cygwin.
Regards plotting in C++ for anyone who didn't do it yet. I will say what I did to plot Graphs in C++
Download the zipped file "gp443win32.zip" from http://sourceforge.jp/projects/sfnet_gnuplot/downloads/gnuplot/4.4.3/gp443win32.zip/
Extract it in "C:\Gnuplot"
then I read "C:\Gnuplot\gnuplot\README.Windows"
and I got these information:
I used Windows 7 ==> so you need to download "winhlp32.exe"... just search for it "winhlp32.exe Windows 7" in a search engine and go through the first link.
Append to the "Path" Environment variable the path for binary folder which is "C:\Gnuplot\gnuplot\binary"
then I shutdown my computer and open it again. After I found that it didn't sense the change in the environment variables :D
you need now to write a sample code to test your plotting ability :)
so you can visit this link
http://code.google.com/p/gnuplot-cpp/source/browse/#svn%2Ftrunk
to see the header file "gnuplot_i.hpp" and source file "example.cc".
You will get many and many graphs, choose your appropriate graph, customize your core, and enjoy :)
If you're familiar with matplotlib, you can embed python in C/C++ applications. Depending on what you want it for, this might be a quick solution.
Chart Director has bindings for C++. I've used their .Net libraries, and I've been pretty happy with them. It's a pretty cheap library, and gives you the power to do all sorts of different charts.