int tsmSaveImage ( TsmConnection connect, uchar *tileBuffer, char *filename, TsmImageType type ) This function will write out a single TerraVision tile (e
This function will write out a single TerraVision tile (e.g. as returned by tsmReadTile) to an image file on disk. You need to pass the connection handle that was used to read the tile from (so that the information such as the dimensions of the tile may by gleaned), a localhost filename (or file: URL) to write the image file to, and an image format. Currently supported image formats are:
- TSM_PPM: binary Portable BitMap format file (no compression).
- TSM_GIF: Graphic Interchange Format file (lossless compression).
- TSM_JFIF: JPEG File Interchange Format file (lossy compression).
A filename extension will be added to your filename automatically (if not already supplied), i.e. one of ppm, gif, or jpg, respectively.
Note that when you choose TSM_PPM, the output image will be in ppm format if the image data is RGB, or pgm format if grayscale.
You can use the tsmSet(c,TSM_JPEG_QUALITY,v) function call as normal to set the jpeg quality level that is used to create the JPEG/JFIF format files.