Ignore:
Timestamp:
Jul 13, 2017, 11:01:58 AM (7 years ago)
Author:
meunier
Message:
  • Mise à jour NR2 et Rosenfeld
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/rosenfeld/nrc2/src/nrmem2.c

    r772 r826  
    2828/*
    2929 * ------------------
    30  * --- dub_matrix ---
     30 * --- dup_matrix ---
    3131 * ------------------
    3232 */
    33 /* -------------------------------------------------------------------------------------- */
    34 IMAGE_EXPORT(void) dup_si8matrix(sint8 **X, long nrl,long nrh,long ncl, long nch, sint8 **Y)
    35 /* -------------------------------------------------------------------------------------- */
    36 {
    37     int i;
    38     for(i=nrl; i<=nrh; i++) {
    39         dup_si8vector(X[i], ncl, nch, Y[i]);
    40     }
     33
     34
     35#undef dup_type_matrix
     36#define dup_type_matrix(t) \
     37void short_name(t,dup_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** Y) \
     38{                                                        \
     39    for (int32_t i = nrl; i <= nrh; i++) {               \
     40        short_name(t,dup_,vector)(X[i], ncl, nch, Y[i]); \
     41    }                                                    \
    4142}
    42 /* -------------------------------------------------------------------------------------- */
    43 IMAGE_EXPORT(void) dup_ui8matrix(uint8 **X, long nrl,long nrh,long ncl, long nch, uint8 **Y)
    44 /* -------------------------------------------------------------------------------------- */
    45 {
    46     int i;
    47     for(i=nrl; i<=nrh; i++) {
    48         dup_ui8vector(X[i], ncl, nch, Y[i]);
    49     }
    50 }
    51 /* ----------------------------------------------------------------------------------------- */
    52 IMAGE_EXPORT(void) dup_si16matrix(sint16 **X, long nrl,long nrh,long ncl, long nch, sint16 **Y)
    53 /* ----------------------------------------------------------------------------------------- */
    54 {
    55     int i;
    56     for(i=nrl; i<=nrh; i++) {
    57         dup_si16vector(X[i], ncl, nch, Y[i]);
    58     }
    59 }
    60 /* ----------------------------------------------------------------------------------------- */
    61 IMAGE_EXPORT(void) dup_ui16matrix(uint16 **X, long nrl,long nrh,long ncl, long nch, uint16 **Y)
    62 /* ----------------------------------------------------------------------------------------- */
    63 {
    64     int i;
    65     for(i=nrl; i<=nrh; i++) {
    66         dup_ui16vector(X[i], ncl, nch, Y[i]);
    67     }
    68 }
    69 /* ----------------------------------------------------------------------------------------- */
    70 IMAGE_EXPORT(void) dup_si32matrix(sint32 **X, long nrl,long nrh,long ncl, long nch, sint32 **Y)
    71 /* ----------------------------------------------------------------------------------------- */
    72 {
    73     int i;
    74     for(i=nrl; i<=nrh; i++) {
    75         dup_si32vector(X[i], ncl, nch, Y[i]);
    76     }
    77 }
    78 /* ----------------------------------------------------------------------------------------- */
    79 IMAGE_EXPORT(void) dup_ui32matrix(uint32 **X, long nrl,long nrh,long ncl, long nch, uint32 **Y)
    80 /* ----------------------------------------------------------------------------------------- */
    81 {
    82     int i;
    83     for(i=nrl; i<=nrh; i++) {
    84         dup_ui32vector(X[i], ncl, nch, Y[i]);
    85     }
    86 }
    87 /* ----------------------------------------------------------------------------------------- */
    88 IMAGE_EXPORT(void) dup_si64matrix(sint64 **X, long nrl,long nrh,long ncl, long nch, sint64 **Y)
    89 /* ----------------------------------------------------------------------------------------- */
    90 {
    91     int i;
    92     for(i=nrl; i<=nrh; i++) {
    93         dup_si64vector(X[i], ncl, nch, Y[i]);
    94     }
    95 }
    96 /* ----------------------------------------------------------------------------------------- */
    97 IMAGE_EXPORT(void) dup_ui64matrix(uint64 **X, long nrl,long nrh,long ncl, long nch, uint64 **Y)
    98 /* ----------------------------------------------------------------------------------------- */
    99 {
    100     int i;
    101     for(i=nrl; i<=nrh; i++) {
    102         dup_ui64vector(X[i], ncl, nch, Y[i]);
    103     }
    104 }
    105 /* ------------------------------------------------------------------------------------------ */
    106 IMAGE_EXPORT(void) dup_f32matrix(float32 **X, long nrl,long nrh,long ncl, long nch, float32 **Y)
    107 /* ------------------------------------------------------------------------------------------ */
    108 {
    109     int i;
    110     for(i=nrl; i<=nrh; i++) {
    111         dup_f32vector(X[i], ncl, nch, Y[i]);
    112     }
    113 }
    114 /* ------------------------------------------------------------------------------------------ */
    115 IMAGE_EXPORT(void) dup_f64matrix(float64 **X, long nrl,long nrh,long ncl, long nch, float64 **Y)
    116 /* ------------------------------------------------------------------------------------------ */
    117 {
    118     int i;
    119     for(i=nrl; i<=nrh; i++) {
    120         dup_f64vector(X[i], ncl, nch, Y[i]);
    121     }
    122 }
    123 /* ------------------------------------------------------------------------------------- */
    124 IMAGE_EXPORT(void) dup_rgb8matrix(rgb8 **X, long nrl,long nrh,long ncl, long nch, rgb8 **Y)
    125 /* ------------------------------------------------------------------------------------- */
    126 {
    127     int i;
    128     for(i=nrl; i<=nrh; i++) {
    129         dup_rgb8vector(X[i], ncl, nch, Y[i]);
    130     }
    131 }
    132 /* ---------------------------------------------------------------------------------------- */
    133 IMAGE_EXPORT(void) dup_rgbx8matrix(rgbx8 **X, long nrl,long nrh,long ncl, long nch, rgbx8 **Y)
    134 /* ---------------------------------------------------------------------------------------- */
    135 {
    136     int i;
    137     for(i=nrl; i<=nrh; i++) {
    138         dup_rgbx8vector(X[i], ncl, nch, Y[i]);
    139     }
    140 }
     43
     44dup_type_matrix(int8_t);
     45dup_type_matrix(uint8_t);
     46dup_type_matrix(int16_t);
     47dup_type_matrix(uint16_t);
     48dup_type_matrix(int32_t);
     49dup_type_matrix(uint32_t);
     50dup_type_matrix(int64_t);
     51dup_type_matrix(uint64_t);
     52dup_type_matrix(float);
     53dup_type_matrix(double);
     54dup_type_matrix(rgb8);
     55dup_type_matrix(rgbx8);
     56
     57
    14158/*
    14259 * --------------
     
    14461 * --------------
    14562 */
    146 /* -------------------------------------------------------------------------------- */
    147 IMAGE_EXPORT(void) resize_si8matrix(sint8 **m, long nrl, long nrh, long ncl, long nch)
    148 /* -------------------------------------------------------------------------------- */
    149 {
    150     long i, ncol=nch-ncl+1;
    151    
    152     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    153 }
    154 /* -------------------------------------------------------------------------------- */
    155 IMAGE_EXPORT(void) resize_ui8matrix(uint8 **m, long nrl, long nrh, long ncl, long nch)
    156 /* -------------------------------------------------------------------------------- */
    157 {
    158     long i, ncol=nch-ncl+1;
    159    
    160     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    161 }
    162 /* ---------------------------------------------------------------------------------- */
    163 IMAGE_EXPORT(void) resize_si16matrix(sint16 **m, long nrl, long nrh, long ncl, long nch)
    164 /* ---------------------------------------------------------------------------------- */
    165 {
    166     long i, ncol=nch-ncl+1;
    167    
    168     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    169 }
    170 /* ---------------------------------------------------------------------------------- */
    171 IMAGE_EXPORT(void) resize_ui16matrix(uint16 **m, long nrl, long nrh, long ncl, long nch)
    172 /* ---------------------------------------------------------------------------------- */
    173 {
    174     long i, ncol=nch-ncl+1;
    175    
    176     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    177 }
    178 /* ---------------------------------------------------------------------------------- */
    179 IMAGE_EXPORT(void) resize_si32matrix(sint32 **m, long nrl, long nrh, long ncl, long nch)
    180 /* ---------------------------------------------------------------------------------- */
    181 {
    182     long i, ncol=nch-ncl+1;
    183    
    184     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    185 }
    186 /* ---------------------------------------------------------------------------------- */
    187 IMAGE_EXPORT(void) resize_ui32matrix(uint32 **m, long nrl, long nrh, long ncl, long nch)
    188 /* ---------------------------------------------------------------------------------- */
    189 {
    190     long i, ncol=nch-ncl+1;
    191    
    192     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    193 }
    194 /* ---------------------------------------------------------------------------------- */
    195 IMAGE_EXPORT(void) resize_f32matrix(float32 **m, long nrl, long nrh, long ncl, long nch)
    196 /* ---------------------------------------------------------------------------------- */
    197 {
    198     long i, ncol=nch-ncl+1;
    199    
    200     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    201 }
    202 /* ---------------------------------------------------------------------------------- */
    203 IMAGE_EXPORT(void) resize_f64matrix(float64 **m, long nrl, long nrh, long ncl, long nch)
    204 /* ---------------------------------------------------------------------------------- */
    205 {
    206     long i, ncol=nch-ncl+1;
    207    
    208     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    209 }
    210 /* -------------------------------------------------------------------------------- */
    211 IMAGE_EXPORT(void) resize_rgb8matrix(rgb8 **m, long nrl, long nrh, long ncl, long nch)
    212 /* -------------------------------------------------------------------------------- */
    213 {
    214     long i, ncol=nch-ncl+1;
    215    
    216     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    217 }
    218 /* ---------------------------------------------------------------------------------- */
    219 IMAGE_EXPORT(void) resize_rgbx8matrix(rgbx8 **m, long nrl, long nrh, long ncl, long nch)
    220 /* ---------------------------------------------------------------------------------- */
    221 {
    222     long i, ncol=nch-ncl+1;
    223    
    224     for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
    225 }
    226 /* ---------------- */
    227 /* -- Convertion -- */
    228 /* ---------------- */
    229 /* ---------------------------------------------------------------------------------------------------- */
    230 IMAGE_EXPORT(void) convert_si8matrix_si16matrix(sint8 **X, int nrl, int nrh, int ncl, int nch, sint16 **Y)
    231 /* ---------------------------------------------------------------------------------------------------- */
    232 {
    233     long i;
    234     for(i=nrl; i<=nrh; i++) {
    235         convert_si8vector_si16vector(X[i], ncl, nch, Y[i]);
    236     }
    237 }
    238 /* ---------------------------------------------------------------------------------------------------- */
    239 IMAGE_EXPORT(void) convert_si8matrix_si32matrix(sint8 **X, int nrl, int nrh, int ncl, int nch, sint32 **Y)
    240 /* ---------------------------------------------------------------------------------------------------- */
    241 {
    242     long i;
    243     for(i=nrl; i<=nrh; i++) {
    244         convert_si8vector_si32vector(X[i], ncl, nch, Y[i]);
    245     }
    246 }
    247 /* ---------------------------------------------------------------------------------------------------- */
    248 IMAGE_EXPORT(void) convert_si8matrix_f32matrix(sint8 **X, int nrl, int nrh, int ncl, int nch, float32 **Y)
    249 /* ---------------------------------------------------------------------------------------------------- */
    250 {
    251     long i;
    252     for(i=nrl; i<=nrh; i++) {
    253         convert_si8vector_f32vector(X[i], ncl, nch, Y[i]);
    254     }
    255 }
    256 /* ---------------------------------------------------------------------------------------------------- */
    257 IMAGE_EXPORT(void) convert_si8matrix_f64matrix(sint8 **X, int nrl, int nrh, int ncl, int nch, float64 **Y)
    258 /* ---------------------------------------------------------------------------------------------------- */
    259 {
    260     long i;
    261     for(i=nrl; i<=nrh; i++) {
    262         convert_si8vector_f64vector(X[i], ncl, nch, Y[i]);
    263     }
    264 }
    265 /* ---------------------------------------------------------------------------------------------------- */
    266 IMAGE_EXPORT(void) convert_ui8matrix_ui16matrix(uint8 **X, int nrl, int nrh, int ncl, int nch, uint16 **Y)
    267 /* ---------------------------------------------------------------------------------------------------- */
    268 {
    269     long i;
    270     for(i=nrl; i<=nrh; i++) {
    271         convert_ui8vector_ui16vector(X[i], ncl, nch, Y[i]);
    272     }
    273 }
    274 /* ---------------------------------------------------------------------------------------------------- */
    275 IMAGE_EXPORT(void) convert_ui8matrix_ui32matrix(uint8 **X, int nrl, int nrh, int ncl, int nch, uint32 **Y)
    276 /* ---------------------------------------------------------------------------------------------------- */
    277 {
    278     long i;
    279     for(i=nrl; i<=nrh; i++) {
    280         convert_ui8vector_ui32vector(X[i], ncl, nch, Y[i]);
    281     }
    282 }
    283 /* ---------------------------------------------------------------------------------------------------- */
    284 IMAGE_EXPORT(void) convert_ui8matrix_f32matrix(uint8 **X, int nrl, int nrh, int ncl, int nch, float32 **Y)
    285 /* ---------------------------------------------------------------------------------------------------- */
    286 {
    287     long i;
    288     for(i=nrl; i<=nrh; i++) {
    289         convert_ui8vector_f32vector(X[i], ncl, nch, Y[i]);
    290     }
    291 }
    292 /* ---------------------------------------------------------------------------------------------------- */
    293 IMAGE_EXPORT(void) convert_ui8matrix_f64matrix(uint8 **X, int nrl, int nrh, int ncl, int nch, float64 **Y)
    294 /* ---------------------------------------------------------------------------------------------------- */
    295 {
    296     long i;
    297     for(i=nrl; i<=nrh; i++) {
    298         convert_ui8vector_f64vector(X[i], ncl, nch, Y[i]);
    299     }
    300 }
    301 /* -------------------------------------------------------------------------------------------------- */
    302 IMAGE_EXPORT(void) convert_ui8matrix_rgb8matrix(uint8 **X, int nrl, int nrh, int ncl, int nch, rgb8 **Y)
    303 /* -------------------------------------------------------------------------------------------------- */
    304 {
    305     long i;
    306     for(i=nrl; i<=nrh; i++) {
    307         convert_ui8vector_rgb8vector(X[i], ncl, nch, Y[i]);
    308     }
    309 }
    310 /* ---------------------------------------------------------------------------------------------------- */
    311 IMAGE_EXPORT(void) convert_ui8matrix_rgbx8matrix(uint8 **X, int nrl, int nrh, int ncl, int nch, rgbx8 **Y)
    312 /* ---------------------------------------------------------------------------------------------------- */
    313 {
    314     long i;
    315     for(i=nrl; i<=nrh; i++) {
    316         convert_ui8vector_rgbx8vector(X[i], ncl, nch, Y[i]);
    317     }
     63
     64#undef resize_type_matrix
     65#define resize_type_matrix(t) \
     66void short_name(t,resize_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) \
     67{                                              \
     68    int32_t ncol = nch - ncl + 1;              \
     69    for (int32_t i = nrl + 1; i <= nrh; i++) { \
     70        m[i] = m[i - 1] + ncol;                \
     71    }                                          \
    31872}
    31973
    320 /* ------------------------------------------------------------------------------------------------------ */
    321 IMAGE_EXPORT(void) convert_si16matrix_si32matrix(sint16 **X, int nrl, int nrh, int ncl, int nch, sint32 **Y)
    322 /* ------------------------------------------------------------------------------------------------------ */
    323 {
    324     long i;
    325     for(i=nrl; i<=nrh; i++) {
    326         convert_si16vector_si32vector(X[i], ncl, nch, Y[i]);
    327     }
     74resize_type_matrix(int8_t);
     75resize_type_matrix(uint8_t);
     76resize_type_matrix(int16_t);
     77resize_type_matrix(uint16_t);
     78resize_type_matrix(int32_t);
     79resize_type_matrix(uint32_t);
     80resize_type_matrix(int64_t);
     81resize_type_matrix(uint64_t);
     82resize_type_matrix(float);
     83resize_type_matrix(double);
     84resize_type_matrix(rgb8);
     85resize_type_matrix(rgbx8);
     86
     87
     88
     89/* ---------------- */
     90/* -- Conversion -- */
     91/* ---------------- */
     92
     93#undef convert_type_matrix
     94#define convert_type_matrix(t1,t2) \
     95void short_name(t1,convert_,short_name(t2,matrix_,matrix))(t1 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t2 ** Y) \
     96{                                                                                    \
     97    for (int32_t i = nrl; i <= nrh; i++) {                                           \
     98        short_name(t1,convert_,short_name(t2,vector_,vector))(X[i], ncl, nch, Y[i]); \
     99    }                                                                                \
    328100}
    329 /* ------------------------------------------------------------------------------------------------------ */
    330 IMAGE_EXPORT(void) convert_si16matrix_f32matrix(sint16 **X, int nrl, int nrh, int ncl, int nch, float32 **Y)
    331 /* ------------------------------------------------------------------------------------------------------ */
    332 {
    333     long i;
    334     for(i=nrl; i<=nrh; i++) {
    335         convert_si16vector_f32vector(X[i], ncl, nch, Y[i]);
    336     }
    337 }
    338 /* ------------------------------------------------------------------------------------------------------ */
    339 IMAGE_EXPORT(void) convert_si16matrix_f64matrix(sint16 **X, int nrl, int nrh, int ncl, int nch, float64 **Y)
    340 /* ------------------------------------------------------------------------------------------------------ */
    341 {
    342     long i;
    343     for(i=nrl; i<=nrh; i++) {
    344         convert_si16vector_f64vector(X[i], ncl, nch, Y[i]);
    345     }
    346 }
    347 /* ------------------------------------------------------------------------------------------------------ */
    348 IMAGE_EXPORT(void) convert_ui16matrix_ui32matrix(uint16 **X, int nrl, int nrh, int ncl, int nch, uint32 **Y)
    349 /* ------------------------------------------------------------------------------------------------------ */
    350 {
    351     long i;
    352     for(i=nrl; i<=nrh; i++) {
    353         convert_ui16vector_ui32vector(X[i], ncl, nch, Y[i]);
    354     }
    355 }
    356 /* ------------------------------------------------------------------------------------------------------ */
    357 IMAGE_EXPORT(void) convert_ui16matrix_f32matrix(uint16 **X, int nrl, int nrh, int ncl, int nch, float32 **Y)
    358 /* ------------------------------------------------------------------------------------------------------ */
    359 {
    360     long i;
    361     for(i=nrl; i<=nrh; i++) {
    362         convert_ui16vector_f32vector(X[i], ncl, nch, Y[i]);
    363     }
    364 }
    365 /* ------------------------------------------------------------------------------------------------------ */
    366 IMAGE_EXPORT(void) convert_ui16matrix_f64matrix(uint16 **X, int nrl, int nrh, int ncl, int nch, float64 **Y)
    367 /* ------------------------------------------------------------------------------------------------------ */
    368 {
    369     long i;
    370     for(i=nrl; i<=nrh; i++) {
    371         convert_ui16vector_f64vector(X[i], ncl, nch, Y[i]);
    372     }
    373 }
    374 /* ------------------------------------------------------------------------------------------------------ */
    375 IMAGE_EXPORT(void) convert_si32matrix_f32matrix(sint32 **X, int nrl, int nrh, int ncl, int nch, float32 **Y)
    376 /* ------------------------------------------------------------------------------------------------------ */
    377 {
    378     long i;
    379     for(i=nrl; i<=nrh; i++) {
    380         convert_si32vector_f32vector(X[i], ncl, nch, Y[i]);
    381     }
    382 }
    383 /* ------------------------------------------------------------------------------------------------------ */
    384 IMAGE_EXPORT(void) convert_si32matrix_f64matrix(sint32 **X, int nrl, int nrh, int ncl, int nch, float64 **Y)
    385 /* ------------------------------------------------------------------------------------------------------ */
    386 {
    387     long i;
    388     for(i=nrl; i<=nrh; i++) {
    389         convert_si32vector_f64vector(X[i], ncl, nch, Y[i]);
    390     }
    391 }
    392 /* ------------------------------------------------------------------------------------------------------ */
    393 IMAGE_EXPORT(void) convert_ui32matrix_f32matrix(uint32 **X, int nrl, int nrh, int ncl, int nch, float32 **Y)
    394 /* ------------------------------------------------------------------------------------------------------ */
    395 {
    396     long i;
    397     for(i=nrl; i<=nrh; i++) {
    398         convert_ui32vector_f32vector(X[i], ncl, nch, Y[i]);
    399     }
    400 }
    401 /* ------------------------------------------------------------------------------------------------------ */
    402 IMAGE_EXPORT(void) convert_ui32matrix_f64matrix(uint32 **X, int nrl, int nrh, int ncl, int nch, float64 **Y)
    403 /* ------------------------------------------------------------------------------------------------------ */
    404 {
    405     long i;
    406     for(i=nrl; i<=nrh; i++) {
    407         convert_ui32vector_f64vector(X[i], ncl, nch, Y[i]);
    408     }
    409 }
    410 /*
    411  * -------------------------
    412  * --- convert downgrade ---
    413  * -------------------------
    414  */
    415 /* --------------------------------------------------------------------------------------------------- */
    416 IMAGE_EXPORT(void) convert_si16matrix_si8matrix(sint16 **X, int nrl, int nrh, int ncl, int nch, sint8 **Y)
    417 /* --------------------------------------------------------------------------------------------------- */
    418 {
    419     long i;
    420     for(i=nrl; i<=nrh; i++) {
    421         convert_si16vector_si8vector(X[i], ncl, nch, Y[i]);
    422     }
    423 }
    424 /* --------------------------------------------------------------------------------------------------- */
    425 IMAGE_EXPORT(void) convert_ui16matrix_ui8matrix(uint16 **X, int nrl, int nrh, int ncl, int nch, uint8 **Y)
    426 /* --------------------------------------------------------------------------------------------------- */
    427 {
    428     long i;
    429     for(i=nrl; i<=nrh; i++) {
    430         convert_ui16vector_ui8vector(X[i], ncl, nch, Y[i]);
    431     }
    432 }
    433 /* ---------------------------------------------------------------------------------------------------- */
    434 IMAGE_EXPORT(void) convert_si32matrix_si8matrix(sint32 **X, int nrl, int nrh, int ncl, int nch, sint8 **Y)
    435 /* ---------------------------------------------------------------------------------------------------- */
    436 {
    437     long i;
    438     for(i=nrl; i<=nrh; i++) {
    439         convert_si32vector_si8vector(X[i], ncl, nch, Y[i]);
    440     }
    441 }
    442 /* --------------------------------------------------------------------------------------------------- */
    443 IMAGE_EXPORT(void) convert_si32matrix_si16matrix(sint32 **X, int nrl, int nrh, int ncl, int nch, sint16 **Y)
    444 /* --------------------------------------------------------------------------------------------------- */
    445 {
    446     long i;
    447     for(i=nrl; i<=nrh; i++) {
    448         convert_si32vector_si16vector(X[i], ncl, nch, Y[i]);
    449     }
    450 }
    451 /* ---------------------------------------------------------------------------------------------------- */
    452 IMAGE_EXPORT(void) convert_ui32matrix_ui8matrix(uint32 **X, int nrl, int nrh, int ncl, int nch, uint8 **Y)
    453 /* ---------------------------------------------------------------------------------------------------- */
    454 {
    455     long i;
    456     for(i=nrl; i<=nrh; i++) {
    457         convert_ui32vector_ui8vector(X[i], ncl, nch, Y[i]);
    458     }
    459 }
    460 /* --------------------------------------------------------------------------------------------------- */
    461 IMAGE_EXPORT(void) convert_ui32matrix_ui16matrix(uint32 **X, int nrl, int nrh, int ncl, int nch, uint16 **Y)
    462 /* --------------------------------------------------------------------------------------------------- */
    463 {
    464     long i;
    465     for(i=nrl; i<=nrh; i++) {
    466         convert_ui32vector_ui16vector(X[i], ncl, nch, Y[i]);
    467     }
    468 }
    469 /* ---------------------------------------------------------------------------------------------------- */
    470 IMAGE_EXPORT(void) convert_f32matrix_si8matrix(float32 **X, int nrl, int nrh, int ncl, int nch, sint8 **Y)
    471 /* ---------------------------------------------------------------------------------------------------- */
    472 {
    473     long i;
    474     for(i=nrl; i<=nrh; i++) {
    475         convert_f32vector_si8vector(X[i], ncl, nch, Y[i]);
    476     }
    477 }
    478 /* ---------------------------------------------------------------------------------------------------- */
    479 IMAGE_EXPORT(void) convert_f32matrix_ui8matrix(float32 **X, int nrl, int nrh, int ncl, int nch, uint8 **Y)
    480 /* ---------------------------------------------------------------------------------------------------- */
    481 {
    482     long i;
    483     for(i=nrl; i<=nrh; i++) {
    484         convert_f32vector_ui8vector(X[i], ncl, nch, Y[i]);
    485     }
    486 }
    487 /* ------------------------------------------------------------------------------------------------------ */
    488 IMAGE_EXPORT(void) convert_f32matrix_si16matrix(float32 **X, int nrl, int nrh, int ncl, int nch, sint16 **Y)
    489 /* ------------------------------------------------------------------------------------------------------ */
    490 {
    491     long i;
    492     for(i=nrl; i<=nrh; i++) {
    493         convert_f32vector_si16vector(X[i], ncl, nch, Y[i]);
    494     }
    495 }
    496 /* ------------------------------------------------------------------------------------------------------ */
    497 IMAGE_EXPORT(void) convert_f32matrix_ui16matrix(float32 **X, int nrl, int nrh, int ncl, int nch, uint16 **Y)
    498 /* ------------------------------------------------------------------------------------------------------ */
    499 {
    500     long i;
    501     for(i=nrl; i<=nrh; i++) {
    502         convert_f32vector_ui16vector(X[i], ncl, nch, Y[i]);
    503     }
    504 }
    505 /* ------------------------------------------------------------------------------------------------------ */
    506 IMAGE_EXPORT(void) convert_f32matrix_si32matrix(float32 **X, int nrl, int nrh, int ncl, int nch, sint32 **Y)
    507 /* ------------------------------------------------------------------------------------------------------ */
    508 {
    509     long i;
    510     for(i=nrl; i<=nrh; i++) {
    511         convert_f32vector_si32vector(X[i], ncl, nch, Y[i]);
    512     }
    513 }
    514 /* ------------------------------------------------------------------------------------------------------ */
    515 IMAGE_EXPORT(void) convert_f32matrix_ui32matrix(float32 **X, int nrl, int nrh, int ncl, int nch, uint32 **Y)
    516 /* ------------------------------------------------------------------------------------------------------ */
    517 {
    518     long i;
    519     for(i=nrl; i<=nrh; i++) {
    520         convert_f32vector_ui32vector(X[i], ncl, nch, Y[i]);
    521     }
    522 }
    523 /* ---------------------------------------------------------------------------------------------------- */
    524 IMAGE_EXPORT(void) convert_f64matrix_si8matrix(float64 **X, int nrl, int nrh, int ncl, int nch, sint8 **Y)
    525 /* ---------------------------------------------------------------------------------------------------- */
    526 {
    527     long i;
    528     for(i=nrl; i<=nrh; i++) {
    529         convert_f64vector_si8vector(X[i], ncl, nch, Y[i]);
    530     }
    531 }
    532 /* ---------------------------------------------------------------------------------------------------- */
    533 IMAGE_EXPORT(void) convert_f64matrix_ui8matrix(float64 **X, int nrl, int nrh, int ncl, int nch, uint8 **Y)
    534 /* ---------------------------------------------------------------------------------------------------- */
    535 {
    536     long i;
    537     for(i=nrl; i<=nrh; i++) {
    538         convert_f64vector_ui8vector(X[i], ncl, nch, Y[i]);
    539     }
    540 }
    541 /* ------------------------------------------------------------------------------------------------------ */
    542 IMAGE_EXPORT(void) convert_f64matrix_si16matrix(float64 **X, int nrl, int nrh, int ncl, int nch, sint16 **Y)
    543 /* ------------------------------------------------------------------------------------------------------ */
    544 {
    545     long i;
    546     for(i=nrl; i<=nrh; i++) {
    547         convert_f64vector_si16vector(X[i], ncl, nch, Y[i]);
    548     }
    549 }
    550 /* ------------------------------------------------------------------------------------------------------ */
    551 IMAGE_EXPORT(void) convert_f64matrix_ui16matrix(float64 **X, int nrl, int nrh, int ncl, int nch, uint16 **Y)
    552 /* ------------------------------------------------------------------------------------------------------ */
    553 {
    554     long i;
    555     for(i=nrl; i<=nrh; i++) {
    556         convert_f64vector_ui16vector(X[i], ncl, nch, Y[i]);
    557     }
    558 }
    559 /* ------------------------------------------------------------------------------------------------------ */
    560 IMAGE_EXPORT(void) convert_f64matrix_si32matrix(float64 **X, int nrl, int nrh, int ncl, int nch, sint32 **Y)
    561 /* ------------------------------------------------------------------------------------------------------ */
    562 {
    563     long i;
    564     for(i=nrl; i<=nrh; i++) {
    565         convert_f64vector_si32vector(X[i], ncl, nch, Y[i]);
    566     }
    567 }
    568 /* ------------------------------------------------------------------------------------------------------ */
    569 IMAGE_EXPORT(void) convert_f64matrix_ui32matrix(float64 **X, int nrl, int nrh, int ncl, int nch, uint32 **Y)
    570 /* ------------------------------------------------------------------------------------------------------ */
    571 {
    572     long i;
    573     for(i=nrl; i<=nrh; i++) {
    574         convert_f64vector_ui32vector(X[i], ncl, nch, Y[i]);
    575     }
    576 }
    577 /* ------------------------------------------------------------------------------------------------------ */
    578 IMAGE_EXPORT(void) convert_f64matrix_f32matrix(float64 **X, int nrl, int nrh, int ncl, int nch, float32 **Y)
    579 /* ------------------------------------------------------------------------------------------------------ */
    580 {
    581     long i;
    582     for(i=nrl; i<=nrh; i++) {
    583         convert_f64vector_f32vector(X[i], ncl, nch, Y[i]);
    584     }
    585 }
    586 /* ------------------------------------------------------------------------------------------------------ */
    587 IMAGE_EXPORT(void) convert_rgb8matrix_ui8matrix(rgb8 **X, long nrl, long nrh, long ncl, long nch, uint8 **Y)
    588 /* ------------------------------------------------------------------------------------------------------ */
    589 {
    590     long i;
    591     for(i=nrl; i<=nrh; i++) {
    592         convert_rgb8vector_ui8vector(X[i], ncl, nch, Y[i]);
    593     }
    594 }
     101
     102convert_type_matrix(int8_t,int16_t);
     103convert_type_matrix(int8_t,int32_t);
     104convert_type_matrix(int8_t,float);
     105convert_type_matrix(int8_t,double);
     106convert_type_matrix(uint8_t,uint16_t);
     107convert_type_matrix(uint8_t,uint32_t);
     108convert_type_matrix(uint8_t,float);
     109convert_type_matrix(uint8_t,double);
     110convert_type_matrix(uint8_t,rgb8);
     111convert_type_matrix(uint8_t,rgbx8);
     112convert_type_matrix(int16_t,int32_t);
     113convert_type_matrix(int16_t,float);
     114convert_type_matrix(int16_t,double);
     115convert_type_matrix(uint16_t,uint32_t);
     116convert_type_matrix(uint16_t,float);
     117convert_type_matrix(uint16_t,double);
     118convert_type_matrix(int32_t,float);
     119convert_type_matrix(int32_t,double);
     120convert_type_matrix(uint32_t,float);
     121convert_type_matrix(uint32_t,double);
     122
     123convert_type_matrix(int16_t,int8_t);
     124convert_type_matrix(uint16_t,uint8_t);
     125convert_type_matrix(int32_t,int8_t);
     126convert_type_matrix(uint32_t,uint8_t);
     127convert_type_matrix(int32_t,int16_t);
     128convert_type_matrix(uint32_t,uint16_t);
     129convert_type_matrix(float,int8_t);
     130convert_type_matrix(float,uint8_t);
     131convert_type_matrix(float,int16_t);
     132convert_type_matrix(float,uint16_t);
     133convert_type_matrix(float,int32_t);
     134convert_type_matrix(float,uint32_t);
     135convert_type_matrix(double,int8_t);
     136convert_type_matrix(double,uint8_t);
     137convert_type_matrix(double,int16_t);
     138convert_type_matrix(double,uint16_t);
     139convert_type_matrix(double,int32_t);
     140convert_type_matrix(double,uint32_t);
     141convert_type_matrix(double,float);
     142convert_type_matrix(rgb8,uint8_t);
     143
     144
    595145/*
    596146 * ----------------------
     
    598148 * ----------------------
    599149 */
    600 /* ------------------------------------------------------------------------------------------------------ */
    601 IMAGE_EXPORT(void) lowpart_ui16matrix_ui8matrix(uint16 **X, long nrl,long nrh,long ncl, long nch, uint8 **Y)
    602 /* ------------------------------------------------------------------------------------------------------ */
     150
     151void lowpart_ui16matrix_ui8matrix(uint16_t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8_t ** Y)
    603152{
    604         long i;
    605        
    606         for(i=nrl; i<=nrh; i++) {
    607                 lowpart_ui16vector_ui8vector(X[i], ncl,nch, Y[i]);
    608         }
     153    for (int32_t i = nrl; i <= nrh; i++) {
     154        lowpart_ui16vector_ui8vector(X[i], ncl, nch, Y[i]);
     155    }
    609156}
    610 /* ---------------------------------------------------------------------------------------- */
    611 void lowpart_ui32matrix_ui8matrix(uint32 **X, long nrl,long nrh,long ncl, long nch, uint8 **Y)
    612 /* ---------------------------------------------------------------------------------------- */
     157
     158void lowpart_ui32matrix_ui8matrix(uint32_t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8_t ** Y)
    613159{
    614         long i;
    615         for(i=nrl; i<=nrh; i++) {
    616                 lowpart_ui32vector_ui8vector(X[i], ncl,nch, Y[i]);
    617         }
     160    for (int32_t i = nrl; i <= nrh; i++) {
     161        lowpart_ui32vector_ui8vector(X[i], ncl,nch, Y[i]);
     162    }
    618163}
     164
    619165/*
    620166 * -------------------
     
    622168 * -------------------
    623169 */
    624 /* ---------------------------------------------------------------------------------------------------------------- */
    625 IMAGE_EXPORT(void) split_rgb8matrix(rgb8 **X, long nrl, long nrh, long ncl, long nch, uint8 **R, uint8 **G, uint8 **B)
    626 /* ---------------------------------------------------------------------------------------------------------------- */
     170
     171void split_rgb8matrix(rgb8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8_t ** R, uint8_t ** G, uint8_t ** B)
    627172{
    628         long i, j;
    629        
    630         for(i=nrl; i<=nrh; i++) {
    631                 for(j=ncl; j<=nch; j++) {
     173    for (int32_t i = nrl; i <= nrh; i++) {
     174        for (int32_t j = ncl; j <= nch; j++) {
    632175            split_rgb8vector(X[i], ncl, nch, R[i], G[i], B[i]);
    633                 }
    634         }
     176        }
     177    }
    635178}
    636 /* ---------------------------------------------------------------------------------------------------------------- */
    637 IMAGE_EXPORT(void) merge_rgb8matrix(uint8 **R, uint8 **G, uint8 **B, long nrl, long nrh, long ncl, long nch, rgb8 **X)
    638 /* ---------------------------------------------------------------------------------------------------------------- */
     179
     180void merge_rgb8matrix(uint8_t ** R, uint8_t ** G, uint8_t ** B, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8 ** X)
    639181{
    640         long i, j;
    641        
    642         for(i=nrl; i<=nrh; i++) {
    643                 for(j=ncl; j<=nch; j++) {
     182    for (int32_t i = nrl; i <= nrh; i++) {
     183        for (int32_t j = ncl; j <= nch; j++) {
    644184            merge_rgb8vector(R[i], G[i], B[i], ncl, nch, X[i]);
    645                 }
    646         }
     185        }
     186    }
    647187}
     188
     189
     190// Local Variables:
     191// tab-width: 4
     192// c-basic-offset: 4
     193// c-file-offsets:((innamespace . 0)(inline-open . 0))
     194// indent-tabs-mode: nil
     195// End:
     196
     197// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     198
Note: See TracChangeset for help on using the changeset viewer.