aboutsummaryrefslogtreecommitdiffstats
path: root/color_pipe.h
diff options
context:
space:
mode:
authorPatrick Roth <roth@stettbacher.ch>2021-07-07 10:09:44 +0200
committerPatrick Roth <roth@stettbacher.ch>2021-07-07 10:09:44 +0200
commit2eaa3853c0ebc1ef2a93d534c59801c0b8c476b4 (patch)
tree747495c4eea8ae8845f541b5a144a9193e678f9a /color_pipe.h
parentversion 1.1.0 added (diff)
downloado3000-color-pipe-2eaa3853c0ebc1ef2a93d534c59801c0b8c476b4.tar.gz
o3000-color-pipe-2eaa3853c0ebc1ef2a93d534c59801c0b8c476b4.zip
stage perspective transformation added
Diffstat (limited to 'color_pipe.h')
-rw-r--r--color_pipe.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/color_pipe.h b/color_pipe.h
index 9b52f23..26b229b 100644
--- a/color_pipe.h
+++ b/color_pipe.h
@@ -318,6 +318,40 @@ struct trapcorr_data_t {
/**
+ * Projective transformation definition
+ */
+struct projection_data_t {
+ int enable; ///< flag to enable projective transformation
+ void *img_out; ///< projected image. This buffer must be allocated externly.
+ void *img_in; ///< Input image.
+ int is_color; ///< Not 0 if it's a color image
+ int bit_channel; ///< Bits per color channel.
+ int width; ///< image width in number of pixels
+ int height; ///< image height in number of pixels
+ float c_inv[3][3]; ///< inverse of 3x3 projection matrix C
+ float c_inv_new[3][3]; ///< double buffered matrix
+ int c_upd; ///< projection matrix update flag
+
+ int map_init; ///< flag indicating transformation map is initialized
+
+ /**
+ * projective transfomration map
+ * A coordinate pair defines the transformed pixel location. It may be shifted (see @ref map_scale_fact).
+ *
+ * This buffer must be allocated externly.
+ */
+ struct coord_t *map;
+
+ /**
+ * Bit shift applied on correction map @ref map.
+ * The pixel location may lay between a pixel pair. Therefore the coordinates defined at the map
+ * @ref map are (scaled) shifted by this factor.
+ */
+ int map_scale_fact;
+};
+
+
+/**
* Color pipe definition structure holding all memory data from different pipeline
* stages. This structure and image buffers are allocated dynamically.
*/
@@ -336,6 +370,7 @@ struct color_pipe_t {
struct sharp_data_t sharp_data; ///< image sharpening data
struct gamma_data_t gamma_data; ///< gamma correction data
struct trapcorr_data_t trapcorr_data; ///< isosceles trapezoid correction data
+ struct projection_data_t proj_data; ///< projective transformation data
};
@@ -356,6 +391,7 @@ void __stdcall color_pipe_stageconf_color_calib(struct color_pipe_t *color_pipe,
void __stdcall color_pipe_stageconf_sharp(struct color_pipe_t *color_pipe, int enable, float factor, enum sharp_alg_t alg, float sens);
void __stdcall color_pipe_stageconf_gamma(struct color_pipe_t *color_pipe, int enable, float gamma);
void __stdcall color_pipe_stageconf_trapcorr(struct color_pipe_t *color_pipe, int enable, float wv, float wh);
+void __stdcall color_pipe_stageconf_projection(struct color_pipe_t *color_pipe, int enable, float c_inv[3][3]);
#if defined(__cplusplus) || defined(c_plusplus)
} // extern "C"