As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Could someone recommend me a simple, easy to use PNG library either for c++ or .NET? All it needs to do is: load big PNG images (say 20000x20000), and tell me what color each pixel has.
Bitmap class in .NET can't load big images, throws an OutOfMemory exception.
I spent reasonable time on google looking through c++ libs, but all of them does much more than I need, and their usage is too complicated for me.
The defacto standard library for PNG files is LibPNG. It's not the best designed API in the world, but if you just work through the steps in one of their tutorials, it's pretty hard to mess up.
You'll probably find it easiest to wrap their API in a few simple functions (or class) of your own. Once you have that done, you should be good to go.
Try this:
http://nothings.org/stb_image.c
You can use it instead of zlib aswell.
If C# is an option, try PNGCS. It was done (by myself, in Java originally) for this scenario, it allows you to read and write line by line, no need to have all data in memory.
I have tested that it can read and write huge files (30000 x 30000 pixels, more than 2GB in disk), at least in Java
For C++:
Depending on the license you are able to use you may have a look at:
DeVIL: http://openil.sourceforge.net/(a bit outdated but a still good choice) (Linux, Win)
ImageMagick: http://www.imagemagick.org/script/index.php (well maintained, all platforms)
both support a variety of input and output formats.
EDIT: now also on Github: https://github.com/DentonW/DevIL
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Is it possible to load in a wav file and play in during a game that's been written in C++ without the use of third party libraries?
I mean, is there a small function that can handle this?
Some third party libraries seem to use huge amounts of code to do it. I found the same thing when loading images. Some libraries use so much code when sometimes it's possible to do the same amount of work in a small function... I just wondered if it was the same for audio files?
If not, what are the best/most basic Audio libraries that you guys know of?
C++ by itself has no concept of multimedia. Unless you write your own multimedia code, then you have to use libraries or platform-specific APIs for working with multimedia content and output. For instance, on Windows, the simpliest option is the Win32 API PlaySound() function.
Let me answer your questions one at a time.
Is it possible to LOAD a wav file without using 3rd party lib.?
Yes, certainly it is. A quick search brings up: http://home.foni.net/~wkurz/dynaplot/applicationnotes/loadwav.htm
Is it possible to PLAY a wav file without using 3rd party lib.?
Again, yes it is possible. Provided you are willing to write drivers for all possible combinations of hardware and OSs you are targetting.
Allow me to suggest a solution: use some opensource lib. There are many excellent ones out there. I use following for my (non-gaming apps)
Loading wav: libsndfile
Playing wav: portaudio
hope that helps
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
How to, display png (generally images beside .bmp) get it's depth, color(r,g,b) of a particular pixels(x,y) and how to change exactly one pixel then save the image. I could not find any simple example of that. Please show any sample
No 3rd party libraries, any please.
The PNG format is relatively simple, but not so simple as BMP. For one thing, it includes ZLIB compression. To encode/decode it you either need to use a PNG library like libpng plus a zlib library. If you don't want to use "third party" libraries (use only the standard libraries) you'd need to write quite a lot of code; you'll end rewriting the libpng/zlib libraries, almost; I doubt you'd really want to do that.
I myself wrote a PNG coder/decoder in Java/C# (PNGJ), but I relied on external ZLIB libraries (it's included in standard Java JRE)
Note that C++ isn't Java, or Python or somesuch. C++ internal libraries are mostly concerned with raw data handling, and leave more specific features to third parties. That is the very concept of C++ (and C, too).
Asking for a "purely internal" implementation of PNG (or "generally pictures beside .bmp") is, therefore, downright silly. You would need a different function for each specific picture format, usually including decompression, and since third-party libraries for that specific purpose are readily available, asking people to re-implement them is a bit... weird.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have some XML files that contain different function information. I am trying to create a tool that may extract that information from these files once they are created (function name, arguments number, type, returned values, etc.)
Later i will be manipulating these extracted information to create a new XML file. I have limited programming experience and it's all in C++. Any hint for the start would be appreciated.
If you just want to be able to read and write XML files, its probably just best to use an XML library rather than reinventing the wheel.
Since its not completely clear what you're trying to do, a good place to start would be this thread: What is the best open XML parser for C++? [Stack Overflow]
It's currently closed but it has a couple good answers that will help you figure out the best library to use for your situation.
If you need more help using it, feel free to edit your question, comment, or post a more specific question on the topic.
Happy coding and good luck!
I would suggest TinyXML, it's small, light-weight and suitable in many cases, it also has a non-viral license.
I used it a lot and it was very useful and ... just in case, there's also TinyXPath.
Unless you are doing this as a project to improve your C++ ability and understanding of XML, I would advise against trying to write the parsing code yourself. You will get much faster results using something out there that is already written and well established and there are a number of choices that are open to you. I personally like RapidXML. It is very simple to add to your code (you just need to #include one or two .hpp files - no libraries are needed) and it does everything that I have needed so far which is mainly parsing data from SOAP responses. The site also provides a comprehensive tutorial which enables you to get up and running very quickly.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Which product (Mallet or Weka) is better for text classification task:
Simpler to train
Better results
Documentation
I'm new for this problem so any comments will be great
MALLET is much easier to use and does most of its job invisibly. You don't have to convert the format of anything either, you just give it text files and it gives you back results.
Weka requires converting the text into a particular format (the Weka script for doing so it so slow and inefficient that I would recommend you write your own).
The problem with MALLET is that the training uses GB of memory and it can take hours, if you have large training sets.
Weka has more documentation, but most of it makes no sense. MALLET has very little documentation but is very simple to use.
To be honest, after testing the both of them, I opted for writing my own classifier.
I'm really enjoying Weka vs Mallet. Maybe I don't know enough yet, but doing machine learning with a GUI is awesome. You can tweak parameters and run different experiments (keeping the results of past experiments in front of you, too) very easily. I'm new to Weka, so this is FWIW.
As far as which one is simpler to train, I find Weka simpler. I don't know what kind of control you can have over your feature space by just pointing Mallet at some text (maybe it's good enough), but my experience with Mallet was comparable to Weka... writing scripts to get the input in the proper format, with the caveat that I had to do multiple steps to utilize some kind of serialized version of the data in Mallet.
Regarding your other questions, I can't really answer them right now, but am hoping this answer doesn't get downvoted 'cause it's good information to be out there, anyway.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
There are many libraries that manage the wiimote but I am looking for the "best" one, or at least that has the following features:
open-source
portable (at least Win32 and Linux)
written and usable in c or c++
good coverage of wiimote devices
I rely on people that already used such library. Google is good source of information but it doesn't know which one is best library.
if you will use multiple wiimotes, don't use wiiuse library. i am working on a stereo system with two wiimotes using wiiuse library but wiiuse made me crazy( it gives delayed ir tracking data ) and i decided to change my library wiiuse from wiiyourself
Some friends of mine have had good luck with wiiuse. It's in C, for both Windows and Linux.
Have you seen this:
http://www.codeplex.com/WiimoteLib
http://blogs.msdn.com/coding4fun/archive/2007/03/14/1879033.aspx
It may not be exactly what you are asking for, but with Mono you'll have the cross platform part of it.
What about Johnny Chung Lee - it's .Net but it's open source and could converted.
I think this might be what your looking for:
http://wiiuse.sourceforge.net/
Open-sourced, multi-platform and written in C/C++. They are looking for a OSX developper though, so I'm guessing it doesn't support it yet.
Maybe https://github.com/MJL85/wiiuse will do? Seems to have a lot of features and supports Windows and Linux, AND it is c.