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/nrset3.c

    r772 r826  
    2121#include "nrset3.h"
    2222
    23 /* ------------------------------------------------------------------------------------- */
    24 IMAGE_EXPORT(void) zero_si8cube(sint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    25 /* ------------------------------------------------------------------------------------- */
     23
     24#undef zero_type_cube
     25#define zero_type_cube(t) \
     26void short_name(t,zero_,cube)(t *** c, int32_t k0, int32_t k1, int32_t i0, int32_t i1, int32_t j0, int32_t j1) \
     27{                                                         \
     28    for (int32_t k = k0; k <= k1; k++) {                  \
     29        short_name(t,zero_,matrix)(c[k], i0, i1, j0, j1); \
     30    }                                                     \
     31}
     32
     33zero_type_cube(int8_t);
     34zero_type_cube(uint8_t);
     35zero_type_cube(int16_t);
     36zero_type_cube(uint16_t);
     37zero_type_cube(int32_t);
     38zero_type_cube(uint32_t);
     39zero_type_cube(int64_t);
     40zero_type_cube(uint64_t);
     41zero_type_cube(float);
     42zero_type_cube(double);
     43zero_type_cube(rgb8);
     44zero_type_cube(rgbx8);
     45
     46#undef set_type_cube_param
     47#define set_type_cube_param(t) \
     48void short_name(t,set_,cube_param)(t *** c, int32_t k0, int32_t k1, int32_t i0, int32_t i1, int32_t j0, int32_t j1, t x, t xstep, t ystep, t zstep) \
     49{                                        \
     50    for (int32_t k = k0; k <= k1; k++) { \
     51        short_name(t,set_,matrix_param)(c[k], i0, i1, j0, j1, x, xstep, ystep); \
     52        x += zstep;                      \
     53    }                                    \
     54}
     55
     56set_type_cube_param(int8_t);
     57set_type_cube_param(uint8_t);
     58set_type_cube_param(int16_t);
     59set_type_cube_param(uint16_t);
     60set_type_cube_param(int32_t);
     61set_type_cube_param(uint32_t);
     62set_type_cube_param(int64_t);
     63set_type_cube_param(uint64_t);
     64set_type_cube_param(float);
     65set_type_cube_param(double);
     66
     67
     68void set_rgb8cube_param(rgb8 *** c, int32_t k0, int32_t k1, int32_t i0, int32_t i1, int32_t j0, int32_t j1, rgb8 x, rgb8 xstep, rgb8 ystep, rgb8 zstep)
    2669{
    27         int k;
    28         for(k=k0; k<=k1; k++) {
    29                 zero_si8matrix(c[k], i0, i1, j0, j1);
    30         }
     70    for (int32_t k = k0; k <= k1; k++) {
     71        set_rgb8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
     72        RGB8_ADD(x, xstep, x);
     73    }
    3174}
    32 /* ------------------------------------------------------------------------------------- */
    33 IMAGE_EXPORT(void) zero_ui8cube(uint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    34 /* ------------------------------------------------------------------------------------- */
     75
     76void set_rgbx8cube_param(rgbx8 *** c, int32_t k0, int32_t k1, int32_t i0, int32_t i1, int32_t j0, int32_t j1, rgbx8 x, rgbx8 xstep, rgbx8 ystep, rgbx8 zstep)
    3577{
    36         int k;
    37         for(k=k0; k<=k1; k++) {
    38                 zero_ui8matrix(c[k], i0, i1, j0, j1);
    39         }
     78    for (int32_t k = k0; k <= k1; k++) {
     79        set_rgbx8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
     80        RGBX8_ADD(x, xstep, x);
     81    }
    4082}
    41 /* --------------------------------------------------------------------------------------- */
    42 IMAGE_EXPORT(void) zero_si16cube(sint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    43 /* --------------------------------------------------------------------------------------- */
    44 {
    45         int k;
    46         for(k=k0; k<=k1; k++) {
    47                 zero_si16matrix(c[k], i0, i1, j0, j1);
    48         }
    49 }
    50 /* --------------------------------------------------------------------------------------- */
    51 IMAGE_EXPORT(void) zero_ui16cube(uint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    52 /* --------------------------------------------------------------------------------------- */
    53 {
    54         int k;
    55         for(k=k0; k<=k1; k++) {
    56                 zero_ui16matrix(c[k], i0, i1, j0, j1);
    57         }
    58 }
    59 /* --------------------------------------------------------------------------------------- */
    60 IMAGE_EXPORT(void) zero_si32cube(sint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    61 /* --------------------------------------------------------------------------------------- */
    62 {
    63         int k;
    64         for(k=k0; k<=k1; k++) {
    65                 zero_si32matrix(c[k], i0, i1, j0, j1);
    66         }
    67 }
    68 /* ---------------------------------------------------------------------------------------- */
    69 IMAGE_EXPORT(void) zero_ui32cube( uint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    70 /* ---------------------------------------------------------------------------------------- */
    71 {
    72         int k;
    73         for(k=k0; k<=k1; k++) {
    74                 zero_ui32matrix(c[k], i0, i1, j0, j1);
    75         }
    76 }
    77 /* --------------------------------------------------------------------------------------- */
    78 IMAGE_EXPORT(void) zero_si64cube(sint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    79 /* --------------------------------------------------------------------------------------- */
    80 {
    81         int k;
    82         for(k=k0; k<=k1; k++) {
    83                 zero_si64matrix(c[k], i0, i1, j0, j1);
    84         }
    85 }
    86 /* --------------------------------------------------------------------------------------- */
    87 IMAGE_EXPORT(void) zero_ui64cube(uint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    88 /* --------------------------------------------------------------------------------------- */
    89 {
    90         int k;
    91         for(k=k0; k<=k1; k++) {
    92                 zero_ui64matrix(c[k], i0, i1, j0, j1);
    93         }
    94 }
    95 /* --------------------------------------------------------------------------------------- */
    96 IMAGE_EXPORT(void) zero_f32cube(float32 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    97 /* --------------------------------------------------------------------------------------- */
    98 {
    99         int k;
    100         for(k=k0; k<=k1; k++) {
    101                 zero_f32matrix(c[k], i0, i1, j0, j1);
    102         }
    103 }
    104 /* --------------------------------------------------------------------------------------- */
    105 IMAGE_EXPORT(void) zero_f64cube(float64 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
    106 /* --------------------------------------------------------------------------------------- */
    107 {
    108         int k;
    109         for(k=k0; k<=k1; k++) {
    110                 zero_f64matrix(c[k], i0, i1, j0, j1);
    111         }
    112 }
    113 /* ------------------------------------------------------------------------------------------------------------------------------------------ */
    114 IMAGE_EXPORT(void) set_si8cube_param(sint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint8 x, sint8 xstep, sint8 ystep, sint8 zstep)
    115 /* ------------------------------------------------------------------------------------------------------------------------------------------ */
    116 {
    117         int k;
    118         for(k=k0; k<=k1; k++) {
    119                 set_si8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    120         x += zstep;
    121         }
    122 }
    123 /* ------------------------------------------------------------------------------------------------------------------------------------------ */
    124 IMAGE_EXPORT(void) set_ui8cube_param(uint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint8 x, uint8 xstep, uint8 ystep, uint8 zstep)
    125 /* ------------------------------------------------------------------------------------------------------------------------------------------ */
    126 {
    127     int k;
    128         for(k=k0; k<=k1; k++) {
    129                 set_ui8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    130         x += zstep;
    131         }
    132 }
    133 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    134 IMAGE_EXPORT(void) set_si16cube_param(sint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint16 x, sint16 xstep, sint16 ystep, sint16 zstep)
    135 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    136 {
    137         int k;
    138         for(k=k0; k<=k1; k++) {
    139                 set_si16matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    140         x += zstep;
    141         }
    142 }
    143 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    144 IMAGE_EXPORT(void) set_ui16cube_param(uint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint16 x, uint16 xstep, uint16 ystep, uint16 zstep)
    145 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    146 {
    147         int k;
    148         for(k=k0; k<=k1; k++) {
    149                 set_ui16matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    150         x += zstep;
    151         }
    152 }
    153 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    154 IMAGE_EXPORT(void) set_si32cube_param(sint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint32 x, sint32 xstep, sint32 ystep, sint32 zstep)
    155 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    156 {
    157         int k;
    158         for(k=k0; k<=k1; k++) {
    159                 set_si32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    160         x += zstep;
    161         }
    162 }
    163 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    164 IMAGE_EXPORT(void) set_ui32cube_param(uint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint32 x, uint32 xstep, uint32 ystep, uint32 zstep)
    165 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    166 {
    167         int k;
    168         for(k=k0; k<=k1; k++) {
    169                 set_ui32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    170         x += zstep;
    171         }
    172 }
    173 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    174 IMAGE_EXPORT(void) set_si64cube_param(sint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint64 x, sint64 xstep, sint64 ystep, sint64 zstep)
    175 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    176 {
    177         int k;
    178         for(k=k0; k<=k1; k++) {
    179                 set_si64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    180         x += zstep;
    181         }
    182 }
    183 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    184 IMAGE_EXPORT(void) set_ui64cube_param(uint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint64 x, uint64 xstep, uint64 ystep, uint64 zstep)
    185 /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
    186 {
    187         int k;
    188         for(k=k0; k<=k1; k++) {
    189                 set_ui64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    190         x += zstep;
    191         }
    192 }
    193 /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */
    194 IMAGE_EXPORT(void) set_f32cube_param(float32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, float32 x, float32 xstep, float32 ystep, float32 zstep)
    195 /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */
    196 {
    197         int k;
    198         for(k=k0; k<=k1; k++) {
    199                 set_f32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    200         x += zstep;
    201         }
    202 }
    203 /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */
    204 IMAGE_EXPORT(void) set_f64cube_param(float64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, float64 x, float64 xstep, float64 ystep, float64 zstep)
    205 /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */
    206 {
    207         int k;
    208         for(k=k0; k<=k1; k++) {
    209                 set_f64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    210         x += zstep;
    211         }
    212 }
    213 /* --------------------------------------------------------------------------------------------------------------------------------------- */
    214 IMAGE_EXPORT(void) set_rgb8cube_param(rgb8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, rgb8 x, rgb8 xstep, rgb8 ystep, rgb8 zstep)
    215 /* --------------------------------------------------------------------------------------------------------------------------------------- */
    216 {
    217         int k;
    218         for(k=k0; k<=k1; k++) {
    219                 set_rgb8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    220         RGB8_ADD(x,xstep,x);
    221         }
    222 }
    223 /* -------------------------------------------------------------------------------------------------------------------------------------------- */
    224 IMAGE_EXPORT(void) set_rgbx8cube_param(rgbx8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, rgbx8 x, rgbx8 xstep, rgbx8 ystep, rgbx8 zstep)
    225 /* -------------------------------------------------------------------------------------------------------------------------------------------- */
    226 {
    227         int k;
    228         for(k=k0; k<=k1; k++) {
    229                 set_rgbx8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
    230         RGBX8_ADD(x,xstep,x);
    231         }
    232 }
     83
     84
     85// Local Variables:
     86// tab-width: 4
     87// c-basic-offset: 4
     88// c-file-offsets:((innamespace . 0)(inline-open . 0))
     89// indent-tabs-mode: nil
     90// End:
     91
     92// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     93
Note: See TracChangeset for help on using the changeset viewer.