From: Petr M. <mi...@ph...> - 2008-12-11 20:07:23
|
> > >> plot '<convert table.png avs:-' binary filetype=avs with rgbimage > > >> > > >> Nowadays gnuplot is typically compiled with the gd library. Therefore it > > >> should be pretty easy to use the gd-library to load png/gif/jpg images > > >> directly. I think it may not be too much code in breaders.c. Could somebody > > >> contribute this feature? > > > > > > I honestly don't see quite how that would work. > > > Using libgd, or libpng for that matter, will result in an in-memory copy > > > of the bitmap image. But that's not exactly what the binary file input code > > > wants; it expects to read a stream of binary data on the input fd, so that it > > > can filter, re-map, combine fields, etc. It seems to me that one would > > > have to write a new input layer that dummies up access to an in-memory > > > bitmap as successive reads to a fake pipe. The abstraction layer ... cannot be this done in some easy way? Currently there are fread(f, ..., bytes) ... so instead of fread() there would be memcpy(). > > > What would we gain by adding all this extra code? Isn't it much better to let > > > an external utility do this for us, as in the example you quote? > > > > One would gain readability. I would never have come to idea to use so > > complicated code to be able to read PNG images. The gain would be portability and speed. We could put lena.png and lena.jpg into demos/ and be sure that these demos can be run by Windows executables as well. --- PM |