I've posted this question on gis stackexchange, but maybe here is more
appropriate.

I am doing the same as in
http://gis.stackexchange.com/questions/134000/gdal-api-cant-save-image-in-some-formats

That is, saving a `JPEG` image with `GDAL`. I know I'd have to create a
`MEM` buffer and then `CreateCopy` to `JPEG`. However, I'd like to avoid
the allocation of two buffers since my image might be big and I use my own
memory buffer.

Is there a way to pass the data memory address that I'd like to use to the
MEM driver?

I've seen this mysterious article http://www.gdal.org/frmt_mem.html which
references the `DATAPOINTER` option. I've seen another reference [here](
https://lists.osgeo.org/pipermail/gdal-dev/2006-November/010583.html)
which does


sprintf(filename,"MEM:::DATAPOINTER=%d,PIXELS=%d,LINES=%d,BANDS=1,DATATYPE=%d,PIXELOFFSET=0,LINEOFFSET=0,BANDOFFSET=0",datpt,pixels,lines,datatype);
    dataset = GDALOpen(filename,GA_Update);

How would this translate to c++? Maybe

        papszOptions = CSLSetNameValue( papszOptions, "DATAPOINTER",
datapointer );

and so on?
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to