mask.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* mask.h
  2. *
  3. * 20/9/09
  4. * - from proto.h
  5. */
  6. /* All deprecated.
  7. */
  8. /*
  9. This file is part of VIPS.
  10. VIPS is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU Lesser General Public License as published by
  12. the Free Software Foundation; either version 2 of the License, or
  13. (at your option) any later version.
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. GNU Lesser General Public License for more details.
  18. You should have received a copy of the GNU Lesser General Public License
  19. along with this program; if not, write to the Free Software
  20. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  21. 02110-1301 USA
  22. */
  23. /*
  24. These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
  25. */
  26. #ifndef IM_MASK_H
  27. #define IM_MASK_H
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif /*__cplusplus*/
  31. typedef struct im__INTMASK {
  32. int xsize;
  33. int ysize;
  34. int scale;
  35. int offset;
  36. int *coeff;
  37. char *filename;
  38. } INTMASK;
  39. typedef struct im__DOUBLEMASK {
  40. int xsize;
  41. int ysize;
  42. double scale;
  43. double offset;
  44. double *coeff;
  45. char *filename;
  46. } DOUBLEMASK;
  47. #define IM_MASK( M, X, Y ) ((M)->coeff[(X) + (Y) * (M)->xsize])
  48. INTMASK *im_create_imask( const char *filename, int xsize, int ysize );
  49. INTMASK *im_create_imaskv( const char *filename, int xsize, int ysize, ... );
  50. DOUBLEMASK *im_create_dmask( const char *filename, int xsize, int ysize );
  51. DOUBLEMASK *im_create_dmaskv( const char *filename, int xsize, int ysize, ... );
  52. INTMASK *im_read_imask( const char *filename );
  53. DOUBLEMASK *im_read_dmask( const char *filename );
  54. void im_print_imask( INTMASK *in );
  55. void im_print_dmask( DOUBLEMASK *in );
  56. int im_write_imask( INTMASK *in );
  57. int im_write_dmask( DOUBLEMASK *in );
  58. int im_write_imask_name( INTMASK *in, const char *filename );
  59. int im_write_dmask_name( DOUBLEMASK *in, const char *filename );
  60. int im_free_imask( INTMASK *in );
  61. int im_free_dmask( DOUBLEMASK *in );
  62. INTMASK *im_log_imask( const char *filename, double sigma, double min_ampl );
  63. DOUBLEMASK *im_log_dmask( const char *filename, double sigma, double min_ampl );
  64. INTMASK *im_gauss_imask( const char *filename, double sigma, double min_ampl );
  65. INTMASK *im_gauss_imask_sep( const char *filename,
  66. double sigma, double min_ampl );
  67. DOUBLEMASK *im_gauss_dmask( const char *filename,
  68. double sigma, double min_ampl );
  69. DOUBLEMASK *im_gauss_dmask_sep( const char *filename,
  70. double sigma, double min_ampl );
  71. INTMASK *im_dup_imask( INTMASK *in, const char *filename );
  72. DOUBLEMASK *im_dup_dmask( DOUBLEMASK *in, const char *filename );
  73. INTMASK *im_scale_dmask( DOUBLEMASK *in, const char *filename );
  74. void im_norm_dmask( DOUBLEMASK *mask );
  75. DOUBLEMASK *im_imask2dmask( INTMASK *in, const char *filename );
  76. INTMASK *im_dmask2imask( DOUBLEMASK *in, const char *filename );
  77. INTMASK *im_rotate_imask90( INTMASK *in, const char *filename );
  78. INTMASK *im_rotate_imask45( INTMASK *in, const char *filename );
  79. DOUBLEMASK *im_rotate_dmask90( DOUBLEMASK *in, const char *filename );
  80. DOUBLEMASK *im_rotate_dmask45( DOUBLEMASK *in, const char *filename );
  81. DOUBLEMASK *im_mattrn( DOUBLEMASK *in, const char *filename );
  82. DOUBLEMASK *im_matcat( DOUBLEMASK *top, DOUBLEMASK *bottom,
  83. const char *filename );
  84. DOUBLEMASK *im_matmul( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *filename );
  85. DOUBLEMASK *im_lu_decomp( const DOUBLEMASK *mat, const char *filename );
  86. int im_lu_solve( const DOUBLEMASK *lu, double *vec );
  87. DOUBLEMASK *im_matinv( const DOUBLEMASK *mat, const char *filename );
  88. int im_matinv_inplace( DOUBLEMASK *mat );
  89. DOUBLEMASK *im_local_dmask( struct _VipsImage *out, DOUBLEMASK *mask );
  90. INTMASK *im_local_imask( struct _VipsImage *out, INTMASK *mask );
  91. #ifdef __cplusplus
  92. }
  93. #endif /*__cplusplus*/
  94. #endif /*IM_MASK_H*/