-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTiffImageGenerator.h
More file actions
68 lines (60 loc) · 2.26 KB
/
Copy pathTiffImageGenerator.h
File metadata and controls
68 lines (60 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef TIFFIMAGEGENERATOR_H
#define TIFFIMAGEGENERATOR_H
#include <QString>
#include <QImage>
#include <tiffio.h>
/**
* @brief Generates TIFF images matching Origin telescope format
*
* Specifications from real Origin telescope:
* - Image Width: 3056
* - Image Length: 2048
* - Bits/Sample: 16
* - Samples/Pixel: 3 (RGB)
* - Photometric Interpretation: RGB color
* - Compression: None
* - Planar Configuration: single image plane
*/
class TiffImageGenerator {
public:
// Origin telescope sensor dimensions
static const int IMAGE_WIDTH = 3056;
static const int IMAGE_HEIGHT = 2048;
static const int BITS_PER_SAMPLE = 16;
static const int SAMPLES_PER_PIXEL = 3; // RGB
/**
* @brief Generate a 16-bit RGB TIFF file matching Origin format
* @param outputPath Full path where TIFF file should be saved
* @param sourceImage Optional source image to convert (will be scaled)
* @return true if successful, false otherwise
*/
static bool generateOriginFormatTiff(const QString& outputPath,
const QImage& sourceImage = QImage());
/**
* @brief Create a synthetic star field for testing
* @param outputPath Full path where TIFF file should be saved
* @param numStars Number of stars to generate
* @return true if successful, false otherwise
*/
static bool generateSyntheticStarField(const QString& outputPath, int numStars = 100);
/**
* @brief Convert existing JPG/PNG to 16-bit RGB TIFF
* @param inputPath Path to source image
* @param outputPath Path for output TIFF
* @return true if successful, false otherwise
*/
static bool convertToOriginTiff(const QString& inputPath, const QString& outputPath);
private:
/**
* @brief Write 16-bit RGB TIFF using libtiff
*/
static bool writeTiff16BitRGB(const QString& outputPath,
const uint16_t* imageData,
int width, int height);
/**
* @brief Convert 8-bit RGB to 16-bit RGB (scale from 0-255 to 0-65535)
*/
static void convert8BitTo16Bit(const uint8_t* src8bit, uint16_t* dst16bit,
int width, int height);
};
#endif // TIFFIMAGEGENERATOR_H