MED fichier
MEDfilterSetFileInterlacing.c
Aller à la documentation de ce fichier.
1/* This file is part of MED.
2 *
3 * COPYRIGHT (C) 1999 - 2023 EDF R&D, CEA/DEN
4 * MED is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * MED is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with MED. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18
19#include <med.h>
20#include <med_config.h>
21#include <med_outils.h>
22#include <string.h>
23
26
28 med_filter * const filter,
29 const med_interlacing_mode switchmode) {
30
31 med_err _ret=-1;
32 med_filter __filter = MED_FILTER_INIT;
33 med_filter *_filter = &__filter;
34
35 /* ISCRUTE( (*filter).nentity ); */
36 /* ISCRUTE( (*filter).nvaluesperentity ); */
37 /* ISCRUTE( (*filter).nconstituentpervalue ); */
38 /* ISCRUTE( (*filter).constituentselect ); */
39 /* ISCRUTE( (*filter).switchmode ); */
40 /* ISCRUTE( (*filter).storagemode ); */
41 /* ISCRUTE( (*filter).diskswitchmode ); */
42 /* SSCRUTE( (*filter).profilename ); */
43 /* ISCRUTE_size( (*filter).start ); */
44 /* ISCRUTE_size( (*filter).stride ); */
45 /* ISCRUTE_size( (*filter).count ); */
46 /* ISCRUTE_size( (*filter).blocksize ); */
47 /* ISCRUTE_size( (*filter).lastblocksize ); */
48
49 /* On prépositionne le diskwswitchmode dans le nouveau filtre _filter à créer. */
50 /* Cette technique évite d'appeler directement l'API Filter..Cr51 en version 51 */
51 /* avec le paramètre diskswitchmode supplémentaire */
52 /* Celà évite d'oublier de mettre à jour un appel si une nvelle version de l'API voit le jour */
53 /* On prend cependant le risque d'une modification interne du traitement de _diskswitchmode */
54 /* On pourrait ajouter un ifdef en fct de la version medfichier aussi */
55 /* On pourrait aussi versionner MEDfilterSetFileInterlacing */
56
57 if ( (*filter).filtertype == MED_FILTER_TYPE_UNDEF ) {
58 filter->diskswitchmode = switchmode;
59 goto SORTIE;
60 }
61
62 _filter->diskswitchmode = switchmode;
63
64 switch( (*filter).filtertype ) {
65
66 case MED_FILTER_BLOCK :
67
69 (*filter).nentity, (*filter).nvaluesperentity,
70 (*filter).nconstituentpervalue, (*filter).constituentselect,
71 (*filter).switchmode, (*filter).storagemode,
72 (*filter).profilename, (*filter).start,
73 (*filter).stride, (*filter).count,
74 (*filter).blocksize, (*filter).lastblocksize,
75 _filter) < 0) {
76 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDfilterBlockOfEntityCr");
77 ISCRUTE_int(_filter->diskswitchmode);goto ERROR;
78 }
79 break;
80 case MED_FILTER_LIST :
81 if ( MEDfilterEntityCr(fid,
82 (*filter).nentity, (*filter).nvaluesperentity,
83 (*filter).nconstituentpervalue, (*filter).constituentselect,
84 (*filter).switchmode, (*filter).storagemode,
85 (*filter).profilename, (*filter).filterarraysize,
86 (*filter).filterarray, _filter ) < 0 ) {
87 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDfilterEntityCr");
88 ISCRUTE_int(_filter->diskswitchmode);goto ERROR;
89 }
90 break;
91 default:
93 ISCRUTE_int((*filter).filtertype);
94 goto ERROR;
95 }
96
97 MEDfilterClose(filter);
98 MEDfilterCopy(_filter, filter);
99
100 SORTIE:
101 _ret = 0;
102
103 ERROR:
104
105 return _ret;
106}
#define MED_FILTER_INIT
#define med_interlacing_mode
#define MED_ERR_(rt, r1, r2, r3)
#define ISCRUTE_int(entier)
MEDC_EXPORT med_err MEDfilterClose(med_filter *const filter)
Dés-alloue les ressources hdf détenues par un filtre.
MEDC_EXPORT med_err MEDfilterEntityCr(const med_idt fid, const med_int nentity, const med_int nvaluesperentity, const med_int nconstituentpervalue, const med_int constituentselect, const med_switch_mode switchmode, const med_storage_mode storagemode, const char *const profilename, const med_int filterarraysize, const med_int *const filterarray, med_filter *const filter)
med_err MEDfilterSetFileInterlacing(const med_idt fid, med_filter *const filter, const med_interlacing_mode switchmode)
MEDC_EXPORT med_err MEDfilterBlockOfEntityCr(const med_idt fid, const med_int nentity, const med_int nvaluesperentity, const med_int nconstituentpervalue, const med_int constituentselect, const med_switch_mode switchmode, const med_storage_mode storagemode, const char *const profilename, const med_size start, const med_size stride, const med_size count, const med_size blocksize, const med_size lastblocksize, med_filter *const filter)
Crée un filtre en sélectionnant par blocs les entités pour lesquelles on veut lire/écrire des valeurs...
#define MED_ERR_CALL
Definition med_err.h:48
#define MED_ERR_API
Definition med_err.h:111
#define MED_ERR_VALUE_MSG
Definition med_err.h:186
#define MED_ERR_RANGE
Definition med_err.h:34
#define MED_ERR_FILTERTYPE
Definition med_err.h:131
MEDC_EXPORT med_err MEDfilterCopy(const med_filter *const filtersrc, med_filter *const filterdest)
med_switch_mode diskswitchmode
Filtre de sélection.