#define WSQ_EXPORT __declspec( dllexport )


#if defined(__cplusplus)
extern "C" {
#endif

extern
int WSQ_EXPORT RegisterWSQ();


extern
char* WSQ_EXPORT GenerateSerialNumber();

extern
char* WSQ_EXPORT GenerateWSQLibrarySerialNumber();

extern
int WSQ_EXPORT UnlockWSQLibrary(char* authorizationcode);


// Saves HBITMAP to an image file. Returns 1 if successfull, 0 otherwise 
extern
int WSQ_EXPORT SaveBMPToFile(HBITMAP hBitmap, const char *filename, int filetype);


// Creates an HBITMAP from an image file.
// The extension of the file name determines the file type.  
// Returns an HBITMAP if successfull, NULL otherwise 
extern
HBITMAP WSQ_EXPORT CreateBMPFromFile(const char *filename);


// Creates an HBITMAP from WSQ compressed byte array.
// Returns an HBITMAP if successfull, NULL otherwise 
extern
HBITMAP WSQ_EXPORT CreateBMPFromWSQByteArray(unsigned char *input_wsq_byte_array, int size_of_input_wsq_byte_array);


// Saves WSQ compressed byte array to an image file.
// Returns 1 if successfull, 0 otherwise 
extern
int WSQ_EXPORT SaveWSQByteArrayToImageFile(unsigned char *input_wsq_byte_array, int size_of_input_wsq_byte_array, const char *filename, int filetype);


extern
int WSQ_EXPORT WSQ_decode_stream(unsigned char *input_data_stream, const int input_stream_length, unsigned char **output_data_stream, int *width, int *height, int *ppi, unsigned char **comment_text);


extern
int WSQ_EXPORT WSQ_encode_stream(unsigned char *input_data_stream, const int width, const int height, const double bitrate,
				   const int ppi, char *comment_text, unsigned char **output_data_stream, int *output_stream_length);

extern
void WSQ_EXPORT WriteWSQ_bitrate(double bitrate);


extern
double WSQ_EXPORT ReadWSQ_bitrate();


extern
void WSQ_EXPORT WriteWSQ_ppi(int ppi);


extern
int WSQ_EXPORT ReadWSQ_ppi();


extern
void WSQ_EXPORT WriteWSQ_comment(char *comment);


extern
char* WSQ_EXPORT ReadWSQ_comment();


extern
int WSQ_EXPORT ReadWSQ_implementation_number();


extern
int WSQ_EXPORT ReadTIFFcompression();


extern
void WSQ_EXPORT WriteTIFFcompression(int tiff_compression);


extern
int WSQ_EXPORT ReadTIFFpredictor();


extern
void WSQ_EXPORT WriteTIFFpredictor(int tiff_predictor);


extern
void WSQ_EXPORT ShowFileConverter();


extern
void WSQ_EXPORT SetShowFilePropertiesDialog(int file_properties_dialog);


extern
HBITMAP WSQ_EXPORT ConvertHBITMAPtoGrayScale256(HBITMAP hBitmap);


extern
int WSQ_EXPORT SaveHBITMAPtoFileAsGrayScale256BMP(HBITMAP hBitmap, const char *filename);


extern
HBITMAP WSQ_EXPORT CreateHBITMAPfromNISTType8BinaryField(int type8_width, int type8_height, int type8_compression_type, unsigned char* type8_input_byte_array, int type8_input_byte_array_size);

extern
HBITMAP WSQ_EXPORT CreateHBITMAPfromNISTType8UncompressedBinaryField(int type8_width, int type8_height, unsigned char* type8_input_byte_array, int type8_input_byte_array_size);

extern
HBITMAP WSQ_EXPORT CreateHBITMAPfromNISTType8CompressedBinaryField(int type8_width, int type8_height, unsigned char* type8_input_byte_array, int type8_input_byte_array_size);

extern
unsigned char* WSQ_EXPORT CreateNISTType8BinaryFieldfromHBITMAP(HBITMAP input_HBITMAP, int type8_compression_type);

extern
unsigned char* WSQ_EXPORT CreateNISTType8UncompressedBinaryFieldfromHBITMAP(HBITMAP input_HBITMAP);

extern
unsigned char* WSQ_EXPORT CreateNISTType8CompressedBinaryFieldfromHBITMAP(HBITMAP input_HBITMAP);


extern
unsigned char* WSQ_EXPORT CreateImageFromNISTType8UncompressedBinaryField(unsigned char* type8_input_byte_array, int type8_input_byte_array_size, int type8_width, int type8_height);   
   
extern
unsigned char* WSQ_EXPORT CreateImageFromNISTType8CompressedBinaryField(unsigned char* type8_input_byte_array, int type8_input_byte_array_size, int type8_width, int type8_height);
   
extern
int WSQ_EXPORT CreateNISTType8UncompressedBinaryFieldfromImage(unsigned char* input_image, int type8_width, int type8_height, unsigned char **output_type8_bytes, int *output_type8_bytes_length);
  
extern
int WSQ_EXPORT CreateNISTType8CompressedBinaryFieldfromImage(unsigned char* input_image, int type8_width, int type8_height, unsigned char **output_type8_bytes, int *output_type8_bytes_length);   
      
extern
int WSQ_EXPORT ReadType8DataCompressionType();
   
extern
int WSQ_EXPORT ReadType8DataWidth();
   
extern
int WSQ_EXPORT ReadType8DataHeight();
   
extern
void WSQ_EXPORT WriteType8CompressionWidthHeight(int type8_width, int type8_height, int type8_compression_type);
   
extern
int WSQ_EXPORT ReadSizeOfNISTType8BinaryField();

extern
void WSQ_EXPORT SetNISTType8ImageColorInversion(int in_uncompressed_type8_image_inverted, int out_uncompressed_type8_image_inverted, int in_compressed_type8_image_inverted, int out_compressed_type8_image_inverted);



#if defined(__cplusplus)
 }
#endif
