How to make Boost::GIL work with PNG & JPEG IO? - boost

Boost::GIL has almost perfect tutorial and manual. I find it troublesome to lack guide on building and using Boost::GIL work with PNG & JPEG IO. Does anyone have experience or have successfully did that? Please kindly advise! Thanks!
EDIT:
Answer lies here: http://opensource.adobe.com/wiki/display/gil/Downloads

I have used GIL successfully with JPEG.
I assume that you have downloaded and included the boost::gil headers.
The jpeg library is NOT included in the boost library.
The simplest thing is to include and link to one of the many copies of the jpeg library that are distributed. I use the one with wxWidgets ( wxWidgets-2.8.10\src\jpeg ). If you search your disk for the file jconfig.h, you should find a configured and built jpeg library that will work for you.
You can download the jpeg library source from http://www.ijg.org/ but then you will have to configure it for your platform and build it.

Related

Is there a way to display postscript (.ps) files on iOS?

I need to display .ps files in an iOS app. Native support for .ps to .pdf conversion appears to be switched off -- CGPSConverter,
https://developer.apple.com/documentation/coregraphics/cgpsconverter?language=occ
are not available on iOS:
https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_ps_convert/dq_ps_convert.html
Does anyone know of another way? Is there any 3rd party library that could help me here?
Please note that a Ghostscript/Pdftk based solution won't work due to GPL licensing terms.
Please note that Ghostscript is available under a commercial licence as well as GPL. In order to render a PostScript file you will need a PostScript interpreter, and there aren't very many of those. All the ones I know of are either GPL or commercial.

DICOM and OpenCV

Hai everyone,
I would like to know whether OpenCV can process DICOM images for 3D reconstruction purpose. Is there any other software that can handle DICOM images other than MATLAB. What about VC++?
Check out VTK. It natively handles DICOM images.
OpenCV is extensible and is written in C++ (I'm not familiar with it, just going from the documentation). So a good start would be an open source C++ DICOM library, there are plenty available. Here is a list of 17:
Search I Do Imaging
C++ and dicom? I would recommend DCMTK. Efficient, solid, raliable and open source.

What's the most optimal PNG internal format for iOS display can be generated from non-Apple platform?

PNG is recommended, fastest format for iOS. However PNG itself have several internal sub-formats. Alpha channel, byte ordering, color depth and etc.
I read Converting a normal PNG to iPhone Optimized format but the Q/A is about to images in bundles. Now I'm generating many thumbnails optimized for iOS from server. I can't use Apple's framework on server. However sub-optimal format is enough too. I want to hear opinions.
Given that Xcode-optimized PNGs are overrated simply creating smallest possible file may be a better option, and pngquant + PNGOUT or AdvPNG are good tools for that.
The iOS SDK runs pngcrush on the images it puts in the application bundle. Looking at the settings it uses would be a good place to start.
$ /Applications/Xcode.app/Contents/Developer\
/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush \
-revert-iphone-optimizations -q Local.png Local-standard.png
see http://developer.apple.com/library/ios/#qa/qa1681/_index.html

Convert Powerpoint to Flash in Linux

I'm looking to convert PPT and PPTX files to Flash (or flv) files in an automated fashion in Linux - So I need a command-line utility.
Are there any available options out there for me? (I haven't found any so far).
I was also looking for a Flash player to play ppt/pptx files as an alternative (similar to what slideshare provides) - does anyone know of any other than openslide?
Thanks for any help.
Related question here: Convert powerpoint to flash
Summary of answers: you should probably use OpenOffice to do it.
To do it from the command-line, it looks like you should probably use PyODConverter http://www.artofsolving.com/opensource/pyodconverter
OpenOffice generates a very poor SWF version. It should generate a back/foward button at least.

C++ Cross Platform Image Loader for OpenGL

I have tried everything from SDL to DevIL, and they have all failed for various reasons.
SDL segfaults for various reasons, and DevIL is having some weird problem where even after i include IL/ilut.h and linking everything, and including the other headers, it is not defining the functions i need to load images into opengl textures (something about USE_OPEN_GL not being defined). I am asking for any other lib out there for loading bitmaps or png's into a format i can easily convert to opengl, or a solution to the devil problem.
thanks
Both libpng and libjpeg can be rather daunting to build & use -- no wonder there are all sorts of wrapper libraries for both.
A very simple and minimal no-nonsense loader for jpg/png (and some other stuff aswell) without dependencies in a single C file is Sean Barrett's stb_image.c, if you just want to load some image files it adds absolutely minimal overhead to your program and is straightforward to use:
http://nothings.org/stb_image.c
As Adam suggests, I would also recommend to use libpng and libjpeg. You are not specifying if you write in C or C++, but if in C++, then I'd suggest to take a look at two handy thin wrappers on the both libraries: pngxx and jpegxx
LodePNG is a highly compact PNG Loader with no dependencies.
Comment on your experience with DevIL - it works flawlessly for me and many others. Why not try again to resolve your build problems? - shouldn't be too hard)
You can also try FreeImage library. It supports loading different image types and is functionally similar to DevIL, may work out of the box for you.
And about your problem with DevIL, you do not have to build ilu or ilut libraries to make DevIL functional. I would recommend you manage the OpenGL texture objects yourself, including uploading image data to OpenGL side.
SOIL is a decent lightweight one I've used before. It's actually specialized for loading OpenGL textures too.
http://lonesock.net/soil.html
you dont need ILUT to do what you want. you can simply use ilGetData() and glTexImage2d()
Loading bitmaps (.bmp) and netpbm images (.pbm, pgm, .pnm) is fairly trivial, since they store images uncompressed. For loading PNGs, use libpng. For loading JPEGs, use libjpeg. For other image types, use an appropriate library. There's a good change that slapping on 'lib' to the beginning of the image name will give you such a library, e.g. libtiff, libtga, etc.
Once you've loaded and uncompressed the raw image data, loading it into an OpenGL texture is just a matter of calling glTexImage2D() with the right parameters, and a couple of other GL state changes (e.g. how to do mipmapping).
Image Magick with either the C or C++ bindings?
http://www.imagemagick.org/script/index.php
Young but yet great enough SFML could be the one you're searching for. I've used it for numerous projects and all of 'em worked well on all my platforms (Win7 and Ubuntu).

Resources