Bitmap/Read an image through a pipe: Difference between revisions

Content added Content deleted
(→‎{{header|Tcl}}: More modern magick!)
Line 9: Line 9:
Here I've used '''convert''' by ImageMagick. It is up to the program to ''understand'' the source file type; in this way, we can read theoretically any image format ImageMagick can handle. The <tt>get_ppm</tt> function defined in [[Read ppm file]] is used.
Here I've used '''convert''' by ImageMagick. It is up to the program to ''understand'' the source file type; in this way, we can read theoretically any image format ImageMagick can handle. The <tt>get_ppm</tt> function defined in [[Read ppm file]] is used.


<lang c>image read_image(char *name);</lang>
<lang c>image read_image(const char *name);</lang>


<lang c>#include "imglib.h"
<lang c>#include "imglib.h"
Line 16: Line 16:
#define MAXFILENAMELEN 256
#define MAXFILENAMELEN 256
#define MAXFULLCMDBUF MAXCMDBUF+MAXFILENAMELEN
#define MAXFULLCMDBUF MAXCMDBUF+MAXFILENAMELEN
image read_image(char *name)
image read_image(const char *name)
{
{
FILE *pipe;
FILE *pipe;