#ifndef _LOAD_TGA_H
#define _LOAD_TGA_H

namespace ogl2d
{
    namespace Utilities
    {
        /// DecodeTgaBufferToGeneralBuffer
        /// @note 从tga文件内存映象块得到图像内存块
        /// @return int 成功得到TRUE / 失败得到FALSE
        /// @param  const unsigned char* dataBuf         tga文件映象内存块
        /// @param  unsigned long len           内存块大小
        /// @param  unsigned short* width        图片宽度
        /// @param  unsigned short* height       图片高度
        /// @param  unsigned short* nchannels    图片通道数
        /// @param  unsigned char** buffer      内存块地址
        int DecodeTgaBufferToGeneralBuffer(
            const unsigned char* dataBuf,
            unsigned long  len,
            unsigned short* width,
            unsigned short* height,
            unsigned short* nchannels,
            unsigned char** buffer);
        
        /// CleanupTgaGeneralBuffer
        /// @note 释放由DecodeTgaFileToGeneralBuffer分配的内存空间
        /// @param  unsigned char** buffer      内存块地址
        void CleanupTgaGeneralBuffer(unsigned char** buffer);
        
    };   // Utilities
    
};   // ogl2d
#endif // _LOAD_TGA_H
