Changeset View
Changeset View
Standalone View
Standalone View
kstars/fitsviewer/stretch.h
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 42 | public: | |||
---|---|---|---|---|---|
64 | /** | 64 | /** | ||
65 | * @brief getParams Returns the stretch parameters (computed by computeParameters()). | 65 | * @brief getParams Returns the stretch parameters (computed by computeParameters()). | ||
66 | */ | 66 | */ | ||
67 | StretchParams getParams() { return params; } | 67 | StretchParams getParams() { return params; } | ||
68 | 68 | | |||
69 | /** | 69 | /** | ||
70 | * @brief computeParams Automatically generates and sets stretch parameters from the image. | 70 | * @brief computeParams Automatically generates and sets stretch parameters from the image. | ||
71 | */ | 71 | */ | ||
72 | StretchParams computeParams(uint8_t *input); | 72 | StretchParams computeParams(const uint8_t *input); | ||
73 | 73 | | |||
74 | /** | 74 | /** | ||
75 | * @brief run run the stretch algorithm according to the params given | 75 | * @brief run run the stretch algorithm according to the params given | ||
76 | * placing the output in output_image. | 76 | * placing the output in output_image. | ||
77 | * @param input the raw data buffer. | 77 | * @param input the raw data buffer. | ||
78 | * @param output_image a QImage pointer that should be the same size as the input if | 78 | * @param output_image a QImage pointer that should be the same size as the input if | ||
79 | * sampling is 1 otherwise, the proper size if the input is downsampled by sampling. | 79 | * sampling is 1 otherwise, the proper size if the input is downsampled by sampling. | ||
80 | * @param sampling The sampling parameter. Applies to both width and height. | 80 | * @param sampling The sampling parameter. Applies to both width and height. | ||
81 | * Sampling is applied to the output (that is, with sampling=2, we compute every other output | 81 | * Sampling is applied to the output (that is, with sampling=2, we compute every other output | ||
82 | * sample both in width and height, so the output would have about 4X fewer pixels. | 82 | * sample both in width and height, so the output would have about 4X fewer pixels. | ||
83 | */ | 83 | */ | ||
84 | void run(uint8_t *input, QImage *output_image, int sampling=1); | 84 | void run(uint8_t const *input, QImage *output_image, int sampling=1); | ||
85 | 85 | | |||
86 | private: | 86 | private: | ||
87 | // Adjusts input_range for float and double types. | 87 | // Adjusts input_range for float and double types. | ||
88 | void recalculateInputRange(uint8_t *input); | 88 | void recalculateInputRange(const uint8_t *input); | ||
89 | 89 | | |||
90 | // Inputs. | 90 | // Inputs. | ||
91 | int image_width; | 91 | int image_width; | ||
92 | int image_height; | 92 | int image_height; | ||
93 | int image_channels; | 93 | int image_channels; | ||
94 | int input_range; | 94 | int input_range; | ||
95 | int dataType; | 95 | int dataType; | ||
96 | 96 | | |||
97 | // Parameters. | 97 | // Parameters. | ||
98 | StretchParams params; | 98 | StretchParams params; | ||
99 | }; | 99 | }; |