hbfimage

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  
c:\harbour\contrib\hbfimage
fi_winfu.c
TypeFunctionSourceLine
HB_FUNCFI_FITOBITMAP(void)
HB_FUNC( FI_FITOBITMAP )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;
      HBITMAP bitmap;
      HDC hDC;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function */
      hDC = GetDC( NULL );
      bitmap = CreateDIBitmap(hDC, FreeImage_GetInfoHeader(dib),
                              CBM_INIT, FreeImage_GetBits(dib),
                              FreeImage_GetInfo(dib), DIB_RGB_COLORS);
      ReleaseDC( NULL, hDC );

      /* return value */
      if( bitmap )
         hb_retptr( bitmap );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
fi_winfu.c81
HB_FUNCFI_BITMAPTOFI(void)
HB_FUNC( FI_BITMAPTOFI )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;
      HBITMAP bitmap;

      /* Retrieve parameters */
      bitmap = (HBITMAP) hb_parptr( 1 );

      /* run function */
      dib = NULL;

      if( bitmap ) {
        BITMAP bm;
        HDC hDC;

        GetObject( bitmap, sizeof(BITMAP), (LPSTR) &bm );
        dib = FreeImage_Allocate(bm.bmWidth, bm.bmHeight, bm.bmBitsPixel, 0, 0, 0);
        hDC = GetDC( NULL );
        GetDIBits( hDC, bitmap, 0, FreeImage_GetHeight(dib),
                   FreeImage_GetBits(dib), FreeImage_GetInfo(dib), DIB_RGB_COLORS);
        ReleaseDC( NULL, hDC );
      }

      /* return value */
      if( dib )
         hb_retptr( dib );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
fi_winfu.c124
HB_FUNCFI_WINDRAW(void)
HB_FUNC( FI_WINDRAW )
{
   if( hb_pcount() == 6 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC &&
       hb_parinfo( 3 ) & HB_IT_NUMERIC &&
       hb_parinfo( 4 ) & HB_IT_NUMERIC &&
       hb_parinfo( 5 ) & HB_IT_NUMERIC &&
       hb_parinfo( 6 ) & HB_IT_NUMERIC
     )
   {
      FIBITMAP *dib;
      HDC hDC;
      RECT rcDest;
      int scanlines;

      /* Retrieve parameters */
      dib  = ( FIBITMAP * ) hb_parptr( 1 );
      hDC  = (HDC) hb_parnl( 2 );
      rcDest.top    = hb_parni( 3 );
      rcDest.left   = hb_parni( 4 );
      rcDest.bottom = hb_parni( 5 );
      rcDest.right  = hb_parni( 6 );

      /* run function */
      SetStretchBltMode(hDC, COLORONCOLOR);

      scanlines = StretchDIBits(hDC, rcDest.left,
                                     rcDest.top,
                                     rcDest.right-rcDest.left,
                                     rcDest.bottom-rcDest.top,
                                     0, 0, FreeImage_GetWidth(dib), FreeImage_GetHeight(dib),
                                     FreeImage_GetBits(dib), FreeImage_GetInfo(dib),
                                     DIB_RGB_COLORS, SRCCOPY);

      /* return value */
      hb_retni( scanlines );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 6,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ),
            hb_paramError( 4 ), hb_paramError( 5 ), hb_paramError( 6 )
         );
         return;
      }
   }
}
fi_winfu.c174
fi_wrp.c
TypeFunctionSourceLine
HB_FUNCFI_INITIALISE(void)
HB_FUNC( FI_INITIALISE )
{
      BOOL bLoadPluginsOnly;

      /* Retrieve parameters */
      bLoadPluginsOnly = ( hb_parinfo( 1 ) & HB_IT_LOGICAL ? hb_parl( 1 ) : FALSE );

      /* Run function */
      FreeImage_Initialise( bLoadPluginsOnly );
}
fi_wrp.c85
HB_FUNCFI_DEINITIALISE(void)
HB_FUNC( FI_DEINITIALISE )
{
      /* Run function */
      FreeImage_DeInitialise();
}

/* -------------------------------------------------------------------------- */
fi_wrp.c99
HB_FUNCFI_GETVERSION(void)
HB_FUNC( FI_GETVERSION )
{
      /* Run function & return value */
      hb_retc( FreeImage_GetVersion() );
}
fi_wrp.c110
HB_FUNCFI_GETCOPYRIGHTMESSAGE(void)
HB_FUNC( FI_GETCOPYRIGHTMESSAGE )
{
      /* Run function & return value */
      hb_retc( FreeImage_GetCopyrightMessage() );
}

/* -------------------------------------------------------------------------- */
/* Message output functions ------------------------------------------------- */
/* -------------------------------------------------------------------------- */

/* DLL_API void DLL_CALLCONV FreeImage_OutputMessageProc(int fif, const char *fmt, ...); */

/* typedef void (*FreeImage_OutputMessageFunction)(FREE_IMAGE_FORMAT fif, const char *msg); */
fi_wrp.c119
VOIDFreeImageErrorHandler(FREE_IMAGE_FORMAT fif, const char *message)
void FreeImageErrorHandler(FREE_IMAGE_FORMAT fif, const char *message)
{
   const char *format;
   PHB_SYMB pSymbol;

   if( ! pErrorHandler )
   {
      /* Do nothing */
      return;
   }

   pSymbol = (PHB_SYMB) pErrorHandler;

   /*TraceLog( NULL, "ErrorHandle %p\n\r", pErrorHandler );*/

   if( ! pSymbol )
   {
      hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, "FreeImageErrorHandler", 1, hb_paramError( 1 ) );
      return;
   }

   format = FreeImage_GetFormatFromFIF(fif);

   /* launch error function at prg level */
   hb_vmPushSymbol( pSymbol );
   hb_vmPushNil();
   hb_vmPushString( format, strlen( format ) );
   hb_vmPushString( message, strlen( message ) );
   hb_vmDo( 2 );

}
fi_wrp.c137
HB_FUNCFI_SETOUTPUTMESSAGE(void)
HB_FUNC( FI_SETOUTPUTMESSAGE )
{
   pErrorHandler = NULL;
   FreeImage_SetOutputMessage(FreeImageErrorHandler);

/* TraceLog( NULL, "PCount = %i\n\r", hb_pcount() ); */

   if( hb_pcount() == 1 )
   {
      if( hb_parinfo( 1 ) & HB_IT_POINTER )
      {
         /* Set the pointer */
         pErrorHandler = hb_parptr( 1 );
      }
      else if( ISNIL( 1 ) )
      {
         /* do nothing */
      }
      else
      {
         /* Parameter error */
         {
            hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
               HB_ERR_FUNCNAME, 1,
               hb_paramError( 1 )
            );
            return;
         }
      }
   }
}

/* -------------------------------------------------------------------------- */
fi_wrp.c174
HB_FUNCFI_ALLOCATE(void)
HB_FUNC( FI_ALLOCATE )
{
   if( hb_pcount() >= 3 &&
       hb_parinfo( 1 ) & HB_IT_NUMERIC &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC &&
       hb_parinfo( 3 ) & HB_IT_NUMERIC
     )
   {
      int width, height, bpp;
      UINT red_mask, green_mask, blue_mask;

      /* Retrieve parameters */
      width      = hb_parni( 1 );
      height     = hb_parni( 2 );
      bpp        = hb_parni( 3 );
      red_mask   = ( hb_parinfo( 4 ) & HB_IT_NUMERIC ? hb_parni( 4 ) : 0 );
      green_mask = ( hb_parinfo( 5 ) & HB_IT_NUMERIC ? hb_parni( 5 ) : 0 );
      blue_mask  = ( hb_parinfo( 6 ) & HB_IT_NUMERIC ? hb_parni( 6 ) : 0 );

      /* run function & return value */
      hb_retptr( FreeImage_Allocate(width, height, bpp, red_mask, green_mask, blue_mask) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 )
         );
         return;
      }
   }
}
fi_wrp.c210
HB_FUNCFI_ALLOCATET(void)
HB_FUNC( FI_ALLOCATET )
{
   if( hb_pcount() >= 3 &&
       hb_parinfo( 1 ) & HB_IT_NUMERIC &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC &&
       hb_parinfo( 3 ) & HB_IT_NUMERIC
     )
   {
      FREE_IMAGE_TYPE type;
      int width, height, bpp;
      UINT red_mask, green_mask, blue_mask;

      /* Retrieve parameters */
      type       = ( FREE_IMAGE_TYPE ) hb_parni( 1 );
      width      = hb_parni( 2 );
      height     = hb_parni( 3 );
      bpp        = ( hb_parinfo( 3 ) & HB_IT_NUMERIC ? hb_parni( 3 ) : 8 );
      red_mask   = ( hb_parinfo( 4 ) & HB_IT_NUMERIC ? hb_parni( 4 ) : 0 );
      green_mask = ( hb_parinfo( 5 ) & HB_IT_NUMERIC ? hb_parni( 5 ) : 0 );
      blue_mask  = ( hb_parinfo( 6 ) & HB_IT_NUMERIC ? hb_parni( 6 ) : 0 );

      /* run function & return value */
      hb_retptr( FreeImage_AllocateT(type, width, height, bpp, red_mask, green_mask, blue_mask) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 )
         );
         return;
      }
   }
}
fi_wrp.c248
HB_FUNCFI_CLONE(void)
HB_FUNC( FI_CLONE )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;
      FIBITMAP *fiClonePtr;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function */
      fiClonePtr = FreeImage_Clone( dib );

      /* return value */
      if( fiClonePtr )
         hb_retptr( fiClonePtr );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c288
HB_FUNCFI_UNLOAD(void)
HB_FUNC( FI_UNLOAD )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function */
      FreeImage_Unload( dib );

      /* return value */
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */
fi_wrp.c322
HB_FUNCFI_LOADFROMMEM(void)
/* DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream); */
HB_FUNC( FI_LOADFROMMEM )
{
   if( hb_pcount() == 3 &&
       hb_parinfo( 1 ) & HB_IT_NUMERIC &&
       hb_parinfo( 2 ) & HB_IT_STRING  &&
       hb_parinfo( 3 ) & HB_IT_NUMERIC
     )
   {
      FIBITMAP *dib;
      FREE_IMAGE_FORMAT fif;
      FIMEMORY *stream;
      BYTE *szImage;
      int flags;

      /* Retrieve parameters */
      fif      = (FREE_IMAGE_FORMAT) hb_parni( 1 );
      szImage  = ( BYTE * ) hb_parcx( 2 );
      flags    = hb_parni( 3 );

      /* run function */
      stream   = FreeImage_OpenMemory( szImage, hb_parclen(2) );
      dib = FreeImage_LoadFromMemory(fif, stream, flags);
      FreeImage_CloseMemory( stream );

      /* return value */
      if( dib )
         hb_retptr( dib );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
         return;
      }
   }
}
fi_wrp.c355
HB_FUNCFI_LOAD(void)
HB_FUNC( FI_LOAD )
{
   if( hb_pcount() == 3 &&
       hb_parinfo( 1 ) & HB_IT_NUMERIC &&
       hb_parinfo( 2 ) & HB_IT_STRING  &&
       hb_parinfo( 3 ) & HB_IT_NUMERIC
     )
   {
      FIBITMAP *dib;
      FREE_IMAGE_FORMAT fif;
      const char *filename;
      int flags;

      /* Retrieve parameters */
      fif      = ( FREE_IMAGE_FORMAT ) hb_parni( 1 );
      filename = hb_parcx( 2 );
      flags    = hb_parni( 3 );

      /* run function */
      dib = FreeImage_Load(fif, filename, flags);

      /* return value */
      if( dib )
         hb_retptr( dib );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0)); */
fi_wrp.c398
HB_FUNCFI_SAVE(void)
HB_FUNC( FI_SAVE )
{
   if( hb_pcount() == 4 &&
       hb_parinfo( 1 ) & HB_IT_NUMERIC &&
       hb_parinfo( 2 ) & HB_IT_POINTER &&
       hb_parinfo( 3 ) & HB_IT_STRING  &&
       hb_parinfo( 4 ) & HB_IT_NUMERIC
     )
   {
      FREE_IMAGE_FORMAT fif;
      FIBITMAP *dib;
      const char *filename;
      int flags;

      /* Retrieve parameters */
      fif        = ( FREE_IMAGE_FORMAT ) hb_parni( 1 );
      dib        = ( FIBITMAP * ) hb_parptr( 2 );
      filename   = hb_parcx( 3 );
      flags      = hb_parni( 4 );

      /* run function & return value */
      hb_retl( FreeImage_Save(fif, dib, filename, flags) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 4,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* DLL_API BOOL DLL_CALLCONV FreeImage_SaveU(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0)); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_SaveToHandle(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0)); */

/* -------------------------------------------------------------------------- */
/* Memory I/O stream routines ----------------------------------------------- */
/* -------------------------------------------------------------------------- */

/*
DLL_API FIMEMORY *DLL_CALLCONV FreeImage_OpenMemory(BYTE *data FI_DEFAULT(0), DWORD size_in_bytes FI_DEFAULT(0));
DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream);
DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
DLL_API BOOL DLL_CALLCONV FreeImage_SaveToMemory(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, int flags FI_DEFAULT(0));
DLL_API long DLL_CALLCONV FreeImage_TellMemory(FIMEMORY *stream);
DLL_API BOOL DLL_CALLCONV FreeImage_SeekMemory(FIMEMORY *stream, long offset, int origin);
DLL_API BOOL DLL_CALLCONV FreeImage_AcquireMemory(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes);
*/

/* -------------------------------------------------------------------------- */
/* Plugin Interface --------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

/*
DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterLocalPlugin(FI_InitProc proc_address, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterExternalPlugin(const char *path, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
DLL_API int DLL_CALLCONV FreeImage_GetFIFCount(void);
DLL_API int DLL_CALLCONV FreeImage_SetPluginEnabled(FREE_IMAGE_FORMAT fif, BOOL enable);
DLL_API int DLL_CALLCONV FreeImage_IsPluginEnabled(FREE_IMAGE_FORMAT fif);
DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFormat(const char *format);
DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromMime(const char *mime);
DLL_API const char *DLL_CALLCONV FreeImage_GetFormatFromFIF(FREE_IMAGE_FORMAT fif);
DLL_API const char *DLL_CALLCONV FreeImage_GetFIFExtensionList(FREE_IMAGE_FORMAT fif);
DLL_API const char *DLL_CALLCONV FreeImage_GetFIFDescription(FREE_IMAGE_FORMAT fif);
DLL_API const char *DLL_CALLCONV FreeImage_GetFIFRegExpr(FREE_IMAGE_FORMAT fif);
DLL_API const char *DLL_CALLCONV FreeImage_GetFIFMimeType(FREE_IMAGE_FORMAT fif);
DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilename(const char *filename);
DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilenameU(const wchar_t *filename);
DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsReading(FREE_IMAGE_FORMAT fif);
DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsWriting(FREE_IMAGE_FORMAT fif);
DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportBPP(FREE_IMAGE_FORMAT fif, int bpp);
DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportType(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type);
DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsICCProfiles(FREE_IMAGE_FORMAT fif);
*/

/* -------------------------------------------------------------------------- */
fi_wrp.c443
HB_FUNCFI_OPENMULTIBITMAP(void)
HB_FUNC( FI_OPENMULTIBITMAP )
{
   if( hb_pcount() >= 4 &&
       hb_parinfo( 1 ) & HB_IT_NUMERIC &&
       hb_parinfo( 2 ) & HB_IT_STRING  &&
       hb_parinfo( 3 ) & HB_IT_LOGICAL &&
       hb_parinfo( 4 ) & HB_IT_LOGICAL
     )
   {
      FIMULTIBITMAP *dib;
      FREE_IMAGE_FORMAT fif;
      const char *filename;
      BOOL create_new;
      BOOL read_only;
      BOOL keep_cache_in_memory;
      int flags;

      /* Retrieve parameters */
      fif        = ( FREE_IMAGE_FORMAT) hb_parni( 1 );
      filename   = hb_parcx( 2 );
      create_new = hb_parl( 3 );
      read_only  = hb_parl( 4 );
      keep_cache_in_memory = ( hb_parinfo( 5 ) & HB_IT_LOGICAL ? hb_parl( 5 ) : FALSE );
      flags      = ( hb_parinfo( 6 ) & HB_IT_NUMERIC ? hb_parni( 6 ) : 0 );

      /* run function */
      dib = FreeImage_OpenMultiBitmap(fif, filename, create_new, read_only, keep_cache_in_memory, flags);

      /* return value */
      if( dib )
         hb_retptr( dib );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 4,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
         return;
      }
   }
}
fi_wrp.c528
HB_FUNCFI_CLOSEMULTIBITMAP(void)
HB_FUNC( FI_CLOSEMULTIBITMAP )
{
   if( hb_pcount() >= 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIMULTIBITMAP *bitmap;
      int flags;

      /* Retrieve parameters */
      bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 );
      flags  = ( hb_parinfo( 2 ) & HB_IT_NUMERIC ? hb_parni( 2 ) : 0 );

      /* run function & return value */
      hb_retl( FreeImage_CloseMultiBitmap(bitmap, flags) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c575
HB_FUNCFI_GETPAGECOUNT(void)
HB_FUNC( FI_GETPAGECOUNT )
{
   if( hb_pcount() >= 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIMULTIBITMAP *bitmap;

      /* Retrieve parameters */
      bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retni( FreeImage_GetPageCount(bitmap) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c606
HB_FUNCFI_APPENDPAGE(void)
HB_FUNC( FI_APPENDPAGE )
{
   if( hb_pcount() == 2 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_POINTER
     )
   {
      FIMULTIBITMAP *bitmap;
      FIBITMAP *data;

      /* Retrieve parameters */
      bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 );
      data   = ( FIBITMAP * ) hb_parptr( 2 );

      /* run function & return value */
      FreeImage_AppendPage(bitmap, data);
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}
fi_wrp.c636
HB_FUNCFI_INSERTPAGE(void)
HB_FUNC( FI_INSERTPAGE )
{
   if( hb_pcount() == 3 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC &&
       hb_parinfo( 3 ) & HB_IT_POINTER
     )
   {
      FIMULTIBITMAP *bitmap;
      int page;
      FIBITMAP *data;

      /* Retrieve parameters */
      bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 );
      page   = hb_parni( 2 ) - 1; /* 0-based index */
      data   = ( FIBITMAP * ) hb_parptr( 3 );

      /* run function & return value */
      FreeImage_InsertPage(bitmap, page, data);
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
         return;
      }
   }
}
fi_wrp.c668
HB_FUNCFI_DELETEPAGE(void)
HB_FUNC( FI_DELETEPAGE )
{
   if( hb_pcount() == 2 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC
     )
   {
      FIMULTIBITMAP *bitmap;
      int page;

      /* Retrieve parameters */
      bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 );
      page   = hb_parni( 2 ) - 1; /* 0-based index */

      /* run function & return value */
      FreeImage_DeletePage(bitmap, page);
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}
fi_wrp.c703
HB_FUNCFI_LOCKPAGE(void)
HB_FUNC( FI_LOCKPAGE )
{
   if( hb_pcount() == 2 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC
     )
   {
      FIMULTIBITMAP *bitmap;
      int page;

      /* Retrieve parameters */
      bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 );
      page   = hb_parni( 2 ) - 1; /* 0-based index */

      /* run function & return value */
      hb_retptr( FreeImage_LockPage(bitmap, page) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}
fi_wrp.c735
HB_FUNCFI_UNLOCKPAGE(void)
HB_FUNC( FI_UNLOCKPAGE )
{
   if( hb_pcount() == 3 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC &&
       hb_parinfo( 3 ) & HB_IT_LOGICAL
     )
   {
      FIMULTIBITMAP *bitmap;
      FIBITMAP *page;
      BOOL changed;

      /* Retrieve parameters */
      bitmap  = ( FIMULTIBITMAP * ) hb_parptr( 1 );
      page    = ( FIBITMAP * ) hb_parptr( 2 );
      changed = hb_parl( 3 );

      /* run function & return value */
      FreeImage_UnlockPage(bitmap, page, changed);

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
         return;
      }
   }
}
fi_wrp.c767
HB_FUNCFI_MOVEPAGE(void)
HB_FUNC( FI_MOVEPAGE )
{
   if( hb_pcount() == 3 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC &&
       hb_parinfo( 3 ) & HB_IT_NUMERIC
     )
   {
      FIMULTIBITMAP *bitmap;
      int target, source;

      /* Retrieve parameters */
      bitmap  = ( FIMULTIBITMAP * ) hb_parptr( 1 );
      target  = hb_parni( 2 );
      source  = hb_parni( 3 );

      /* run function & return value */
      hb_retl( FreeImage_MovePage(bitmap, target, source) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* DLL_API BOOL DLL_CALLCONV FreeImage_GetLockedPageNumbers(FIMULTIBITMAP *bitmap, int *pages, int *count); */

/* -------------------------------------------------------------------------- */
/* Filetype request routines ------------------------------------------------ */
fi_wrp.c803
HB_FUNCFI_GETFILETYPE(void)
HB_FUNC( FI_GETFILETYPE )
{
   if( hb_pcount() >= 1 &&
       hb_parinfo( 1 ) & HB_IT_STRING
     )
   {
      const char *filename;
      int size;

      /* Retrieve parameters */
      filename   = hb_parcx( 1 );
      size       = ( hb_parinfo( 2 ) & HB_IT_NUMERIC ? hb_parni( 1 ) : 0 );

      /* run function & return value */
      hb_retni( FreeImage_GetFileType(filename, size) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c846
HB_FUNCFI_GETFILETYPEFROMMEM(void)
/* DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromMemory(FIMEMORY *stream, int size FI_DEFAULT(0)); */
HB_FUNC( FI_GETFILETYPEFROMMEM )
{
   if( hb_pcount() >= 1 &&
       hb_parinfo( 1 ) & HB_IT_STRING
     )
   {
      BYTE * szImage;
      FIMEMORY *stream;
      int size;

      /* Retrieve parameters */
      szImage = ( BYTE * ) hb_parcx( 1 );
      stream  = FreeImage_OpenMemory( szImage, hb_parclen(1) );
      size    = ( hb_parinfo( 2 ) & HB_IT_NUMERIC ? hb_parni( 1 ) : 0 );

      /* run function & return value */
      hb_retni( FreeImage_GetFileTypeFromMemory(stream, size) );
      FreeImage_CloseMemory( stream );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */
fi_wrp.c878
HB_FUNCFI_GETIMAGETYPE(void)
HB_FUNC( FI_GETIMAGETYPE )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retni( FreeImage_GetImageType(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */
fi_wrp.c917
HB_FUNCFI_ISLITTLEENDIAN(void)
HB_FUNC( FI_ISLITTLEENDIAN )
{
      /* run function & return value */
      hb_retl( FreeImage_IsLittleEndian() );
}

/* -------------------------------------------------------------------------- */

/* DLL_API BOOL DLL_CALLCONV FreeImage_LookupX11Color(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_LookupSVGColor(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue); */


/* -------------------------------------------------------------------------- */
fi_wrp.c949
HB_FUNCFI_GETBITS(void)
HB_FUNC( FI_GETBITS )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_GetBits(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c966
HB_FUNCFI_GETSCANLINE(void)
HB_FUNC( FI_GETSCANLINE )
{
   if( hb_pcount() == 2 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC
     )
   {
      FIBITMAP *dib;
      int scanline;

      /* Retrieve parameters */
      dib      = ( FIBITMAP * ) hb_parptr( 1 );
      scanline = hb_parni( 2 );

      /* run function & return value */
      hb_retptr( FreeImage_GetScanLine(dib, scanline) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/*
DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
*/

/* -------------------------------------------------------------------------- */
fi_wrp.c995
HB_FUNCFI_GETCOLORSUSED(void)
HB_FUNC( FI_GETCOLORSUSED )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retnl( FreeImage_GetColorsUsed(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1038
HB_FUNCFI_GETBPP(void)
HB_FUNC( FI_GETBPP )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value*/
      hb_retnl( FreeImage_GetBPP(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1068
HB_FUNCFI_GETWIDTH(void)
HB_FUNC( FI_GETWIDTH )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retnl( FreeImage_GetWidth(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1098
HB_FUNCFI_GETHEIGHT(void)
HB_FUNC( FI_GETHEIGHT )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retnl( FreeImage_GetHeight(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1128
HB_FUNCFI_GETLINE(void)
HB_FUNC( FI_GETLINE )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retnl( FreeImage_GetLine(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1158
HB_FUNCFI_GETPITCH(void)
HB_FUNC( FI_GETPITCH )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retnl( FreeImage_GetPitch(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1188
HB_FUNCFI_GETDIBSIZE(void)
HB_FUNC( FI_GETDIBSIZE )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retnl( FreeImage_GetDIBSize(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1218
HB_FUNCFI_GETPALETTE(void)
HB_FUNC( FI_GETPALETTE )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_GetPalette(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1248
HB_FUNCFI_GETDOTSPERMETERX(void)
HB_FUNC( FI_GETDOTSPERMETERX )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retnl( FreeImage_GetDotsPerMeterX(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1277
HB_FUNCFI_GETDOTSPERMETERY(void)
HB_FUNC( FI_GETDOTSPERMETERY )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retnl( FreeImage_GetDotsPerMeterY(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1307
HB_FUNCFI_SETDOTSPERMETERX(void)
HB_FUNC( FI_SETDOTSPERMETERX )
{
   if( hb_pcount() == 2 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC
     )
   {
      FIBITMAP *dib;
      UINT res;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );
      res = hb_parni( 2 );

      /* run function & return value */
      FreeImage_SetDotsPerMeterX(dib, res);

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}
fi_wrp.c1337
HB_FUNCFI_SETDOTSPERMETERY(void)
HB_FUNC( FI_SETDOTSPERMETERY )
{
   if( hb_pcount() == 2 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC
     )
   {
      FIBITMAP *dib;
      UINT res;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );
      res = hb_parni( 2 );

      /* run function & return value */
      FreeImage_SetDotsPerMeterY(dib, res);

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}
fi_wrp.c1370
HB_FUNCFI_GETINFOHEADER(void)
HB_FUNC( FI_GETINFOHEADER )
{
   if( hb_pcount() == 1 &&
       hb_parinfo( 1 ) & HB_IT_POINTER
     )
   {
      FIBITMAP *dib;
      /* We need not worry about Memory Management - will be automatically released! */
      /*BITMAPINFOHEADER *bmpinfoheader = (BITMAPINFOHEADER *) hb_xgrab( sizeof( BITMAPINFOHEADER ) );*/
      BITMAPINFOHEADER *bmpinfoheader;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      bmpinfoheader = FreeImage_GetInfoHeader(dib);

      /*hb_retclenAdoptRaw( (char *) bmpinfoheader, sizeof( BITMAPINFOHEADER ) );*/
      hb_retptr( bmpinfoheader );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1403
HB_FUNCFI_GETINFO(void)
HB_FUNC( FI_GETINFO )
{

   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;
      BITMAPINFO *bmpinfo;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      bmpinfo = FreeImage_GetInfo(dib);

      hb_retptr( bmpinfo );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1438
HB_FUNCFI_GETCOLORTYPE(void)
HB_FUNC( FI_GETCOLORTYPE )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retni( FreeImage_GetColorType(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1471
HB_FUNCFI_GETREDMASK(void)
HB_FUNC( FI_GETREDMASK )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retni( FreeImage_GetRedMask(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1501
HB_FUNCFI_GETGREENMASK(void)
HB_FUNC( FI_GETGREENMASK )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retni( FreeImage_GetGreenMask(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1531
HB_FUNCFI_GETBLUEMASK(void)
HB_FUNC( FI_GETBLUEMASK )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retni( FreeImage_GetBlueMask(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1561
HB_FUNCFI_GETTRANSPARENCYCOUNT(void)
HB_FUNC( FI_GETTRANSPARENCYCOUNT )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retni( FreeImage_GetTransparencyCount(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1591
HB_FUNCFI_GETTRANSPARENCYTABLE(void)
HB_FUNC( FI_GETTRANSPARENCYTABLE )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_GetTransparencyTable(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1621
HB_FUNCFI_SETTRANSPARENT(void)
HB_FUNC( FI_SETTRANSPARENT )
{
   if ( hb_pcount() == 2 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_LOGICAL
      )
   {
      FIBITMAP *dib;
      BOOL enabled;

      /* Retrieve parameters */
      dib     = ( FIBITMAP * ) hb_parptr( 1 );
      enabled = hb_parl( 2 );

      /* run function & return value */
      FreeImage_SetTransparent(dib, enabled);

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}
fi_wrp.c1650
HB_FUNCFI_SETTRANSPARENCYTABLE(void)
HB_FUNC( FI_SETTRANSPARENCYTABLE )
{
   if ( hb_pcount() == 3 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_POINTER &&
        hb_parinfo( 3 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      BYTE *table;
      int count;

      /* Retrieve parameters */
      dib   = ( FIBITMAP * ) hb_parptr( 1 );
      table = ( BYTE * ) hb_parptr( 2 );
      count = hb_parni( 3 );

      /* run function & return value */
      FreeImage_SetTransparencyTable(dib, table, count);

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
         return;
      }
   }
}
fi_wrp.c1683
HB_FUNCFI_ISTRANSPARENT(void)
HB_FUNC( FI_ISTRANSPARENT )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retl( FreeImage_IsTransparent(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1719
HB_FUNCFI_HASBACKGROUNDCOLOR(void)
HB_FUNC( FI_HASBACKGROUNDCOLOR )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retl( FreeImage_HasBackgroundColor(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1749
HB_FUNCFI_GETBACKGROUNDCOLOR(void)
HB_FUNC( FI_GETBACKGROUNDCOLOR )
{

   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER /*&& hb_parinfo( 2 ) & HB_IT_STRING*/
      )
   {
      FIBITMAP *dib;
      RGBQUAD *bkcolor = NULL;

      /* Retrieve parameters */
      dib     = ( FIBITMAP * ) hb_parptr( 1 );
      /*bkcolor = ( RGBQUAD * ) hb_param( 2, HB_IT_STRING )->item.asString.value;*/
      /*bkcolor = ( RGBQUAD * ) hb_parptr( 2 );*/

      /* run function & return value */
      /*hb_retl( FreeImage_GetBackgroundColor(dib, bkcolor) );*/
      FreeImage_GetBackgroundColor(dib, bkcolor);
      /*hb_storptr( bkcolor, 2 );*/
      hb_retptr( bkcolor );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}
fi_wrp.c1779
HB_FUNCFI_SETBACKGROUNDCOLOR(void)
HB_FUNC( FI_SETBACKGROUNDCOLOR )
{

   if ( hb_pcount() == 2 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        /*hb_parinfo( 2 ) & HB_IT_POINTER*/
        hb_parinfo( 2 ) & HB_IT_STRING
      )
   {
      FIBITMAP *dib;
      RGBQUAD *bkcolor;

      /* Retrieve parameters */
      dib     = ( FIBITMAP * ) hb_parptr( 1 );
      bkcolor = (RGBQUAD * ) hb_itemGetCPtr( hb_param( 2, HB_IT_STRING ) );
      /*bkcolor = ( RGBQUAD * ) hb_parptr( 2 );*/

      /* run function & return value */
      hb_retl( FreeImage_SetBackgroundColor(dib, bkcolor) );
      /*FreeImage_GetBackgroundColor(dib, bkcolor);*/
      /*hb_retptr( bkcolor );*/
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */



/* -------------------------------------------------------------------------- */
fi_wrp.c1815
HB_FUNCFI_GETICCPROFILE(void)
HB_FUNC( FI_GETICCPROFILE )
{

   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib     = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_GetICCProfile(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c1858
HB_FUNCFI_CREATEICCPROFILE(void)
HB_FUNC( FI_CREATEICCPROFILE )
{

   if ( hb_pcount() == 3 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_POINTER &&
        hb_parinfo( 3 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      void *data;
      long size;

      /* Retrieve parameters */
      dib     = ( FIBITMAP * ) hb_parptr( 1 );
      data    = hb_parptr( 2 );
      size    = hb_parnl( 3 );

      /* run function & return value */
      hb_retptr( FreeImage_CreateICCProfile(dib, data, size) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 3,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 )
         );
         return;
      }
   }
}
fi_wrp.c1888
HB_FUNCFI_DESTROYICCPROFILE(void)
HB_FUNC( FI_DESTROYICCPROFILE )
{

   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib     = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      FreeImage_DestroyICCProfile(dib);

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */
/* Line conversion routines ------------------------------------------------- */
/* -------------------------------------------------------------------------- */

/*
DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_555(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_565(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To4(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To8(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To8(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_555(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_565(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To8(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To8(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_565_To16_555(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_555(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_555(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_555_To16_565(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_565(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_565(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_555(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_565(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To24(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_555(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_565(BYTE *target, BYTE *source, int width_in_pixels);
DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To32(BYTE *target, BYTE *source, int width_in_pixels);
*/

/* -------------------------------------------------------------------------- */
fi_wrp.c1925
HB_FUNCFI_CONVERTTO4BITS(void)
HB_FUNC( FI_CONVERTTO4BITS )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_ConvertTo4Bits(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2001
HB_FUNCFI_CONVERTTO8BITS(void)
HB_FUNC( FI_CONVERTTO8BITS )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_ConvertTo8Bits(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2031
HB_FUNCFI_CONVERTTOGREYSCALE(void)
HB_FUNC( FI_CONVERTTOGREYSCALE )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_ConvertToGreyscale(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2061
HB_FUNCFI_CONVERTTO16BITS555(void)
HB_FUNC( FI_CONVERTTO16BITS555 )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_ConvertTo16Bits555(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2091
HB_FUNCFI_CONVERTTO16BITS565(void)
HB_FUNC( FI_CONVERTTO16BITS565 )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_ConvertTo16Bits565(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2121
HB_FUNCFI_CONVERTTO24BITS(void)
HB_FUNC( FI_CONVERTTO24BITS )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_ConvertTo24Bits(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2151
HB_FUNCFI_CONVERTTO32BITS(void)
HB_FUNC( FI_CONVERTTO32BITS )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_ConvertTo32Bits(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2181
HB_FUNCFI_COLORQUANTIZE(void)
HB_FUNC( FI_COLORQUANTIZE )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      FREE_IMAGE_QUANTIZE quantize;

      /* Retrieve parameters */
      dib      = ( FIBITMAP * ) hb_parptr( 1 );
      quantize = ( FREE_IMAGE_QUANTIZE ) hb_parni( 2 );

      /* run function & return value */
      hb_retptr( FreeImage_ColorQuantize(dib, quantize) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 )
         );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantizeEx(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize FI_DEFAULT(FIQ_WUQUANT), int PaletteSize FI_DEFAULT(256), int ReserveSize FI_DEFAULT(0), RGBQUAD *ReservePalette FI_DEFAULT(NULL)); */
fi_wrp.c2211
HB_FUNCFI_DITHER(void)
HB_FUNC( FI_DITHER )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      FREE_IMAGE_DITHER algorithm;

      /* Retrieve parameters */
      dib       = ( FIBITMAP * ) hb_parptr( 1 );
      algorithm = ( FREE_IMAGE_DITHER ) hb_parni( 2 );

      /* run function & return value */
      hb_retptr( FreeImage_Dither(dib, algorithm) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 )
         );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertFromRawBits(BYTE *bits, int width, int height, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE)); */
fi_wrp.c2249
HB_FUNCFI_CONVERTTORGBF(void)
HB_FUNC( FI_CONVERTTORGBF )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retptr( FreeImage_ConvertToRGBF(dib) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2287
HB_FUNCFI_CONVERTTOSTANDARDTYPE(void)
HB_FUNC( FI_CONVERTTOSTANDARDTYPE )
{
   if ( hb_pcount() >= 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;
      BOOL scale_linear;

      /* Retrieve parameters */
      dib          = ( FIBITMAP * ) hb_parptr( 1 );
      scale_linear = ( hb_parinfo( 2 ) & HB_IT_LOGICAL ) ? hb_parl( 2 ) : TRUE;

      /* run function & return value */
      hb_retptr( FreeImage_ConvertToStandardType(dib, scale_linear) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}
fi_wrp.c2317
HB_FUNCFI_CONVERTTOTYPE(void)
HB_FUNC( FI_CONVERTTOTYPE )
{
   if ( hb_pcount() >= 2 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      FREE_IMAGE_TYPE dst_type;
      BOOL scale_linear;

      /* Retrieve parameters */
      dib          = ( FIBITMAP * ) hb_parptr( 1 );
      dst_type     = ( FREE_IMAGE_TYPE ) hb_parni( 2 );
      scale_linear = ( hb_parinfo( 3 ) & HB_IT_LOGICAL ) ? hb_parl( 3 ) : TRUE;

      /* run function & return value */
      hb_retptr( FreeImage_ConvertToType(dib, dst_type, scale_linear) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 )
         );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* tone mapping operators */
/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ToneMapping(FIBITMAP *dib, FREE_IMAGE_TMO tmo, double first_param FI_DEFAULT(0), double second_param FI_DEFAULT(0)); */
/* DLL_API FIBITMAP* DLL_CALLCONV FreeImage_TmoDrago03(FIBITMAP *src, double gamma FI_DEFAULT(2.2), double exposure FI_DEFAULT(0)); */
/* DLL_API FIBITMAP* DLL_CALLCONV FreeImage_TmoReinhard05(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0)); */

/* -------------------------------------------------------------------------- */
/* ZLib interface ----------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

/* DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size); */
/* DLL_API DWORD DLL_CALLCONV FreeImage_ZLibUncompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size); */
/* DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size); */
/* DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGUnzip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size); */
/* DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCRC32(DWORD crc, BYTE *source, DWORD source_size); */

/* -------------------------------------------------------------------------- */
/* Metadata routines -------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

/* tag creation / destruction */
/* DLL_API FITAG *DLL_CALLCONV FreeImage_CreateTag(); */
/* DLL_API void DLL_CALLCONV FreeImage_DeleteTag(FITAG *tag); */
/* DLL_API FITAG *DLL_CALLCONV FreeImage_CloneTag(FITAG *tag); */

/* tag getters and setters */
/* DLL_API const char *DLL_CALLCONV FreeImage_GetTagKey(FITAG *tag); */
/* DLL_API const char *DLL_CALLCONV FreeImage_GetTagDescription(FITAG *tag); */
/* DLL_API WORD DLL_CALLCONV FreeImage_GetTagID(FITAG *tag); */
/* DLL_API FREE_IMAGE_MDTYPE DLL_CALLCONV FreeImage_GetTagType(FITAG *tag); */
/* DLL_API DWORD DLL_CALLCONV FreeImage_GetTagCount(FITAG *tag); */
/* DLL_API DWORD DLL_CALLCONV FreeImage_GetTagLength(FITAG *tag); */
/* DLL_API const void *DLL_CALLCONV FreeImage_GetTagValue(FITAG *tag); */

/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagKey(FITAG *tag, const char *key); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagDescription(FITAG *tag, const char *description); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length) */;
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagValue(FITAG *tag, const void *value); */

/* iterator */
/* DLL_API FIMETADATA *DLL_CALLCONV FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_FindNextMetadata(FIMETADATA *mdhandle, FITAG **tag); */
/* DLL_API void DLL_CALLCONV FreeImage_FindCloseMetadata(FIMETADATA *mdhandle); */

/* metadata setter and getter */
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag); */

/* helpers */
/* DLL_API unsigned DLL_CALLCONV FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL model, FIBITMAP *dib); */

/* tag to C string conversion */
/* DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, FITAG *tag, char *Make FI_DEFAULT(NULL)); */

/* -------------------------------------------------------------------------- */
/* Image manipulation toolkit ----------------------------------------------- */
/* -------------------------------------------------------------------------- */

fi_wrp.c2349
HB_FUNCFI_ROTATECLASSIC(void)
HB_FUNC( FI_ROTATECLASSIC )
{
   if ( hb_pcount() == 2 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      double angle;

      /* Retrieve parameters */
      dib   = ( FIBITMAP * ) hb_parptr( 1 );
      angle = hb_parnd( 2 );

      /* run function & return value */
      hb_retptr( FreeImage_RotateClassic(dib, angle) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 ) );
         return;
      }
   }
}
fi_wrp.c2448
HB_FUNCFI_ROTATEEX(void)
HB_FUNC( FI_ROTATEEX )
{
   if ( hb_pcount() == 7 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC &&
        hb_parinfo( 3 ) & HB_IT_NUMERIC &&
        hb_parinfo( 4 ) & HB_IT_NUMERIC &&
        hb_parinfo( 5 ) & HB_IT_NUMERIC &&
        hb_parinfo( 6 ) & HB_IT_NUMERIC &&
        hb_parinfo( 7 ) & HB_IT_LOGICAL
      )
   {
      FIBITMAP *dib;
      double angle, x_shift, y_shift, x_origin, y_origin;
      BOOL use_mask;

      /* Retrieve parameters */
      dib      = ( FIBITMAP * ) hb_parptr( 1 );
      angle    = hb_parnd( 2 );
      x_shift  = hb_parnd( 3 );
      y_shift  = hb_parnd( 4 );
      x_origin = hb_parnd( 5 );
      y_origin = hb_parnd( 6 );
      use_mask = hb_parl( 7 );

      /* run function & return value */
      hb_retptr( FreeImage_RotateEx(dib, angle, x_shift, y_shift, x_origin, y_origin, use_mask) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 7,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
            hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 )
         );
         return;
      }
   }
}
fi_wrp.c2480
HB_FUNCFI_FLIPHORIZONTAL(void)
HB_FUNC( FI_FLIPHORIZONTAL )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retl( FreeImage_FlipHorizontal(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}
fi_wrp.c2525
HB_FUNCFI_FLIPVERTICAL(void)
HB_FUNC( FI_FLIPVERTICAL )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retl( FreeImage_FlipVertical(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 ) );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE)); */

/* -------------------------------------------------------------------------- */

fi_wrp.c2555
HB_FUNCFI_RESCALE(void)
HB_FUNC( FI_RESCALE )
{
   if ( hb_pcount() == 4 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC &&
        hb_parinfo( 3 ) & HB_IT_NUMERIC &&
        hb_parinfo( 4 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      int dst_width, dst_height;
      FREE_IMAGE_FILTER filter;

      /* Retrieve parameters */
      dib        = ( FIBITMAP * ) hb_parptr( 1 );
      dst_width  = hb_parni( 2 );
      dst_height = hb_parni( 3 );
      filter     = ( FREE_IMAGE_FILTER ) hb_parni( 4 );

      /* run function & return value */
      hb_retptr( FreeImage_Rescale(dib, dst_width, dst_height, filter) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 4,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 )
         );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* color manipulation routines (point operations) */

/* -------------------------------------------------------------------------- */

fi_wrp.c2593
HB_FUNCFI_ADJUSTGAMMA(void)
HB_FUNC( FI_ADJUSTGAMMA )
{
   if ( hb_pcount() == 2 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      double gamma;

      /* Retrieve parameters */
      dib   = ( FIBITMAP * ) hb_parptr( 1 );
      gamma = hb_parnd( 2 );

      /* run function & return value */
      hb_retl( FreeImage_AdjustGamma(dib, gamma) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 )
         );
         return;
      }
   }
}
fi_wrp.c2639
HB_FUNCFI_ADJUSTBRIGHTNESS(void)
HB_FUNC( FI_ADJUSTBRIGHTNESS )
{
   if ( hb_pcount() == 2 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      double percentage;

      /* Retrieve parameters */
      dib        = ( FIBITMAP * ) hb_parptr( 1 );
      percentage = hb_parnd( 2 );

      /* run function & return value */
      hb_retl( FreeImage_AdjustBrightness(dib, percentage) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 )
         );
         return;
      }
   }
}
fi_wrp.c2673
HB_FUNCFI_ADJUSTCONTRAST(void)
HB_FUNC( FI_ADJUSTCONTRAST )
{
   if ( hb_pcount() == 2 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      double percentage;

      /* Retrieve parameters */
      dib        = ( FIBITMAP * ) hb_parptr( 1 );
      percentage = hb_parnd( 2 );

      /* run function & return value */
      hb_retl( FreeImage_AdjustContrast(dib, percentage) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 )
         );
         return;
      }
   }
}
fi_wrp.c2707
HB_FUNCFI_INVERT(void)
HB_FUNC( FI_INVERT )
{
   if ( hb_pcount() == 1 &&
        hb_parinfo( 1 ) & HB_IT_POINTER
      )
   {
      FIBITMAP *dib;

      /* Retrieve parameters */
      dib = ( FIBITMAP * ) hb_parptr( 1 );

      /* run function & return value */
      hb_retl( FreeImage_Invert(dib) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 1,
            hb_paramError( 1 )
         );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK)); */

/* -------------------------------------------------------------------------- */

fi_wrp.c2741
HB_FUNCFI_GETCHANNEL(void)
HB_FUNC( FI_GETCHANNEL )
{
   if ( hb_pcount() == 2 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      FREE_IMAGE_COLOR_CHANNEL channel;

      /* Retrieve parameters */
      dib     = ( FIBITMAP * ) hb_parptr( 1 );
      channel = ( FREE_IMAGE_COLOR_CHANNEL ) hb_parni( 2 );

      /* run function & return value */
      hb_retptr( FreeImage_GetChannel(dib, channel) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 2,
            hb_paramError( 1 ), hb_paramError( 2 )
         );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

/* DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dib, FIBITMAP *dib8, FREE_IMAGE_COLOR_CHANNEL channel); */
/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel); */
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel); */

/* -------------------------------------------------------------------------- */
fi_wrp.c2780
HB_FUNCFI_COPY(void)
HB_FUNC( FI_COPY )
{
   if ( hb_pcount() == 5 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_NUMERIC &&
        hb_parinfo( 3 ) & HB_IT_NUMERIC &&
        hb_parinfo( 4 ) & HB_IT_NUMERIC &&
        hb_parinfo( 5 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dib;
      int left, top, right, bottom;

      /* Retrieve parameters */
      dib    = ( FIBITMAP * ) hb_parptr( 1 );
      left   = hb_parni( 2 );
      top    = hb_parni( 3 );
      right  = hb_parni( 4 );
      bottom = hb_parni( 5 );

      /* run function & return value */
      hb_retptr( FreeImage_Copy(dib, left, top, right, bottom) );
   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 5,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
            hb_paramError( 5 )
         );
         return;
      }
   }
}
fi_wrp.c2821
HB_FUNCFI_PASTE(void)
HB_FUNC( FI_PASTE )
{
   if ( hb_pcount() == 5 &&
        hb_parinfo( 1 ) & HB_IT_POINTER &&
        hb_parinfo( 2 ) & HB_IT_POINTER &&
        hb_parinfo( 3 ) & HB_IT_NUMERIC &&
        hb_parinfo( 4 ) & HB_IT_NUMERIC &&
        hb_parinfo( 5 ) & HB_IT_NUMERIC
      )
   {
      FIBITMAP *dst;
      FIBITMAP *src;
      int left, top, alpha;

      /* Retrieve parameters */
      dst   = ( FIBITMAP * ) hb_parptr( 1 );
      src   = ( FIBITMAP * ) hb_parptr( 2 );
      left  = hb_parni( 3 );
      top   = hb_parni( 4 );
      alpha = hb_parni( 5 );

      /* run function & return value */
      hb_retl( FreeImage_Paste(dst, src, left, top, alpha) );

   }
   else
   {
      /* Parameter error */
      {
         hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
            HB_ERR_FUNCNAME, 5,
            hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
            hb_paramError( 5 )
         );
         return;
      }
   }
}

/* -------------------------------------------------------------------------- */

fi_wrp.c2861

Page url: http://www.yourdomain.com/help/index.html?hbfimage.htm