Changeset 826 for soft/giet_vm/applications/rosenfeld/nrc2/src/nrmem2.c
- Timestamp:
- Jul 13, 2017, 11:01:58 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/src/nrmem2.c
r772 r826 28 28 /* 29 29 * ------------------ 30 * --- du b_matrix ---30 * --- dup_matrix --- 31 31 * ------------------ 32 32 */ 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) \ 37 void 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 } \ 41 42 } 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 44 dup_type_matrix(int8_t); 45 dup_type_matrix(uint8_t); 46 dup_type_matrix(int16_t); 47 dup_type_matrix(uint16_t); 48 dup_type_matrix(int32_t); 49 dup_type_matrix(uint32_t); 50 dup_type_matrix(int64_t); 51 dup_type_matrix(uint64_t); 52 dup_type_matrix(float); 53 dup_type_matrix(double); 54 dup_type_matrix(rgb8); 55 dup_type_matrix(rgbx8); 56 57 141 58 /* 142 59 * -------------- … … 144 61 * -------------- 145 62 */ 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) \ 66 void 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 } \ 318 72 } 319 73 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 } 74 resize_type_matrix(int8_t); 75 resize_type_matrix(uint8_t); 76 resize_type_matrix(int16_t); 77 resize_type_matrix(uint16_t); 78 resize_type_matrix(int32_t); 79 resize_type_matrix(uint32_t); 80 resize_type_matrix(int64_t); 81 resize_type_matrix(uint64_t); 82 resize_type_matrix(float); 83 resize_type_matrix(double); 84 resize_type_matrix(rgb8); 85 resize_type_matrix(rgbx8); 86 87 88 89 /* ---------------- */ 90 /* -- Conversion -- */ 91 /* ---------------- */ 92 93 #undef convert_type_matrix 94 #define convert_type_matrix(t1,t2) \ 95 void 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 } \ 328 100 } 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 102 convert_type_matrix(int8_t,int16_t); 103 convert_type_matrix(int8_t,int32_t); 104 convert_type_matrix(int8_t,float); 105 convert_type_matrix(int8_t,double); 106 convert_type_matrix(uint8_t,uint16_t); 107 convert_type_matrix(uint8_t,uint32_t); 108 convert_type_matrix(uint8_t,float); 109 convert_type_matrix(uint8_t,double); 110 convert_type_matrix(uint8_t,rgb8); 111 convert_type_matrix(uint8_t,rgbx8); 112 convert_type_matrix(int16_t,int32_t); 113 convert_type_matrix(int16_t,float); 114 convert_type_matrix(int16_t,double); 115 convert_type_matrix(uint16_t,uint32_t); 116 convert_type_matrix(uint16_t,float); 117 convert_type_matrix(uint16_t,double); 118 convert_type_matrix(int32_t,float); 119 convert_type_matrix(int32_t,double); 120 convert_type_matrix(uint32_t,float); 121 convert_type_matrix(uint32_t,double); 122 123 convert_type_matrix(int16_t,int8_t); 124 convert_type_matrix(uint16_t,uint8_t); 125 convert_type_matrix(int32_t,int8_t); 126 convert_type_matrix(uint32_t,uint8_t); 127 convert_type_matrix(int32_t,int16_t); 128 convert_type_matrix(uint32_t,uint16_t); 129 convert_type_matrix(float,int8_t); 130 convert_type_matrix(float,uint8_t); 131 convert_type_matrix(float,int16_t); 132 convert_type_matrix(float,uint16_t); 133 convert_type_matrix(float,int32_t); 134 convert_type_matrix(float,uint32_t); 135 convert_type_matrix(double,int8_t); 136 convert_type_matrix(double,uint8_t); 137 convert_type_matrix(double,int16_t); 138 convert_type_matrix(double,uint16_t); 139 convert_type_matrix(double,int32_t); 140 convert_type_matrix(double,uint32_t); 141 convert_type_matrix(double,float); 142 convert_type_matrix(rgb8,uint8_t); 143 144 595 145 /* 596 146 * ---------------------- … … 598 148 * ---------------------- 599 149 */ 600 /* ------------------------------------------------------------------------------------------------------ */ 601 IMAGE_EXPORT(void) lowpart_ui16matrix_ui8matrix(uint16 **X, long nrl,long nrh,long ncl, long nch, uint8 **Y) 602 /* ------------------------------------------------------------------------------------------------------ */ 150 151 void lowpart_ui16matrix_ui8matrix(uint16_t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8_t ** Y) 603 152 { 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 } 609 156 } 610 /* ---------------------------------------------------------------------------------------- */ 611 void lowpart_ui32matrix_ui8matrix(uint32 **X, long nrl,long nrh,long ncl, long nch, uint8 **Y) 612 /* ---------------------------------------------------------------------------------------- */ 157 158 void lowpart_ui32matrix_ui8matrix(uint32_t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8_t ** Y) 613 159 { 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 } 618 163 } 164 619 165 /* 620 166 * ------------------- … … 622 168 * ------------------- 623 169 */ 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 171 void 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) 627 172 { 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++) { 632 175 split_rgb8vector(X[i], ncl, nch, R[i], G[i], B[i]); 633 634 176 } 177 } 635 178 } 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 180 void 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) 639 181 { 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++) { 644 184 merge_rgb8vector(R[i], G[i], B[i], ncl, nch, X[i]); 645 646 185 } 186 } 647 187 } 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.