#ifndef _LOAD_JPEG_H
#define _LOAD_JPEG_H

namespace ogl2d
{
    namespace Utilities
    {
        /// DecodeJPGFileToGeneralBuffer
        /// @note 打开jpeg文件，得到内存块
        /// @return int 成功得到TRUE / 失败得到FALSE
        /// @param  const char* lpszPathName    文件名
        /// @param  unsigned short* width        图片宽度
        /// @param  unsigned short* height       图片高度
        /// @param  unsigned short* nchannels    图片通道数
        /// @param  unsigned char** buffer      内存块地址
        int DecodeJPGFileToGeneralBuffer(
            const char* lpszPathName,
            unsigned short* width,
            unsigned short* height,
            unsigned short* nchannels,
            unsigned char** buffer);

        /// CleanupJPGGeneralBuffer
        /// @note 释放由DecodeJPGFileToGeneralBuffer分配的内存空间
        /// @param  unsigned char** buffer      内存块地址
        void CleanupJPGGeneralBuffer(unsigned char** buffer);
        
    };   // Utilities
    
};   // ogl2d
#endif // _LOAD_JPEG_H
