This function does all the work of writing a TGA image. It calles the TGAWriteHeader, TGAWriteImageId, TGAWriteColorMap and TGAWriteScanlines with the appropriate arguments to perform its task. So in most cases this is the only library function that needs to be called by the user to write out an TGA image (besides TGAOpen and TGAClose functions of course). The color map data is read automatically is existing. I suggest using this function instead of the other TGAWrite* functions.
It returns TGA_OK on success.