/*
Todo: include your libraries here.
*/

#include <stdio.h>
#define VC_EXTRALEAN  // If you don't have VS then you should define WIN32_LEAN_AND_MEAN instead.
#include <Windows.h>


#ifdef __cplusplus    // If used by C++ code, 
extern "C" {          // we need to export the C interface
#endif

/*
return - Version number, make sure it's comparable with strcmp() to your last version.
*/
__declspec(dllexport) LPCSTR Version()
{
	return ""; // Todo: write the version number
}

/*
return - The name of this Extractor, good candidates are any of and/or 
combinations of the following Author, Library Used, or the name of your dog.
*/
__declspec(dllexport) LPCSTR Name()
{
	return ""; // Todo: Write the name
}


/*
return - Nullterminated array of pointers to supported file extensions, each 
file extension is a lowercase string and excludes the dot ('.') character.
*/
__declspec(dllexport) LPCSTR* SupportedFiletypes(void)
{
	static const char* extensions[] =  { "", NULL }; // Todo: write the extensions, example: { "tga", "pcx", "dds", NULL }
	return extensions;
}



/*
szPath [in] - Zero terminated file path to the image.
dwBPP [out] - Original color depth in units of bits per pixel.
prgSize [out] - Original width and height of the image.
return - false on error, otherwise true.
*/
__declspec(dllexport) bool GetInfo(LPCSTR szPath, DWORD* dwBPP, SIZE *prgSize)
{

    /*
     Todo: 
      open the image
      extract the data and store them in the [out] params
      close the image
      
      don't forget to return false on error!
    */
	return true;
}


/*
szPath [in] - Zero terminated file path to the image.
dwRecClrDepth [in] - Recommended color depth in units of bits per pixel.
prgReqSize [in] - Desired width and height of the image.
return - A handle to a beermap on success, NULL on failure.
*/
__declspec(dllexport) HBITMAP ExtractThumbnail(LPCSTR szPath, DWORD dwRecBPP, const SIZE *prgReqSize)
{
    /*
      Todo:
       open the image
       convert the image to the right bits per pixle (dwRecBPP)
       scale the image to the right size (prgReqSize)
       convert the image to BGR (normal images are RGB)
       convert the image to HBITMAP (if you don't have your own function for this you can use the Win32 function "CreateBitmap()", you will need to give it a void* of raw image data
       close the image
       return the HBITMAP
       
       don't forget to return NULL on error!
    */

	return thumb;
}


#ifdef __cplusplus
}
#endif