Changeset View
Changeset View
Standalone View
Standalone View
kstars/fitsviewer/stretch.h
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 42 | public: | |||
---|---|---|---|---|---|
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(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. | ||||
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. | ||||
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 | ||||
82 | * sample both in width and height, so the output would have about 4X fewer pixels. | ||||
77 | */ | 83 | */ | ||
78 | void run(uint8_t *input, QImage *output_image); | 84 | void run(uint8_t *input, QImage *output_image, int sampling=1); | ||
79 | 85 | | |||
80 | private: | 86 | private: | ||
87 | // Adjusts input_range for float and double types. | ||||
88 | void recalculateInputRange(uint8_t *input); | ||||
89 | | ||||
81 | // Inputs. | 90 | // Inputs. | ||
82 | int image_width; | 91 | int image_width; | ||
83 | int image_height; | 92 | int image_height; | ||
84 | int image_channels; | 93 | int image_channels; | ||
85 | int input_range; | 94 | int input_range; | ||
86 | int dataType; | 95 | int dataType; | ||
87 | 96 | | |||
88 | // Parameters. | 97 | // Parameters. | ||
89 | StretchParams params; | 98 | StretchParams params; | ||
90 | }; | 99 | }; |