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

    r772 r826  
    1212
    1313/*
    14 * 2002/06/11 ajout des fonctions endline
    15 */
     14 * 2002/06/11 ajout des fonctions endline
     15 */
     16
    1617#include <stdio.h>
    1718#include <stddef.h>
    1819#include <stdlib.h>
    19 #include <math.h> // fabs
    2020
    2121#include "mypredef.h"
     
    2727#include "nrwrap1.h"
    2828
    29 /* --------------- */
    30 /* --- Mapping --- */
    31 /* --------------- */
    3229
    33 /* -------------------------------------------- */
    34 IMAGE_EXPORT(sint8*) si8vector_map(int nl, int nh)
    35 /* -------------------------------------------- */
    36 {
    37     // nothing to do: no alloc required...
    38     return NULL;
    39 }
    40 /* -------------------------------------------- */
    41 IMAGE_EXPORT(uint8*) ui8vector_map(int nl, int nh)
    42 /* -------------------------------------------- */
    43 {
    44     // nothing to do: no alloc required...
    45     return NULL;
    46 }
    47 /* ---------------------------------------------- */
    48 IMAGE_EXPORT(sint16*) si16vector_map(int nl, int nh)
    49 /* ---------------------------------------------- */
    50 {
    51     // nothing to do: no alloc required...
    52     return NULL;
    53 }
    54 /* ---------------------------------------------- */
    55 IMAGE_EXPORT(uint16*) ui16vector_map(int nl, int nh)
    56 /* ---------------------------------------------- */
    57 {
    58     // nothing to do: no alloc required...
    59     return NULL;
    60 }
    61 /* ---------------------------------------------- */
    62 IMAGE_EXPORT(sint32*) si32vector_map(int nl, int nh)
    63 /* ---------------------------------------------- */
    64 {
    65     // nothing to do: no alloc required...
    66     return NULL;
    67 }
    68 /* ---------------------------------------------- */
    69 IMAGE_EXPORT(uint32*) ui32vector_map(int nl, int nh)
    70 /* ---------------------------------------------- */
    71 {
    72     // nothing to do: no alloc required...
    73     return NULL;
    74 }
    75 /* ---------------------------------------------- */
    76 IMAGE_EXPORT(float32*) f32vector_map(int nl, int nh)
    77 /* ---------------------------------------------- */
    78 {
    79     // nothing to do: no alloc required...
    80     return NULL;
    81 }
    82 /* ---------------------------------------------- */
    83 IMAGE_EXPORT(float64*) f64vector_map(int nl, int nh)
    84 /* ---------------------------------------------- */
    85 {
    86     // nothing to do: no alloc required...
    87     return NULL;
    88 }
    89 /* -------------------------------------------- */
    90 IMAGE_EXPORT(rgb8*) rgb8vector_map(int nl, int nh)
    91 /* -------------------------------------------- */
    92 {
    93     // nothing to do: no alloc required...
    94     return NULL;
    95 }
    96 /* ---------------------------------------------- */
    97 IMAGE_EXPORT(rgbx8*) rgbx8vector_map(int nl, int nh)
    98 /* ---------------------------------------------- */
    99 {
    100     // nothing to do: no alloc required...
    101     return NULL;
    102 }
    10330/* ------------------ */
    10431/* --- Mapping 1D --- */
    10532/* ------------------ */
    106 /* ----------------------------------------------------------------------------------------- */
    107 IMAGE_EXPORT(sint8*) si8vector_map_1D_pitch(sint8 *v, int nl, int nh, void *data_1D, int pitch)
    108 /* ----------------------------------------------------------------------------------------- */
    109 {
    110     v = (sint8*) data_1D;
    111     v -= nl;
    112     return v;
    113 }
    114 /* ----------------------------------------------------------------------------------------- */
    115 IMAGE_EXPORT(uint8*) ui8vector_map_1D_pitch(uint8 *v, int nl, int nh, void *data_1D, int pitch)
    116 /* ----------------------------------------------------------------------------------------- */
    117 {
    118     v = (uint8*) data_1D;
    119     v -= nl;
    120     return v;
    121 }
    122 /* -------------------------------------------------------------------------------------------- */
    123 IMAGE_EXPORT(uint16*) ui16vector_map_1D_pitch(uint16 *v, int nl, int nh, void *data_1D, int pitch)
    124 /* -------------------------------------------------------------------------------------------- */
    125 {
    126     v = (uint16*) data_1D;
    127     v -= nl;
    128     return v;
    129 }
    130 /* -------------------------------------------------------------------------------------------- */
    131 IMAGE_EXPORT(sint16*) si16vector_map_1D_pitch(sint16 *v, int nl, int nh, void *data_1D, int pitch)
    132 /* -------------------------------------------------------------------------------------------- */
    133 {
    134     v = (sint16*) data_1D;
    135     v -= nl;
    136     return v;
    137 }
    138 /* -------------------------------------------------------------------------------------------- */
    139 IMAGE_EXPORT(uint32*) ui32vector_map_1D_pitch(uint32 *v, int nl, int nh, void *data_1D, int pitch)
    140 /* -------------------------------------------------------------------------------------------- */
    141 {
    142     v = (uint32*) data_1D;
    143     v -= nl;
    144     return v;
    145 }
    146 /* -------------------------------------------------------------------------------------------- */
    147 IMAGE_EXPORT(sint32*) si32vector_map_1D_pitch(sint32 *v, int nl, int nh, void *data_1D, int pitch)
    148 /* -------------------------------------------------------------------------------------------- */
    149 {
    150     v = (sint32*) data_1D;
    151     v -= nl;
    152     return v;
    153 }
    154 /* --------------------------------------------------------------------------------------------- */
    155 IMAGE_EXPORT(float32*) f32vector_map_1D_pitch(float32 *v, int nl, int nh, void *data_1D, int pitch)
    156 /* --------------------------------------------------------------------------------------------- */
    157 {
    158     v = (float32*) data_1D;
    159     v -= nl;
    160     return v;
    161 }
    162 /* --------------------------------------------------------------------------------------------- */
    163 IMAGE_EXPORT(float64*) f64vector_map_1D_pitch(float64 *v, int nl, int nh, void *data_1D, int pitch)
    164 /* --------------------------------------------------------------------------------------------- */
    165 {
    166     v = (float64*) data_1D;
    167     v -= nl;
    168     return v;
    169 }
    170 /* ---------------------------------------------------------------------------------------- */
    171 IMAGE_EXPORT(rgb8*) rgb8vector_map_1D_pitch(rgb8 *v, int nl, int nh, void *data_1D, int pitch)
    172 /* ---------------------------------------------------------------------------------------- */
    173 {
    174     v = (rgb8*) data_1D;
    175     v -= nl;
    176     return v;
    177 }
    178 /* ------------------------------------------------------------------------------------------- */
    179 IMAGE_EXPORT(rgbx8*) rgbx8vector_map_1D_pitch(rgbx8 *v, int nl, int nh, void *data_1D, int pitch)
    180 /* ------------------------------------------------------------------------------------------- */
    181 {
    182     v = (rgbx8*) data_1D;
    183     v -= nl;
    184     return v;
     33
     34#undef type_vector_map_1D_pitch
     35#define type_vector_map_1D_pitch(t) \
     36t * short_name(t,,vector_map_1D_pitch)(t * v, int32_t nl, int32_t nh, void * data_1D, int32_t pitch) \
     37{                      \
     38    v = (t *) data_1D; \
     39    v -= nl;           \
     40    return v;          \
    18541}
    18642
     43type_vector_map_1D_pitch(int8_t);
     44type_vector_map_1D_pitch(uint8_t);
     45type_vector_map_1D_pitch(int16_t);
     46type_vector_map_1D_pitch(uint16_t);
     47type_vector_map_1D_pitch(int32_t);
     48type_vector_map_1D_pitch(uint32_t);
     49type_vector_map_1D_pitch(int64_t);
     50type_vector_map_1D_pitch(uint64_t);
     51type_vector_map_1D_pitch(float);
     52type_vector_map_1D_pitch(double);
     53type_vector_map_1D_pitch(rgb8);
     54type_vector_map_1D_pitch(rgbx8);
     55
     56
     57
     58
     59// Local Variables:
     60// tab-width: 4
     61// c-basic-offset: 4
     62// c-file-offsets:((innamespace . 0)(inline-open . 0))
     63// indent-tabs-mode: nil
     64// End:
     65
     66// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     67
Note: See TracChangeset for help on using the changeset viewer.