From e20d5ae3622d5d656dc28d7a090aee76b08158b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Mart=C3=ADn?= Date: Sun, 7 Sep 2003 20:01:24 +0000 Subject: updating pdp to current version 0.12.2 svn path=/trunk/externals/pdp/; revision=936 --- include/pdp_imageproc.h | 102 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 32 deletions(-) (limited to 'include/pdp_imageproc.h') diff --git a/include/pdp_imageproc.h b/include/pdp_imageproc.h index 26bcdc6..a1b9de3 100644 --- a/include/pdp_imageproc.h +++ b/include/pdp_imageproc.h @@ -26,12 +26,23 @@ #ifndef PDP_IMAGEPROC_H #define PDP_IMAGEPROC_H -/* + #ifdef __cplusplus extern "C" { #endif -*/ + + + +/* the packet types should be the same for the dispatchers. packet0 is the dominant packet */ + +/* image processing dispatchers */ +void pdp_imageproc_dispatch_1buf(void (*process_routine)(void*, u32, u32, s16*), void *x, u32 chanmask, int packet0); +void pdp_imageproc_dispatch_2buf(void (*process_routine)(void*, u32, u32, s16*, s16 *), void *x, u32 chanmask, int packet0, int packet1); +void pdp_imageproc_dispatch_3buf(void (*process_routine)(void*, u32, u32, s16*, s16 *, s16*), void *x, u32 chanmask, int packet0, int packet1, int packet2); + + + /* get legal image dimensions */ /* this is a fix for the dimension problem */ @@ -45,18 +56,13 @@ u32 pdp_imageproc_legalheight_round_down(int i); /****************************** 16 bit signed (pixel) routines ***************************************/ -#include "pdp_types.h" -//typedef unsigned long u32; -//typedef unsigned long long u64; -//typedef short s16; -//typedef long s32; // mix 2 images void *pdp_imageproc_mix_new(void); void pdp_imageproc_mix_delete(void *x); void pdp_imageproc_mix_setleftgain(void *x, float gain); void pdp_imageproc_mix_setrightgain(void *x, float gain); -void pdp_imageproc_mix_process(void *x, s16 *image, s16 *image2, u32 width, u32 height); +void pdp_imageproc_mix_process(void *x, u32 width, u32 height, s16 *image, s16 *image2); // random mix 2 images // note: random number generator can be platform specific @@ -68,7 +74,7 @@ void *pdp_imageproc_randmix_new(void); void pdp_imageproc_randmix_delete(void *x); void pdp_imageproc_randmix_setthreshold(void *x, float threshold); void pdp_imageproc_randmix_setseed(void *x, float seed); -void pdp_imageproc_randmix_process(void *x, s16 *image, s16 *image2, u32 width, u32 height); +void pdp_imageproc_randmix_process(void *x, u32 width, u32 height, s16 *image, s16 *image2); // produce a random image @@ -77,30 +83,33 @@ void pdp_imageproc_randmix_process(void *x, s16 *image, s16 *image2, u32 width, void *pdp_imageproc_random_new(void); void pdp_imageproc_random_delete(void *x); void pdp_imageproc_random_setseed(void *x, float seed); -void pdp_imageproc_random_process(void *x, s16 *image, u32 width, u32 height); +void pdp_imageproc_random_process(void *x, u32 width, u32 height, s16 *image); + + +// produce a plasma image +// note: random number generator can be platform specific +// however, it should be seeded. (same seed produces the same result) +void *pdp_imageproc_plasma_new(void); +void pdp_imageproc_plasma_delete(void *x); +void pdp_imageproc_plasma_setseed(void *x, float seed); +void pdp_imageproc_plasma_setturbulence(void *x, float seed); +void pdp_imageproc_plasma_process(void *x, u32 width, u32 height, s16 *image); // apply a gain to an image void *pdp_imageproc_gain_new(void); void pdp_imageproc_gain_delete(void *x); void pdp_imageproc_gain_setgain(void *x, float gain); -void pdp_imageproc_gain_process(void *x, s16 *image, u32 width, u32 height); +void pdp_imageproc_gain_process(void *x, u32 width, u32 height, s16 *image); // add two images -void pdp_imageproc_add_process(s16 *image, s16 *image2, u32 width, u32 height); +void pdp_imageproc_add_process(void *x, u32 width, u32 height, s16 *image, s16 *image2); // mul two images -void pdp_imageproc_mul_process(s16 *image, s16 *image2, u32 width, u32 height); - +void pdp_imageproc_mul_process(void *x, u32 width, u32 height, s16 *image, s16 *image2); -// affine transformation (applies gain + adds offset) -void *pdp_imageproc_affine_new(void); -void pdp_imageproc_affine_delete(void *x); -void pdp_imageproc_affine_setgain(void *x, float gain); -void pdp_imageproc_affine_setoffset(void *x, float offset); -void pdp_imageproc_affine_process(void *x, s16 *image, u32 width, u32 height); // 3x1 or 1x3 in place convolution // orientation @@ -112,17 +121,19 @@ void pdp_imageproc_conv_setmin1(void *x, float val); void pdp_imageproc_conv_setzero(void *x, float val); void pdp_imageproc_conv_setplus1(void *x, float val); void pdp_imageproc_conv_setbordercolor(void *x, float intensity); -void pdp_imageproc_conv_process(void *x, s16 *image, u32 width, u32 height, u32 orientation, u32 nbpasses); +void pdp_imageproc_conv_setorientation(void *x, u32 val); +void pdp_imageproc_conv_setnbpasses(void *x, u32 val); +void pdp_imageproc_conv_process(void *x, u32 width, u32 height, s16 *image); -// colour rotation for 2 colour planes +// colour rotation for 2 colour planes ($$$TODO: change interface) // matrix is column encoded void *pdp_imageproc_crot2d_new(void); void pdp_imageproc_crot2d_delete(void *x); void pdp_imageproc_crot2d_setmatrix(void *x, float *matrix); void pdp_imageproc_crot2d_process(void *x, s16 *image, u32 width, u32 height); -// colour rotation for 3 colour planes +// colour rotation for 3 colour planes ($$$TODO: change interface) void *pdp_imageproc_crot3d_new(void); void pdp_imageproc_crot3d_delete(void *x); void pdp_imageproc_crot3d_setmatrix(void *x, float *matrix); @@ -141,14 +152,16 @@ void pdp_imageproc_crot3d_process(void *x, s16 *image, u32 width, u32 height); void *pdp_imageproc_bq_new(void); void pdp_imageproc_bq_delete(void *x); void pdp_imageproc_bq_setcoef(void *x, float *coef); // a0,a1,a2,b0,b1,b2 -void pdp_imageproc_bq_process(void *x, s16 *image, u32 width, u32 height, u32 direction, u32 nbpasses); +void pdp_imageproc_bq_setnbpasses(void *x, u32 nbpasses); +void pdp_imageproc_bq_setdirection(void *x, u32 direction); +void pdp_imageproc_bq_process(void *x, u32 width, u32 height, s16* image); // biquad time -void *pdp_imageproc_bqt_new(void); -void pdp_imageproc_bqt_delete(void *x); -void pdp_imageproc_bqt_setcoef(void *x, float *coef); // a0,a1,a2,b0,b1,b2 -void pdp_imageproc_bqt_process(void *x, s16 *image, s16 *state0, s16 *state1, u32 width, u32 height); +//void *pdp_imageproc_bqt_new(void); +//void pdp_imageproc_bqt_delete(void *x); +//void pdp_imageproc_bqt_setcoef(void *x, float *coef); // a0,a1,a2,b0,b1,b2 +void pdp_imageproc_bqt_process(void *x, u32 width, u32 height, s16 *image, s16 *state0, s16 *state1); @@ -160,7 +173,7 @@ void pdp_imageproc_resample_affinemap_setcentery(void *x, float f); void pdp_imageproc_resample_affinemap_setzoomx(void *x, float f); void pdp_imageproc_resample_affinemap_setzoomy(void *x, float f); void pdp_imageproc_resample_affinemap_setangle(void *x, float f); -void pdp_imageproc_resample_affinemap_process(void *x, s16 *srcimage, s16 *dstimage, u32 width, u32 height); +void pdp_imageproc_resample_affinemap_process(void *x, u32 width, u32 height, s16 *srcimage, s16 *dstimage); @@ -168,14 +181,39 @@ void pdp_imageproc_resample_affinemap_process(void *x, s16 *srcimage, s16 *dstim void *pdp_imageproc_cheby_new(int order); void pdp_imageproc_cheby_delete(void *x); void pdp_imageproc_cheby_setcoef(void *x, u32 n, float f); -void pdp_imageproc_cheby_process(void *x, s16 *image, u32 width, u32 height, u32 iterations); +void pdp_imageproc_cheby_setnbpasses(void *x, u32 n); +void pdp_imageproc_cheby_process(void *x, u32 width, u32 height, s16 *image); + + +//logic ops +void pdp_imageproc_xor_process(void *x, u32 width, u32 height, s16 *image, s16 *image2); +void pdp_imageproc_or_process(void *x, u32 width, u32 height, s16 *image, s16 *image2); +void pdp_imageproc_and_process(void *x, u32 width, u32 height, s16 *image, s16 *image2); +void pdp_imageproc_mask_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_not_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_hardthresh_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_softthresh_process(void *x, u32 width, u32 height, s16 *image); + + +//other stateles operators +void pdp_imageproc_abs_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_zthresh_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_plasma_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_ispositive_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_sign_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_flip_lr_process(void *dummy, u32 width, u32 height, s16 *image); +void pdp_imageproc_flip_tb_process(void *dummy, u32 width, u32 height, s16 *image); + +//set to zero +void pdp_imageproc_zero_process(void *x, u32 width, u32 height, s16 *image); +void pdp_imageproc_constant_process(void *x, u32 width, u32 height, s16 *image); + -/* #ifdef __cplusplus } #endif -*/ + #endif //PDP_IMAGEPROC_H -- cgit v1.2.1