00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <stdio.h>
00023 #include <stdlib.h>
00024 #include <string.h>
00025 #include "flgrCoreMalloc.h"
00026 #include "flgrCoreData.h"
00027 #include "flgrCoreDispatch.h"
00028 #include "flgrCoreIO.h"
00029 #include "flgrCoreDataIO.h"
00030
00038
00039
00041 #define FLGR_MACRO_SET_DATA1D_VECTOR(dtype) \
00042 dtype *array_s = (dtype*) (vct->array); \
00043 dtype *array_d = (dtype*) (dat->array); \
00044 \
00045 \
00046 flgr_set_data_array_vector_##dtype(array_d, array_s, vct->spp, pos)
00047
00048 void flgr1d_set_data_vector_fgBIT(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00049 FLGR_MACRO_SET_DATA1D_VECTOR(fgBIT);
00050 }
00051 void flgr1d_set_data_vector_fgUINT8(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00052 FLGR_MACRO_SET_DATA1D_VECTOR(fgUINT8);
00053 }
00054 void flgr1d_set_data_vector_fgUINT16(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00055 FLGR_MACRO_SET_DATA1D_VECTOR(fgUINT16);
00056 }
00057 void flgr1d_set_data_vector_fgUINT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00058 FLGR_MACRO_SET_DATA1D_VECTOR(fgUINT32);
00059 }
00060 void flgr1d_set_data_vector_fgINT8(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00061 FLGR_MACRO_SET_DATA1D_VECTOR(fgINT8);
00062 }
00063 void flgr1d_set_data_vector_fgINT16(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00064 FLGR_MACRO_SET_DATA1D_VECTOR(fgINT16);
00065 }
00066 void flgr1d_set_data_vector_fgINT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00067 FLGR_MACRO_SET_DATA1D_VECTOR(fgINT32);
00068 }
00069 void flgr1d_set_data_vector_fgFLOAT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00070 FLGR_MACRO_SET_DATA1D_VECTOR(fgFLOAT32);
00071 }
00072 void flgr1d_set_data_vector_fgFLOAT64(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00073 FLGR_MACRO_SET_DATA1D_VECTOR(fgFLOAT64);
00074 }
00076
00082
00083 FLGR_Ret flgr1d_set_data_vector(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00084
00085
00086 if((dat==NULL) || (vct==NULL)) {
00087 POST_ERROR("Null objects\n");
00088 return FLGR_RET_NULL_OBJECT;
00089 }
00090
00091 if(dat->spp != vct->spp) {
00092 POST_ERROR("Data and Vector don't have the same Samples Per Pixel\n");
00093 return FLGR_RET_UNDEFINED_ERROR;
00094 }
00095
00096 if((pos<0) || (pos>=dat->length)) {
00097 POST_WARNING("position out of the array : %d!\n",pos);
00098 return FLGR_RET_UNDEFINED_ERROR;
00099 }
00100
00101 FLGR_DISPATCH_PROCEDURE(dat->type,flgr1d_set_data_vector,dat,pos,vct);
00102 }
00103
00104
00105
00106
00107
00109
00111 #define FLGR_MACRO_GET_DATA1D_VECTOR(dtype) \
00112 dtype *array_s = (dtype*) (dat->array); \
00113 dtype *array_d = (dtype*) (vct->array); \
00114 \
00115 \
00116 pos = flgr_normalize_coordinate(pos,dat->length); \
00117 flgr_get_data_array_vector_##dtype(array_d, array_s, vct->spp, pos)
00118
00119 void flgr1d_get_data_vector_fgBIT(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00120 FLGR_MACRO_GET_DATA1D_VECTOR(fgBIT);
00121 }
00122 void flgr1d_get_data_vector_fgUINT8(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00123 FLGR_MACRO_GET_DATA1D_VECTOR(fgUINT8);
00124 }
00125 void flgr1d_get_data_vector_fgUINT16(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00126 FLGR_MACRO_GET_DATA1D_VECTOR(fgUINT16);
00127 }
00128 void flgr1d_get_data_vector_fgUINT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00129 FLGR_MACRO_GET_DATA1D_VECTOR(fgUINT32);
00130 }
00131 void flgr1d_get_data_vector_fgINT8(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00132 FLGR_MACRO_GET_DATA1D_VECTOR(fgINT8);
00133 }
00134 void flgr1d_get_data_vector_fgINT16(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00135 FLGR_MACRO_GET_DATA1D_VECTOR(fgINT16);
00136 }
00137 void flgr1d_get_data_vector_fgINT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00138 FLGR_MACRO_GET_DATA1D_VECTOR(fgINT32);
00139 }
00140 void flgr1d_get_data_vector_fgFLOAT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00141 FLGR_MACRO_GET_DATA1D_VECTOR(fgFLOAT32);
00142 }
00143 void flgr1d_get_data_vector_fgFLOAT64(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00144 FLGR_MACRO_GET_DATA1D_VECTOR(fgFLOAT64);
00145 }
00147
00156
00157 FLGR_Ret flgr1d_get_data_vector(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00158
00159
00160 if((dat==NULL) || (vct==NULL)) {
00161 POST_ERROR("Null objects\n");
00162 return FLGR_RET_NULL_OBJECT;
00163 }
00164
00165 if(dat->spp != vct->spp) {
00166 POST_ERROR("Data and Vector don't have the same Samples Per Pixel\n");
00167 return FLGR_RET_UNDEFINED_ERROR;
00168 }
00169
00170 FLGR_DISPATCH_PROCEDURE(dat->type,flgr1d_get_data_vector,dat,pos,vct);
00171 }
00172
00173
00174
00175
00176
00177
00179
00181 #define FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(dtype) \
00182 dtype *array_s = (dtype*) (dat->array); \
00183 dtype *array_d = (dtype*) (vct->array); \
00184 \
00185 \
00186 flgr_get_data_array_vector_##dtype(array_d, array_s, vct->spp, pos)
00187
00188 void flgr1d_get_data_vector_no_norm_fgBIT(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00189 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgBIT);
00190 }
00191 void flgr1d_get_data_vector_no_norm_fgUINT8(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00192 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgUINT8);
00193 }
00194 void flgr1d_get_data_vector_no_norm_fgUINT16(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00195 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgUINT16);
00196 }
00197 void flgr1d_get_data_vector_no_norm_fgUINT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00198 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgUINT32);
00199 }
00200 void flgr1d_get_data_vector_no_norm_fgINT8(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00201 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgINT8);
00202 }
00203 void flgr1d_get_data_vector_no_norm_fgINT16(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00204 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgINT16);
00205 }
00206 void flgr1d_get_data_vector_no_norm_fgINT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00207 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgINT32);
00208 }
00209 void flgr1d_get_data_vector_no_norm_fgFLOAT32(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00210 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgFLOAT32);
00211 }
00212 void flgr1d_get_data_vector_no_norm_fgFLOAT64(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00213 FLGR_MACRO_GET_DATA1D_VECTOR_NO_NORM(fgFLOAT64);
00214 }
00216
00222
00223 FLGR_Ret flgr1d_get_data_vector_no_norm(FLGR_Data1D *dat, int pos, FLGR_Vector *vct) {
00224
00225
00226 if((dat==NULL) || (vct==NULL)) {
00227 POST_ERROR("Null objects\n");
00228 return FLGR_RET_NULL_OBJECT;
00229 }
00230
00231 if(dat->spp != vct->spp) {
00232 POST_ERROR("Data and Vector don't have the same Samples Per Pixel\n");
00233 return FLGR_RET_UNDEFINED_ERROR;
00234 }
00235
00236 if((pos<0) || (pos>=dat->length)) {
00237 POST_WARNING("position out of the array : %d!\n",pos);
00238 return FLGR_RET_UNDEFINED_ERROR;
00239 }
00240
00241 FLGR_DISPATCH_PROCEDURE(dat->type,flgr1d_get_data_vector_no_norm,dat,pos,vct);
00242 }
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00254
00256 #define FLGR_MACRO_SET_DATA2D_VECTOR(dtype) \
00257 dtype *array_s = (dtype*) (vct->array); \
00258 dtype *array_d = (dtype*) (dat->array[row]); \
00259 \
00260 \
00261 flgr_set_data_array_vector_##dtype(array_d, array_s, vct->spp, col)
00262
00263 void flgr2d_set_data_vector_fgBIT(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00264 FLGR_MACRO_SET_DATA2D_VECTOR(fgBIT);
00265 }
00266 void flgr2d_set_data_vector_fgUINT8(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00267 FLGR_MACRO_SET_DATA2D_VECTOR(fgUINT8);
00268 }
00269 void flgr2d_set_data_vector_fgUINT16(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00270 FLGR_MACRO_SET_DATA2D_VECTOR(fgUINT16);
00271 }
00272 void flgr2d_set_data_vector_fgUINT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00273 FLGR_MACRO_SET_DATA2D_VECTOR(fgUINT32);
00274 }
00275 void flgr2d_set_data_vector_fgINT8(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00276 FLGR_MACRO_SET_DATA2D_VECTOR(fgINT8);
00277 }
00278 void flgr2d_set_data_vector_fgINT16(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00279 FLGR_MACRO_SET_DATA2D_VECTOR(fgINT16);
00280 }
00281 void flgr2d_set_data_vector_fgINT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00282 FLGR_MACRO_SET_DATA2D_VECTOR(fgINT32);
00283 }
00284 void flgr2d_set_data_vector_fgFLOAT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00285 FLGR_MACRO_SET_DATA2D_VECTOR(fgFLOAT32);
00286 }
00287 void flgr2d_set_data_vector_fgFLOAT64(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00288 FLGR_MACRO_SET_DATA2D_VECTOR(fgFLOAT64);
00289 }
00291
00298
00299 FLGR_Ret flgr2d_set_data_vector(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00300
00301
00302 if((dat==NULL) || (vct==NULL)) {
00303 POST_ERROR("Null objects\n");
00304 return FLGR_RET_NULL_OBJECT;
00305 }
00306
00307 if(dat->spp != vct->spp) {
00308 POST_ERROR("Data and Vector don't have the same Samples Per Pixel\n");
00309 return FLGR_RET_UNDEFINED_ERROR;
00310 }
00311
00312 if((row<0) || (row>=dat->size_y)) {
00313 POST_WARNING("row position out of the array : %d!\n",row);
00314 return FLGR_RET_UNDEFINED_ERROR;
00315 }
00316
00317 if((col<0) || (col>=dat->size_x)) {
00318 POST_WARNING("row position out of the array : %d!\n",col);
00319 return FLGR_RET_UNDEFINED_ERROR;
00320 }
00321
00322
00323 FLGR_DISPATCH_PROCEDURE(dat->type,flgr2d_set_data_vector,dat,row,col,vct);
00324 }
00325
00326
00327
00328
00329
00331
00333 #define FLGR_MACRO_GET_DATA2D_VECTOR(dtype) \
00334 dtype *array_s; \
00335 dtype *array_d = (dtype*) (vct->array); \
00336 \
00337 \
00338 row = flgr_normalize_coordinate(row,dat->size_y); \
00339 col = flgr_normalize_coordinate(col,dat->size_x); \
00340 array_s = (dtype*) (dat->array[row]); \
00341 flgr_get_data_array_vector_##dtype(array_d, array_s, vct->spp, col)
00342
00343 void flgr2d_get_data_vector_fgBIT(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00344 FLGR_MACRO_GET_DATA2D_VECTOR(fgBIT);
00345 }
00346 void flgr2d_get_data_vector_fgUINT8(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00347 FLGR_MACRO_GET_DATA2D_VECTOR(fgUINT8);
00348 }
00349 void flgr2d_get_data_vector_fgUINT16(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00350 FLGR_MACRO_GET_DATA2D_VECTOR(fgUINT16);
00351 }
00352 void flgr2d_get_data_vector_fgUINT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00353 FLGR_MACRO_GET_DATA2D_VECTOR(fgUINT32);
00354 }
00355 void flgr2d_get_data_vector_fgINT8(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00356 FLGR_MACRO_GET_DATA2D_VECTOR(fgINT8);
00357 }
00358 void flgr2d_get_data_vector_fgINT16(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00359 FLGR_MACRO_GET_DATA2D_VECTOR(fgINT16);
00360 }
00361 void flgr2d_get_data_vector_fgINT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00362 FLGR_MACRO_GET_DATA2D_VECTOR(fgINT32);
00363 }
00364 void flgr2d_get_data_vector_fgFLOAT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00365 FLGR_MACRO_GET_DATA2D_VECTOR(fgFLOAT32);
00366 }
00367 void flgr2d_get_data_vector_fgFLOAT64(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00368 FLGR_MACRO_GET_DATA2D_VECTOR(fgFLOAT64);
00369 }
00371
00381
00382 FLGR_Ret flgr2d_get_data_vector(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00383
00384
00385 if((dat==NULL) || (vct==NULL)) {
00386 POST_ERROR("Null objects\n");
00387 return FLGR_RET_NULL_OBJECT;
00388 }
00389
00390 if(dat->spp != vct->spp) {
00391 POST_ERROR("Data and Vector don't have the same Samples Per Pixel\n");
00392 return FLGR_RET_UNDEFINED_ERROR;
00393 }
00394
00395 FLGR_DISPATCH_PROCEDURE(dat->type,flgr2d_get_data_vector,dat,row,col,vct);
00396 }
00397
00398
00399
00400
00401
00402
00404
00406 #define FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(dtype) \
00407 dtype *array_s = (dtype*) (dat->array[row]); \
00408 dtype *array_d = (dtype*) (vct->array); \
00409 \
00410 \
00411 flgr_get_data_array_vector_##dtype(array_d, array_s, vct->spp, col)
00412
00413 void flgr2d_get_data_vector_no_norm_fgBIT(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00414 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgBIT);
00415 }
00416 void flgr2d_get_data_vector_no_norm_fgUINT8(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00417 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgUINT8);
00418 }
00419 void flgr2d_get_data_vector_no_norm_fgUINT16(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00420 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgUINT16);
00421 }
00422 void flgr2d_get_data_vector_no_norm_fgUINT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00423 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgUINT32);
00424 }
00425 void flgr2d_get_data_vector_no_norm_fgINT8(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00426 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgINT8);
00427 }
00428 void flgr2d_get_data_vector_no_norm_fgINT16(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00429 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgINT16);
00430 }
00431 void flgr2d_get_data_vector_no_norm_fgINT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00432 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgINT32);
00433 }
00434 void flgr2d_get_data_vector_no_norm_fgFLOAT32(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00435 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgFLOAT32);
00436 }
00437 void flgr2d_get_data_vector_no_norm_fgFLOAT64(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00438 FLGR_MACRO_GET_DATA2D_VECTOR_NO_NORM(fgFLOAT64);
00439 }
00441
00448
00449 FLGR_Ret flgr2d_get_data_vector_no_norm(FLGR_Data2D *dat, int row, int col, FLGR_Vector *vct) {
00450
00451
00452 if((dat==NULL) || (vct==NULL)) {
00453 POST_ERROR("Null objects\n");
00454 return FLGR_RET_NULL_OBJECT;
00455 }
00456
00457 if(dat->spp != vct->spp) {
00458 POST_ERROR("Data and Vector don't have the same Samples Per Pixel\n");
00459 return FLGR_RET_UNDEFINED_ERROR;
00460 }
00461
00462 if((row<0) || (row>=dat->size_y)) {
00463 POST_WARNING("row position out of the array : %d!\n",row);
00464 return FLGR_RET_UNDEFINED_ERROR;
00465 }
00466
00467 if((col<0) || (col>=dat->size_x)) {
00468 POST_WARNING("column position out of the array : %d!\n",col);
00469 return FLGR_RET_UNDEFINED_ERROR;
00470 }
00471
00472 FLGR_DISPATCH_PROCEDURE(dat->type,flgr2d_get_data_vector_no_norm,dat,row,col,vct);
00473 }
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00488
00490 #define FLGR_MACRO_SET_DATA1D(dtype) \
00491 int k; \
00492 \
00493 \
00494 POST_WARNING("Deprecated\n"); \
00495 if(pos<0) { \
00496 POST_WARNING("position in 1D array is negative: %d!\n",pos); \
00497 return; \
00498 } \
00499 if(pos>=dat->length) { \
00500 POST_WARNING("position in 1D array is too large: %d!\n",pos); \
00501 return; \
00502 } \
00503 if(dat->spp < 1) { \
00504 POST_WARNING("Vector size could not < 1\n"); \
00505 return; \
00506 } \
00507 pos *= dat->spp; \
00508 for(k=0 ; k<dat->spp ; k++,value++) \
00509 flgr1d_set_data_array_##dtype(dat->array, pos+k, *value); \
00510 \
00511 return
00512
00513
00514 void flgr1d_set_data_fgBIT(FLGR_Data1D *dat, int pos, fgBIT *value) {
00515 FLGR_MACRO_SET_DATA1D(fgBIT);
00516 }
00517 void flgr1d_set_data_fgUINT8(FLGR_Data1D *dat, int pos, fgUINT8 *value) {
00518 FLGR_MACRO_SET_DATA1D(fgUINT8);
00519 }
00520 void flgr1d_set_data_fgUINT16(FLGR_Data1D *dat, int pos, fgUINT16 *value) {
00521 FLGR_MACRO_SET_DATA1D(fgUINT16);
00522 }
00523 void flgr1d_set_data_fgUINT32(FLGR_Data1D *dat, int pos, fgUINT32 *value) {
00524 FLGR_MACRO_SET_DATA1D(fgUINT32);
00525 }
00526 void flgr1d_set_data_fgINT8(FLGR_Data1D *dat, int pos, fgINT8 *value) {
00527 FLGR_MACRO_SET_DATA1D(fgINT8);
00528 }
00529 void flgr1d_set_data_fgINT16(FLGR_Data1D *dat, int pos, fgINT16 *value) {
00530 FLGR_MACRO_SET_DATA1D(fgINT16);
00531 }
00532 void flgr1d_set_data_fgINT32(FLGR_Data1D *dat, int pos, fgINT32 *value) {
00533 FLGR_MACRO_SET_DATA1D(fgINT32);
00534 }
00535 void flgr1d_set_data_fgFLOAT32(FLGR_Data1D *dat, int pos, fgFLOAT32 *value) {
00536 FLGR_MACRO_SET_DATA1D(fgFLOAT32);
00537 }
00538 void flgr1d_set_data_fgFLOAT64(FLGR_Data1D *dat, int pos, fgFLOAT64 *value) {
00539 FLGR_MACRO_SET_DATA1D(fgFLOAT64);
00540 }
00541
00543
00550
00551 FLGR_Ret flgr1d_set_data_ptr(FLGR_Data1D *dat, int pos, void *value) {
00552
00553
00554 if(dat==NULL) {
00555 POST_ERROR("Null objects!\n");
00556 return FLGR_RET_NULL_OBJECT;
00557 }
00558
00559 if(dat->type==FLGR_UINT8) {
00560 flgr1d_set_data_fgUINT8(dat,pos,(fgUINT8*) value);
00561
00562 }else if(dat->type==FLGR_UINT16) {
00563 flgr1d_set_data_fgUINT16(dat,pos,(fgUINT16*) value);
00564
00565 }else if(dat->type==FLGR_UINT32) {
00566 flgr1d_set_data_fgUINT32(dat,pos,(fgUINT32*) value);
00567
00568 }else if(dat->type==FLGR_INT8) {
00569 flgr1d_set_data_fgINT8(dat,pos,(fgINT8*) value);
00570
00571 }else if(dat->type==FLGR_INT16) {
00572 flgr1d_set_data_fgINT16(dat,pos,(fgINT16*) value);
00573
00574 }else if(dat->type==FLGR_INT32) {
00575 flgr1d_set_data_fgINT32(dat,pos,(fgINT32*) value);
00576
00577 }else if(dat->type==FLGR_FLOAT32) {
00578 flgr1d_set_data_fgFLOAT32(dat,pos,(fgFLOAT32*) value);
00579
00580 }else if(dat->type==FLGR_FLOAT64) {
00581 flgr1d_set_data_fgFLOAT64(dat,pos,(fgFLOAT64*) value);
00582
00583 }else if(dat->type==FLGR_BIT) {
00584 flgr1d_set_data_fgBIT(dat,pos,(fgBIT*) value);
00585
00586 }else {
00587 POST_ERROR("type unknown!\n");
00588 return FLGR_RET_TYPE_UNKNOWN;
00589 }
00590
00591 return FLGR_RET_OK;
00592 }
00593
00595
00601
00602 FLGR_Ret flgr1d_set_data_str(FLGR_Data1D *dat, int pos, char *value) {
00603 int sizeConst;
00604 void *val;
00605 FLGR_Ret ret;
00606
00607
00608
00609 if(dat==NULL) {
00610 POST_ERROR("Null objects!\n");
00611 return FLGR_RET_NULL_OBJECT;
00612 }
00613
00614 sizeConst = flgr_get_sizeof(dat->type);
00615 val = flgr_malloc(sizeConst*dat->spp);
00616
00617 ret = flgr_parse_str_constant(dat->type,dat->spp,value, val);
00618 if(ret!=FLGR_RET_OK) {
00619 flgr_free(val);
00620 return ret;
00621 }
00622
00623 ret = flgr1d_set_data_ptr(dat, pos, val);
00624
00625 flgr_free(val);
00626
00627 return ret;
00628 }
00629
00630
00631
00632
00633
00634
00636
00638 #define FLGR_MACRO_GET_DATA1D(dtype) \
00639 int k; \
00640 \
00641 \
00642 POST_WARNING("Deprecated\n"); \
00643 if(dat->spp < 1) { \
00644 POST_WARNING("Vector size could not < 1\n"); \
00645 return; \
00646 } \
00647 \
00648 pos = flgr_normalize_coordinate(pos,dat->length); \
00649 \
00650 pos *= dat->spp; \
00651 \
00652 for(k=0 ; k<dat->spp ; k++,value++) \
00653 *value = flgr1d_get_data_array_##dtype(dat->array, pos+k); \
00654 \
00655 \
00656 return
00657
00658 void flgr1d_get_data_fgBIT(FLGR_Data1D *dat, int pos, fgBIT *value) {
00659 FLGR_MACRO_GET_DATA1D(fgBIT);
00660 }
00661 void flgr1d_get_data_fgUINT8(FLGR_Data1D *dat, int pos, fgUINT8 *value) {
00662 FLGR_MACRO_GET_DATA1D(fgUINT8);
00663 }
00664 void flgr1d_get_data_fgUINT16(FLGR_Data1D *dat, int pos, fgUINT16 *value) {
00665 FLGR_MACRO_GET_DATA1D(fgUINT16);
00666 }
00667 void flgr1d_get_data_fgUINT32(FLGR_Data1D *dat, int pos, fgUINT32 *value) {
00668 FLGR_MACRO_GET_DATA1D(fgUINT32);
00669 }
00670 void flgr1d_get_data_fgINT8(FLGR_Data1D *dat, int pos, fgINT8 *value) {
00671 FLGR_MACRO_GET_DATA1D(fgINT8);
00672 }
00673 void flgr1d_get_data_fgINT16(FLGR_Data1D *dat, int pos, fgINT16 *value) {
00674 FLGR_MACRO_GET_DATA1D(fgINT16);
00675 }
00676 void flgr1d_get_data_fgINT32(FLGR_Data1D *dat, int pos, fgINT32 *value) {
00677 FLGR_MACRO_GET_DATA1D(fgINT32);
00678 }
00679 void flgr1d_get_data_fgFLOAT32(FLGR_Data1D *dat, int pos, fgFLOAT32 *value) {
00680 FLGR_MACRO_GET_DATA1D(fgFLOAT32);
00681 }
00682 void flgr1d_get_data_fgFLOAT64(FLGR_Data1D *dat, int pos, fgFLOAT64 *value) {
00683 FLGR_MACRO_GET_DATA1D(fgFLOAT64);
00684 }
00685
00687
00694
00695 FLGR_Ret flgr1d_get_data_ptr(FLGR_Data1D *dat, int pos, void *value) {
00696
00697
00698 if(dat==NULL) {
00699 POST_ERROR("Null objects!\n");
00700 return FLGR_RET_NULL_OBJECT;
00701 }
00702
00703 if(dat->type==FLGR_UINT8) {
00704 flgr1d_get_data_fgUINT8(dat,pos,(fgUINT8*) value);
00705
00706 }else if(dat->type==FLGR_UINT16) {
00707 flgr1d_get_data_fgUINT16(dat,pos,(fgUINT16*) value);
00708
00709 }else if(dat->type==FLGR_UINT32) {
00710 flgr1d_get_data_fgUINT32(dat,pos,(fgUINT32*) value);
00711
00712 }else if(dat->type==FLGR_INT8) {
00713 flgr1d_get_data_fgINT8(dat,pos,(fgINT8*) value);
00714
00715 }else if(dat->type==FLGR_INT16) {
00716 flgr1d_get_data_fgINT16(dat,pos,(fgINT16*) value);
00717
00718 }else if(dat->type==FLGR_INT32) {
00719 flgr1d_get_data_fgINT32(dat,pos,(fgINT32*) value);
00720
00721 }else if(dat->type==FLGR_FLOAT32) {
00722 flgr1d_get_data_fgFLOAT32(dat,pos,(fgFLOAT32*) value);
00723
00724 }else if(dat->type==FLGR_FLOAT64) {
00725 flgr1d_get_data_fgFLOAT64(dat,pos,(fgFLOAT64*) value);
00726
00727 }else if(dat->type==FLGR_BIT) {
00728 flgr1d_get_data_fgBIT(dat,pos,(fgBIT*) value);
00729
00730 }else {
00731 POST_ERROR("type unknown!\n");
00732 return FLGR_RET_TYPE_UNKNOWN;
00733 }
00734
00735 return FLGR_RET_OK;
00736 }
00737
00738
00739
00740
00742
00744 #define FLGR_MACRO_GET_DATA1D_NO_NORM(dtype) \
00745 int k; \
00746 \
00747 \
00748 POST_WARNING("Deprecated\n"); \
00749 \
00750 if(pos<0) { \
00751 POST_WARNING("value out of the array : %d!\n",pos); \
00752 return; \
00753 } \
00754 if(pos>=dat->length) { \
00755 POST_WARNING("value out of the array : %d!\n",pos); \
00756 return; \
00757 } \
00758 pos *= dat->spp; \
00759 \
00760 for(k=0 ; k<dat->spp ; k++,value++) \
00761 *value = flgr1d_get_data_array_##dtype(dat->array, pos+k); \
00762
00763
00764 void flgr1d_get_data_no_norm_fgBIT(FLGR_Data1D *dat, int pos, fgBIT *value) {
00765 FLGR_MACRO_GET_DATA1D_NO_NORM(fgBIT);
00766 }
00767 void flgr1d_get_data_no_norm_fgUINT8(FLGR_Data1D *dat, int pos, fgUINT8 *value) {
00768 FLGR_MACRO_GET_DATA1D_NO_NORM(fgUINT8);
00769 }
00770 void flgr1d_get_data_no_norm_fgUINT16(FLGR_Data1D *dat, int pos, fgUINT16 *value) {
00771 FLGR_MACRO_GET_DATA1D_NO_NORM(fgUINT16);
00772 }
00773 void flgr1d_get_data_no_norm_fgUINT32(FLGR_Data1D *dat, int pos, fgUINT32 *value) {
00774 FLGR_MACRO_GET_DATA1D_NO_NORM(fgUINT32);
00775 }
00776 void flgr1d_get_data_no_norm_fgINT8(FLGR_Data1D *dat, int pos, fgINT8 *value) {
00777 FLGR_MACRO_GET_DATA1D_NO_NORM(fgINT8);
00778 }
00779 void flgr1d_get_data_no_norm_fgINT16(FLGR_Data1D *dat, int pos, fgINT16 *value) {
00780 FLGR_MACRO_GET_DATA1D_NO_NORM(fgINT16);
00781 }
00782 void flgr1d_get_data_no_norm_fgINT32(FLGR_Data1D *dat, int pos, fgINT32 *value) {
00783 FLGR_MACRO_GET_DATA1D_NO_NORM(fgINT32);
00784 }
00785 void flgr1d_get_data_no_norm_fgFLOAT32(FLGR_Data1D *dat, int pos, fgFLOAT32 *value) {
00786 FLGR_MACRO_GET_DATA1D_NO_NORM(fgFLOAT32);
00787 }
00788 void flgr1d_get_data_no_norm_fgFLOAT64(FLGR_Data1D *dat, int pos, fgFLOAT64 *value) {
00789 FLGR_MACRO_GET_DATA1D_NO_NORM(fgFLOAT64);
00790 }
00791
00793
00799
00800 FLGR_Ret flgr1d_get_data_no_norm_ptr(FLGR_Data1D *dat, int pos, void *value) {
00801
00802
00803 if(dat==NULL) {
00804 POST_ERROR("Null objects!\n");
00805 return FLGR_RET_NULL_OBJECT;
00806 }
00807
00808 if(dat->type==FLGR_UINT8) {
00809 flgr1d_get_data_no_norm_fgUINT8(dat,pos,(fgUINT8*) value);
00810
00811 }else if(dat->type==FLGR_UINT16) {
00812 flgr1d_get_data_no_norm_fgUINT16(dat,pos,(fgUINT16*) value);
00813
00814 }else if(dat->type==FLGR_UINT32) {
00815 flgr1d_get_data_no_norm_fgUINT32(dat,pos,(fgUINT32*) value);
00816
00817 }else if(dat->type==FLGR_INT8) {
00818 flgr1d_get_data_no_norm_fgINT8(dat,pos,(fgINT8*) value);
00819
00820 }else if(dat->type==FLGR_INT16) {
00821 flgr1d_get_data_no_norm_fgINT16(dat,pos,(fgINT16*) value);
00822
00823 }else if(dat->type==FLGR_INT32) {
00824 flgr1d_get_data_no_norm_fgINT32(dat,pos,(fgINT32*) value);
00825
00826 }else if(dat->type==FLGR_FLOAT32) {
00827 flgr1d_get_data_no_norm_fgFLOAT32(dat,pos,(fgFLOAT32*) value);
00828
00829 }else if(dat->type==FLGR_FLOAT64) {
00830 flgr1d_get_data_no_norm_fgFLOAT64(dat,pos,(fgFLOAT64*) value);
00831
00832 }else if(dat->type==FLGR_BIT) {
00833 flgr1d_get_data_no_norm_fgBIT(dat,pos,(fgBIT*) value);
00834
00835 }else {
00836 POST_ERROR("type unknown!\n");
00837 return FLGR_RET_TYPE_UNKNOWN;
00838 }
00839
00840 return FLGR_RET_OK;
00841 }
00842
00843
00844
00845
00846
00847
00848
00849
00850
00852
00854 #define FLGR_MACRO_SET_DATA2D(dtype) \
00855 int k; \
00856 dtype **array = (dtype **) dat->array; \
00857 \
00858 \
00859 \
00860 POST_WARNING("Deprecated\n"); \
00861 \
00862 if(row<0) { \
00863 POST_WARNING("row value out of the array (row=%d)!\n",row); \
00864 return; \
00865 } \
00866 if(col<0) { \
00867 POST_WARNING("row value out of the array (column=%d)!\n",col); \
00868 return; \
00869 } \
00870 if(row>=dat->size_y) { \
00871 POST_WARNING("row value out of the array (row=%d)!\n",row); \
00872 return; \
00873 } \
00874 if(col>=dat->size_x) { \
00875 POST_WARNING("row value out of the array (column=%d)!\n",col); \
00876 return; \
00877 } \
00878 if(dat->spp < 1) { \
00879 POST_WARNING("Vector size could not < 1\n"); \
00880 return; \
00881 } \
00882 \
00883 col *= dat->spp; \
00884 for(k=0 ; k<dat->spp ; k++,value++) \
00885 flgr2d_set_data_array_##dtype(array, row,col+k, *value); \
00886 \
00887 return
00888
00889
00890 void flgr2d_set_data_fgBIT(FLGR_Data2D *dat, int row, int col, fgBIT *value) {
00891 FLGR_MACRO_SET_DATA2D(fgBIT);
00892 }
00893 void flgr2d_set_data_fgUINT8(FLGR_Data2D *dat, int row, int col, fgUINT8 *value) {
00894 FLGR_MACRO_SET_DATA2D(fgUINT8);
00895 }
00896 void flgr2d_set_data_fgUINT16(FLGR_Data2D *dat, int row, int col, fgUINT16 *value) {
00897 FLGR_MACRO_SET_DATA2D(fgUINT16);
00898 }
00899 void flgr2d_set_data_fgUINT32(FLGR_Data2D *dat, int row, int col, fgUINT32 *value) {
00900 FLGR_MACRO_SET_DATA2D(fgUINT32);
00901 }
00902 void flgr2d_set_data_fgINT8(FLGR_Data2D *dat, int row, int col, fgINT8 *value) {
00903 FLGR_MACRO_SET_DATA2D(fgINT8);
00904 }
00905 void flgr2d_set_data_fgINT16(FLGR_Data2D *dat, int row, int col, fgINT16 *value) {
00906 FLGR_MACRO_SET_DATA2D(fgINT16);
00907 }
00908 void flgr2d_set_data_fgINT32(FLGR_Data2D *dat, int row, int col, fgINT32 *value) {
00909 FLGR_MACRO_SET_DATA2D(fgINT32);
00910 }
00911 void flgr2d_set_data_fgFLOAT32(FLGR_Data2D *dat, int row, int col, fgFLOAT32 *value) {
00912 FLGR_MACRO_SET_DATA2D(fgFLOAT32);
00913 }
00914 void flgr2d_set_data_fgFLOAT64(FLGR_Data2D *dat, int row, int col, fgFLOAT64 *value) {
00915 FLGR_MACRO_SET_DATA2D(fgFLOAT64);
00916 }
00917
00918
00920
00927
00928 FLGR_Ret flgr2d_set_data_ptr(FLGR_Data2D *dat, int row, int col, void *value) {
00929
00930
00931 if(dat==NULL) {
00932 POST_ERROR("Null objects!\n");
00933 return FLGR_RET_NULL_OBJECT;
00934 }
00935
00936 if(dat->type==FLGR_UINT8) {
00937 flgr2d_set_data_fgUINT8(dat,row,col,(fgUINT8*) value);
00938
00939 }else if(dat->type==FLGR_UINT16) {
00940 flgr2d_set_data_fgUINT16(dat,row,col,(fgUINT16*) value);
00941
00942 }else if(dat->type==FLGR_UINT32) {
00943 flgr2d_set_data_fgUINT32(dat,row,col,(fgUINT32*) value);
00944
00945 }else if(dat->type==FLGR_INT8) {
00946 flgr2d_set_data_fgINT8(dat,row,col,(fgINT8*) value);
00947
00948 }else if(dat->type==FLGR_INT16) {
00949 flgr2d_set_data_fgINT16(dat,row,col,(fgINT16*) value);
00950
00951 }else if(dat->type==FLGR_INT32) {
00952 flgr2d_set_data_fgINT32(dat,row,col,(fgINT32*) value);
00953
00954 }else if(dat->type==FLGR_FLOAT32) {
00955 flgr2d_set_data_fgFLOAT32(dat,row,col,(fgFLOAT32*) value);
00956
00957 }else if(dat->type==FLGR_FLOAT64) {
00958 flgr2d_set_data_fgFLOAT64(dat,row,col,(fgFLOAT64*) value);
00959
00960 }else if(dat->type==FLGR_BIT) {
00961 flgr2d_set_data_fgBIT(dat,row,col,(fgBIT*) value);
00962
00963 }else {
00964 POST_ERROR("type unknown!\n");
00965 return FLGR_RET_TYPE_UNKNOWN;
00966 }
00967
00968 return FLGR_RET_OK;
00969
00970 }
00971
00972
00974
00981
00982 FLGR_Ret flgr2d_set_data_str(FLGR_Data2D *dat, int row, int col, char *value) {
00983 int sizeConst;
00984 void *val;
00985 FLGR_Ret ret;
00986
00987 if(dat==NULL) {
00988 POST_ERROR("Null objects!\n");
00989 return FLGR_RET_NULL_OBJECT;
00990 }
00991
00992 sizeConst = flgr_get_sizeof(dat->type);
00993 val = flgr_malloc(sizeConst*dat->spp);
00994
00995 ret = flgr_parse_str_constant(dat->type,dat->spp,value, val);
00996 if(ret!=FLGR_RET_OK) {
00997 flgr_free(val);
00998 return ret;
00999 }
01000
01001 ret = flgr2d_set_data_ptr(dat, row, col, val);
01002
01003 flgr_free(val);
01004
01005 return ret;
01006 }
01007
01008
01009
01010
01011
01012
01014
01016 #define FLGR_MACRO_GET_DATA2D(dtype) \
01017 int k; \
01018 dtype **array = (dtype**) dat->array; \
01019 \
01020 \
01021 \
01022 \
01023 POST_WARNING("Deprecated\n"); \
01024 \
01025 if(dat->spp < 1) { \
01026 POST_WARNING("Vector size could not < 1\n"); \
01027 return; \
01028 } \
01029 \
01030 row = flgr_normalize_coordinate(row,dat->size_y); \
01031 col = flgr_normalize_coordinate(col,dat->size_x); \
01032 \
01033 col *= dat->spp; \
01034 \
01035 for(k=0 ; k<dat->spp ; k++,value++) \
01036 *value = flgr2d_get_data_array_##dtype(array,row,col+k); \
01037 \
01038
01039 void flgr2d_get_data_fgBIT(FLGR_Data2D *dat, int row, int col, fgBIT *value) {
01040 FLGR_MACRO_GET_DATA2D(fgBIT);
01041 }
01042 void flgr2d_get_data_fgUINT8(FLGR_Data2D *dat, int row, int col, fgUINT8 *value) {
01043 FLGR_MACRO_GET_DATA2D(fgUINT8);
01044 }
01045 void flgr2d_get_data_fgUINT16(FLGR_Data2D *dat, int row, int col, fgUINT16 *value) {
01046 FLGR_MACRO_GET_DATA2D(fgUINT16);
01047 }
01048 void flgr2d_get_data_fgUINT32(FLGR_Data2D *dat, int row, int col, fgUINT32 *value) {
01049 FLGR_MACRO_GET_DATA2D(fgUINT32);
01050 }
01051 void flgr2d_get_data_fgINT8(FLGR_Data2D *dat, int row, int col, fgINT8 *value) {
01052 FLGR_MACRO_GET_DATA2D(fgINT8);
01053 }
01054 void flgr2d_get_data_fgINT16(FLGR_Data2D *dat, int row, int col, fgINT16 *value) {
01055 FLGR_MACRO_GET_DATA2D(fgINT16);
01056 }
01057 void flgr2d_get_data_fgINT32(FLGR_Data2D *dat, int row, int col, fgINT32 *value) {
01058 FLGR_MACRO_GET_DATA2D(fgINT32);
01059 }
01060 void flgr2d_get_data_fgFLOAT32(FLGR_Data2D *dat, int row, int col, fgFLOAT32 *value) {
01061 FLGR_MACRO_GET_DATA2D(fgFLOAT32);
01062 }
01063 void flgr2d_get_data_fgFLOAT64(FLGR_Data2D *dat, int row, int col, fgFLOAT64 *value) {
01064 FLGR_MACRO_GET_DATA2D(fgFLOAT64);
01065 }
01066
01068
01075
01076 FLGR_Ret flgr2d_get_data_ptr(FLGR_Data2D *dat, int row, int col, void *value) {
01077
01078
01079 if(dat==NULL) {
01080 POST_ERROR("Null objects!\n");
01081 return FLGR_RET_NULL_OBJECT;
01082 }
01083
01084 if(dat->type==FLGR_UINT8) {
01085 flgr2d_get_data_fgUINT8(dat,row,col,((fgUINT8*) value));
01086
01087 }else if(dat->type==FLGR_UINT16) {
01088 flgr2d_get_data_fgUINT16(dat,row,col,((fgUINT16*) value));
01089
01090 }else if(dat->type==FLGR_UINT32) {
01091 flgr2d_get_data_fgUINT32(dat,row,col,((fgUINT32*) value));
01092
01093 }else if(dat->type==FLGR_INT8) {
01094 flgr2d_get_data_fgINT8(dat,row,col,((fgINT8*) value));
01095
01096 }else if(dat->type==FLGR_INT16) {
01097 flgr2d_get_data_fgINT16(dat,row,col,((fgINT16*) value));
01098
01099 }else if(dat->type==FLGR_INT32) {
01100 flgr2d_get_data_fgINT32(dat,row,col,((fgINT32*) value));
01101
01102 }else if(dat->type==FLGR_FLOAT32) {
01103 flgr2d_get_data_fgFLOAT32(dat,row,col,((fgFLOAT32*) value));
01104
01105 }else if(dat->type==FLGR_FLOAT64) {
01106 flgr2d_get_data_fgFLOAT64(dat,row,col,((fgFLOAT64*) value));
01107
01108 }else if(dat->type==FLGR_BIT) {
01109 flgr2d_get_data_fgBIT(dat,row,col,((fgBIT*) value));
01110
01111 }else {
01112 POST_ERROR("type unknown!\n");
01113 return FLGR_RET_TYPE_UNKNOWN;
01114 }
01115
01116 return FLGR_RET_OK;
01117 }
01118
01119
01120
01122
01124 #define FLGR_MACRO_GET_DATA2D_NO_NORM(dtype) \
01125 int k; \
01126 dtype **array = (dtype**) dat->array; \
01127 \
01128 \
01129 \
01130 \
01131 POST_WARNING("Deprecated\n"); \
01132 \
01133 if(row<0) { \
01134 POST_WARNING("row value out of the array (row=%d)!\n",row); \
01135 return; \
01136 } \
01137 if(col<0) { \
01138 POST_WARNING("row value out of the array (column=%d)!\n",col); \
01139 return; \
01140 } \
01141 if(row>=dat->size_y) { \
01142 POST_WARNING("row value out of the array (row=%d)!\n",row); \
01143 return; \
01144 } \
01145 if(col>=dat->size_x) { \
01146 POST_WARNING("row value out of the array (column=%d)!\n",col); \
01147 return; \
01148 } \
01149 if(dat->spp < 1) { \
01150 POST_WARNING("Vector size could not < 1\n"); \
01151 return; \
01152 } \
01153 \
01154 col *= dat->spp; \
01155 \
01156 for(k=0 ; k<dat->spp ; k++,value++) \
01157 *value = flgr2d_get_data_array_##dtype(array,row,col+k); \
01158 \
01159 return
01160
01161
01162 void flgr2d_get_data_no_norm_fgBIT(FLGR_Data2D *dat, int row, int col, fgBIT *value) {
01163 FLGR_MACRO_GET_DATA2D_NO_NORM(fgBIT);
01164 }
01165 void flgr2d_get_data_no_norm_fgUINT8(FLGR_Data2D *dat, int row, int col, fgUINT8 *value) {
01166 FLGR_MACRO_GET_DATA2D_NO_NORM(fgUINT8);
01167 }
01168 void flgr2d_get_data_no_norm_fgUINT16(FLGR_Data2D *dat, int row, int col, fgUINT16 *value) {
01169 FLGR_MACRO_GET_DATA2D_NO_NORM(fgUINT16);
01170 }
01171 void flgr2d_get_data_no_norm_fgUINT32(FLGR_Data2D *dat, int row, int col, fgUINT32 *value) {
01172 FLGR_MACRO_GET_DATA2D_NO_NORM(fgUINT32);
01173 }
01174 void flgr2d_get_data_no_norm_fgINT8(FLGR_Data2D *dat, int row, int col, fgINT8 *value) {
01175 FLGR_MACRO_GET_DATA2D_NO_NORM(fgINT8);
01176 }
01177 void flgr2d_get_data_no_norm_fgINT16(FLGR_Data2D *dat, int row, int col, fgINT16 *value) {
01178 FLGR_MACRO_GET_DATA2D_NO_NORM(fgINT16);
01179 }
01180 void flgr2d_get_data_no_norm_fgINT32(FLGR_Data2D *dat, int row, int col, fgINT32 *value) {
01181 FLGR_MACRO_GET_DATA2D_NO_NORM(fgINT32);
01182 }
01183 void flgr2d_get_data_no_norm_fgFLOAT32(FLGR_Data2D *dat, int row, int col, fgFLOAT32 *value) {
01184 FLGR_MACRO_GET_DATA2D_NO_NORM(fgFLOAT32);
01185 }
01186 void flgr2d_get_data_no_norm_fgFLOAT64(FLGR_Data2D *dat, int row, int col, fgFLOAT64 *value) {
01187 FLGR_MACRO_GET_DATA2D_NO_NORM(fgFLOAT64);
01188 }
01189
01191
01198
01199 FLGR_Ret flgr2d_get_data_no_norm_ptr(FLGR_Data2D *dat, int row, int col, void *value) {
01200
01201
01202 if(dat==NULL) {
01203 POST_ERROR("Null objects!\n");
01204 return FLGR_RET_NULL_OBJECT;
01205 }
01206
01207 if(dat->type==FLGR_UINT8) {
01208 flgr2d_get_data_no_norm_fgUINT8(dat,row,col,((fgUINT8*) value));
01209
01210 }else if(dat->type==FLGR_UINT16) {
01211 flgr2d_get_data_no_norm_fgUINT16(dat,row,col,((fgUINT16*) value));
01212
01213 }else if(dat->type==FLGR_UINT32) {
01214 flgr2d_get_data_no_norm_fgUINT32(dat,row,col,((fgUINT32*) value));
01215
01216 }else if(dat->type==FLGR_INT8) {
01217 flgr2d_get_data_no_norm_fgINT8(dat,row,col,((fgINT8*) value));
01218
01219 }else if(dat->type==FLGR_INT16) {
01220 flgr2d_get_data_no_norm_fgINT16(dat,row,col,((fgINT16*) value));
01221
01222 }else if(dat->type==FLGR_INT32) {
01223 flgr2d_get_data_no_norm_fgINT32(dat,row,col,((fgINT32*) value));
01224
01225 }else if(dat->type==FLGR_FLOAT32) {
01226 flgr2d_get_data_no_norm_fgFLOAT32(dat,row,col,((fgFLOAT32*) value));
01227
01228 }else if(dat->type==FLGR_FLOAT64) {
01229 flgr2d_get_data_no_norm_fgFLOAT64(dat,row,col,((fgFLOAT64*) value));
01230
01231 }else if(dat->type==FLGR_BIT) {
01232 flgr2d_get_data_no_norm_fgBIT(dat,row,col,((fgBIT*) value));
01233
01234 }else {
01235 POST_ERROR("type unknown!\n");
01236 return FLGR_RET_TYPE_UNKNOWN;
01237 }
01238
01239 return FLGR_RET_OK;
01240 }
01241
01242
01243
01244
01245
01246