WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
TiffUtils.h
Go to the documentation of this file.
1 
6 #ifndef TIFFUTILS_H
7 #define TIFFUTILS_H
8 
9 #define WIN32_LEAN_AND_MEAN
10 //#include <string>
11 #include <vector>
12 #include <fstream>
13 #include <mutex>
14 #if _USEFREEIMAGE
15 #include <FreeImagePlus.h>
16 #endif
17 
18 using namespace std;
19 
20 class fipMultiPage;
21 class fipImage;
22 struct FIMULTIBITMAP;
23 
24 using namespace std;
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 struct TiffUtils
30 {
32  static bool WriteTiffShort (const char* fileName, int width, int height, int stride,
33  const unsigned short int * data, const char* tags = nullptr);
34 
36  static bool WriteTiffChar (const char* fileName, int width, int height, int stride, int bpp,
37  const unsigned char * data, const char* tags = nullptr);
38 
40  static bool OpenWriteBufferToMPTifFile (const char* qualifiedFilename,
41  bool create, const unsigned short int* buffer,
42  int width, int height, unsigned int bitsPerPixel,
43  int location, const char* tags = nullptr);
44 
45  static bool WriteBufferToMPTifFile (const unsigned short int* buffer, int width,
46  int height, unsigned int bitsPerPixel,
47  int location, const char* tags = nullptr);
48 
49  static int GetNumPagesInMPTifFile (const char* qualifiedFilename);
50 
51  static bool GetPageSizeInMPTifFile (const char* qualifiedFilename, int pageNum,
52  unsigned int* width, unsigned int* height,
53  unsigned int* bpp);
54 
55  static bool OpenReadPageInMPTifFile (const char* qualifiedFilename, int pageNum,
56  unsigned short int* data, char* tags = nullptr);
57  static bool ReadPageInMPTifFile (int pageNum, unsigned short int* data,
58  char* tags = nullptr);
59  static bool OpenReadCharPageInMPTifFile (const char* qualifiedFilename, int pageNum,
60  unsigned char* data, char* tags = nullptr);
61  static bool ReadCharPageInMPTifFile (int pageNum, unsigned char* data,
62  char* tags = nullptr);
63  static bool CloseMPTifFile();
64 
65  static void AddTagsToImage (fipImage& image, const char* tags);
66 
67  // Members
68  static fipMultiPage _multiPage;
69 
70 };
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif
Definition: TiffUtils.h:30