00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <string.h>
00024 #include <math.h>
00025 #include <flgrCoreDataIO.h>
00026 #include <flgrCoreDispatch.h>
00027 #include "flgrImageColorSpace.h"
00028
00029
00030
00031
00032
00033
00046
00047
00048
00049
00050
00051 #define FLGR_MACRO_CONVERT1D_YUV_RGB_UNSIGNED(dtype,fdtype) \
00052 dtype *pdest = datdest->array; \
00053 dtype *psrc = datsrc->array; \
00054 fdtype tR,tG,tB,tmp; \
00055 int i; \
00056 \
00057 for(i=0 ; i<datdest->length*3 ; i+=3) { \
00058 tR = (fdtype) flgr1d_get_data_array_##dtype(psrc,i); \
00059 tG = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+1); \
00060 tB = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+2); \
00061 \
00062 tmp = 0.299*tR + 0.597*tG + 0.114*tB; \
00063 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00064 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00065 flgr1d_set_data_array_##dtype(pdest,i,(dtype) tmp); \
00066 \
00067 tmp = -0.14713*tR - 0.28886*tG + 0.436*tB; \
00068 tmp += 0.436*MAX_##dtype; \
00069 tmp /= (0.436*2); \
00070 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00071 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00072 flgr1d_set_data_array_##dtype(pdest,i+1,(dtype) tmp); \
00073 \
00074 tmp = 0.615*tR - 0.51499*tG - 0.10001*tB; \
00075 tmp += 0.615*MAX_##dtype; \
00076 tmp /= (0.615*2); \
00077 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00078 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00079 flgr1d_set_data_array_##dtype(pdest,i+2,(dtype) tmp); \
00080 \
00081 } \
00082 return
00083
00084 #define FLGR_MACRO_CONVERT1D_YUV_RGB_SIGNED(dtype,fdtype) \
00085 dtype *pdest = datdest->array; \
00086 dtype *psrc = datsrc->array; \
00087 fdtype tR,tG,tB,tmp; \
00088 int i; \
00089 \
00090 for(i=0 ; i<datdest->length*3 ; i+=3) { \
00091 tR = (fdtype) flgr1d_get_data_array_##dtype(psrc,i); \
00092 tG = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+1); \
00093 tB = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+2); \
00094 \
00095 tmp = 0.299*tR + 0.597*tG + 0.114*tB; \
00096 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00097 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00098 flgr1d_set_data_array_##dtype(pdest,i,(dtype) tmp); \
00099 \
00100 tmp = -0.14713*tR - 0.28886*tG + 0.436*tB; \
00101 tmp /= (0.436*2); \
00102 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00103 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00104 flgr1d_set_data_array_##dtype(pdest,i+1,(dtype) tmp); \
00105 \
00106 tmp = 0.615*tR - 0.51499*tG - 0.10001*tB; \
00107 tmp /= (0.615*2); \
00108 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00109 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00110 flgr1d_set_data_array_##dtype(pdest,i+2,(dtype) tmp); \
00111 \
00112 } \
00113 return
00114
00115 #define FLGR_MACRO_CONVERT1D_YUV_RGB_FLOAT(dtype,fdtype) \
00116 dtype *pdest = datdest->array; \
00117 dtype *psrc = datsrc->array; \
00118 fdtype tR,tG,tB,tmp; \
00119 int i; \
00120 \
00121 for(i=0 ; i<datdest->length*3 ; i+=3) { \
00122 tR = (fdtype) flgr1d_get_data_array_##dtype(psrc,i); \
00123 tG = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+1); \
00124 tB = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+2); \
00125 \
00126 tmp = 0.299*tR + 0.597*tG + 0.114*tB; \
00127 flgr1d_set_data_array_##dtype(pdest,i,(dtype) tmp); \
00128 \
00129 tmp = -0.14713*tR - 0.28886*tG + 0.436*tB; \
00130 flgr1d_set_data_array_##dtype(pdest,i+1,(dtype) tmp); \
00131 \
00132 tmp = 0.615*tR - 0.51499*tG - 0.10001*tB; \
00133 flgr1d_set_data_array_##dtype(pdest,i+2,(dtype) tmp); \
00134 \
00135 } \
00136 return
00137
00138
00139 void flgr1d_color_convert_YUV_RGB_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00140 flgr_no_define_type_function(FLGR_BIT);
00141 }
00142
00143 void flgr1d_color_convert_YUV_RGB_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00144 fgUINT8 *pdest = datdest->array;
00145 fgUINT8 *psrc = datsrc->array;
00146 fgINT16 tR,tG,tB,tmp;
00147 int i;
00148
00149 for(i=0 ; i<datdest->length*3 ; i+=3) {
00150 tR = (fgINT16) flgr1d_get_data_array_fgUINT8(psrc,i);
00151 tG = (fgINT16) flgr1d_get_data_array_fgUINT8(psrc,i+1);
00152 tB = (fgINT16) flgr1d_get_data_array_fgUINT8(psrc,i+2);
00153
00154 tmp = ((66*tR + 129*tG + 25*tB + 128) >> 8) + 16;
00155 flgr1d_set_data_array_fgUINT8(pdest,i,(fgUINT8) tmp);
00156
00157 tmp = ((-38*tR - 74*tG + 112*tB + 128) >> 8) + 128;
00158 flgr1d_set_data_array_fgUINT8(pdest,i+1,(fgUINT8) tmp);
00159
00160 tmp = ((112*tR - 94*tG - 18*tB + 128) >> 8) + 128;
00161 flgr1d_set_data_array_fgUINT8(pdest,i+2,(fgUINT8) tmp);
00162
00163 }
00164 }
00165
00166 void flgr1d_color_convert_YUV_RGB_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00167 FLGR_MACRO_CONVERT1D_YUV_RGB_UNSIGNED(fgUINT16,fgFLOAT32);
00168 }
00169
00170 void flgr1d_color_convert_YUV_RGB_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00171 FLGR_MACRO_CONVERT1D_YUV_RGB_UNSIGNED(fgUINT32,fgFLOAT32);
00172 }
00173
00174 void flgr1d_color_convert_YUV_RGB_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00175 FLGR_MACRO_CONVERT1D_YUV_RGB_SIGNED(fgINT8,fgFLOAT32);
00176 }
00177
00178 void flgr1d_color_convert_YUV_RGB_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00179 FLGR_MACRO_CONVERT1D_YUV_RGB_SIGNED(fgINT16,fgFLOAT32);
00180 }
00181
00182 void flgr1d_color_convert_YUV_RGB_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00183 FLGR_MACRO_CONVERT1D_YUV_RGB_SIGNED(fgINT32,fgFLOAT32);
00184 }
00185
00186 void flgr1d_color_convert_YUV_RGB_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00187 FLGR_MACRO_CONVERT1D_YUV_RGB_FLOAT(fgFLOAT32,fgFLOAT32);
00188 }
00189
00190 void flgr1d_color_convert_YUV_RGB_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00191 FLGR_MACRO_CONVERT1D_YUV_RGB_FLOAT(fgFLOAT64,fgFLOAT64);
00192 }
00193
00195
00254
00255 FLGR_Ret flgr1d_color_convert_YUV_RGB(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00256 FLGR_Ret ret;
00257
00258 if((datdest==NULL) || (datsrc==NULL)) {
00259 POST_ERROR("Null objects!\n");
00260 return FLGR_RET_NULL_OBJECT;
00261 }
00262
00263 if((ret = flgr1d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00264
00265 if(datdest->spp != 3) {
00266 POST_ERROR("Bad sample per pixel in source or destination\n");
00267 return FLGR_RET_PARAM_ERROR;
00268 }
00269
00270 FLGR_DISPATCH_PROCEDURE(datsrc->type,flgr1d_color_convert_YUV_RGB,datdest,datsrc);
00271
00272 }
00273
00274
00275
00276
00277
00278 #define FLGR_MACRO_CONVERT1D_RGB_YUV_UNSIGNED(dtype,fdtype) \
00279 dtype *psrc = datsrc->array; \
00280 dtype *pdest = datdest->array; \
00281 \
00282 fdtype tY,tU,tV,tD,tE,tmp; \
00283 \
00284 int i; \
00285 \
00286 for(i=0 ; i<datdest->length*3 ; i+=3) { \
00287 tY = (fdtype) flgr1d_get_data_array_##dtype(psrc,i); \
00288 tU = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+1); \
00289 tV = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+2); \
00290 tD = tU*(0.436*2) - 0.436*MAX_##dtype; \
00291 tE = tV*(0.615*2) - 0.615*MAX_##dtype; \
00292 \
00293 tmp = tY - 0.00004*tD + 1.13983*tE; \
00294 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00295 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00296 flgr1d_set_data_array_##dtype(pdest,i,(dtype) tmp); \
00297 \
00298 tmp = tY - 0.39465*tD - 0.58060*tE; \
00299 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00300 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00301 flgr1d_set_data_array_##dtype(pdest,i+1,(dtype) tmp); \
00302 \
00303 tmp = tY + 2.03211*tD - 0.0005*tE; \
00304 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00305 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00306 flgr1d_set_data_array_##dtype(pdest,i+2,(dtype) tmp); \
00307 \
00308 } \
00309 return
00310
00311 #define FLGR_MACRO_CONVERT1D_RGB_YUV_SIGNED(dtype,fdtype) \
00312 dtype *psrc = datsrc->array; \
00313 dtype *pdest = datdest->array; \
00314 \
00315 fdtype tY,tU,tV,tD,tE,tmp; \
00316 \
00317 int i; \
00318 \
00319 for(i=0 ; i<datdest->length*3 ; i+=3) { \
00320 tY = (fdtype) flgr1d_get_data_array_##dtype(psrc,i); \
00321 tU = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+1); \
00322 tV = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+2); \
00323 tD = tU*0.436*2; \
00324 tE = tV*0.615*2; \
00325 \
00326 tmp = tY + 1.13983*tE; \
00327 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00328 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00329 flgr1d_set_data_array_##dtype(pdest,i,(dtype) tmp); \
00330 \
00331 tmp = tY - 0.39465*tD - 0.58060*tE; \
00332 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00333 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00334 flgr1d_set_data_array_##dtype(pdest,i+1,(dtype) tmp); \
00335 \
00336 tmp = tY + 2.03211*tD; \
00337 tmp = (tmp>MAX_##dtype) ? MAX_##dtype : tmp; \
00338 tmp = (tmp<MIN_##dtype) ? MIN_##dtype : tmp; \
00339 flgr1d_set_data_array_##dtype(pdest,i+2,(dtype) tmp); \
00340 \
00341 } \
00342 return
00343
00344 #define FLGR_MACRO_CONVERT1D_RGB_YUV_FLOAT(dtype,fdtype) \
00345 dtype *psrc = datsrc->array; \
00346 dtype *pdest = datdest->array; \
00347 \
00348 fdtype tY,tU,tV,tD,tE,tmp; \
00349 \
00350 int i; \
00351 \
00352 for(i=0 ; i<datdest->length*3 ; i+=3) { \
00353 tY = (fdtype) flgr1d_get_data_array_##dtype(psrc,i); \
00354 tU = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+1); \
00355 tV = (fdtype) flgr1d_get_data_array_##dtype(psrc,i+2); \
00356 tD = tU; \
00357 tE = tV; \
00358 \
00359 tmp = tY + 1.13983*tE; \
00360 flgr1d_set_data_array_##dtype(pdest,i,(dtype) tmp); \
00361 \
00362 tmp = tY - 0.39465*tD - 0.58060*tE; \
00363 flgr1d_set_data_array_##dtype(pdest,i+1,(dtype) tmp); \
00364 \
00365 tmp = tY + 2.03211*tD; \
00366 flgr1d_set_data_array_##dtype(pdest,i+2,(dtype) tmp); \
00367 \
00368 } \
00369 return
00370
00371 void flgr1d_color_convert_RGB_YUV_fgBIT(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00372 flgr_no_define_type_function(FLGR_BIT);
00373 }
00374
00375 void flgr1d_color_convert_RGB_YUV_fgUINT8(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00376 fgUINT8 *psrc = datsrc->array;
00377 fgUINT8 *pdest = datdest->array;
00378
00379 fgINT16 tY,tU,tV,tmp,tC,tD,tE;
00380
00381 int i;
00382
00383 for(i=0 ; i<datdest->length*3 ; i+=3) {
00384 tY = (fgINT16) flgr1d_get_data_array_fgUINT8(psrc,i);
00385 tU = (fgINT16) flgr1d_get_data_array_fgUINT8(psrc,i+1);
00386 tV = (fgINT16) flgr1d_get_data_array_fgUINT8(psrc,i+2);
00387 tC = tY - 16;
00388 tD = tU - 128;
00389 tE = tV - 128;
00390
00391 tmp = ( 298 * tC + 409 * tE + 128) >> 8;
00392 tmp = (tmp>MAX_fgUINT8) ? MAX_fgUINT8 : tmp;
00393 tmp = (tmp<MIN_fgUINT8) ? MIN_fgUINT8 : tmp;
00394 flgr1d_set_data_array_fgUINT8(pdest,i,(fgUINT8) tmp);
00395
00396 tmp = ( 298 * tC - 100 * tD - 208 * tE + 128) >> 8;
00397 tmp = (tmp>MAX_fgUINT8) ? MAX_fgUINT8 : tmp;
00398 tmp = (tmp<MIN_fgUINT8) ? MIN_fgUINT8 : tmp;
00399 flgr1d_set_data_array_fgUINT8(pdest,i+1,(fgUINT8) tmp);
00400
00401 tmp = ( 298 * tC + 516 * tD + 128) >> 8;
00402 tmp = (tmp>MAX_fgUINT8) ? MAX_fgUINT8 : tmp;
00403 tmp = (tmp<MIN_fgUINT8) ? MIN_fgUINT8 : tmp;
00404 flgr1d_set_data_array_fgUINT8(pdest,i+2,(fgUINT8) tmp);
00405
00406 }
00407
00408 }
00409
00410 void flgr1d_color_convert_RGB_YUV_fgUINT16(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00411 FLGR_MACRO_CONVERT1D_RGB_YUV_UNSIGNED(fgUINT16,fgFLOAT32);
00412 }
00413
00414 void flgr1d_color_convert_RGB_YUV_fgUINT32(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00415 FLGR_MACRO_CONVERT1D_RGB_YUV_UNSIGNED(fgUINT32,fgFLOAT32);
00416 }
00417
00418 void flgr1d_color_convert_RGB_YUV_fgINT8(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00419 FLGR_MACRO_CONVERT1D_RGB_YUV_SIGNED(fgINT8,fgFLOAT32);
00420 }
00421
00422 void flgr1d_color_convert_RGB_YUV_fgINT16(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00423 FLGR_MACRO_CONVERT1D_RGB_YUV_SIGNED(fgINT16,fgFLOAT32);
00424 }
00425
00426 void flgr1d_color_convert_RGB_YUV_fgINT32(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00427 FLGR_MACRO_CONVERT1D_RGB_YUV_SIGNED(fgINT32,fgFLOAT32);
00428 }
00429
00430 void flgr1d_color_convert_RGB_YUV_fgFLOAT32(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00431 FLGR_MACRO_CONVERT1D_RGB_YUV_FLOAT(fgFLOAT32,fgFLOAT32);
00432 }
00433
00434 void flgr1d_color_convert_RGB_YUV_fgFLOAT64(FLGR_Data1D *datdest,FLGR_Data1D *datsrc) {
00435 FLGR_MACRO_CONVERT1D_RGB_YUV_FLOAT(fgFLOAT64,fgFLOAT64);
00436 }
00437
00439
00499
00500 FLGR_Ret flgr1d_color_convert_RGB_YUV(FLGR_Data1D *datdest, FLGR_Data1D *datsrc) {
00501 FLGR_Ret ret;
00502
00503 if((datsrc==NULL) || (datdest==NULL)) {
00504 POST_ERROR("Null objects!\n");
00505 return FLGR_RET_NULL_OBJECT;
00506 }
00507
00508 if((ret = flgr1d_is_data_same_attributes(datsrc,datdest,__FUNCTION__)) != FLGR_RET_OK) return ret;
00509
00510 if(datdest->spp != 3) {
00511 POST_ERROR("Bad sample per pixel in source or destination\n");
00512 return FLGR_RET_PARAM_ERROR;
00513 }
00514
00515 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_color_convert_RGB_YUV,datdest,datsrc);
00516 }
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526 #define FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(dtype) \
00527 FLGR_Data1D **dest = datdest->row; \
00528 FLGR_Data1D **src = datsrc->row; \
00529 int i; \
00530 \
00531 for(i=0 ; i<datsrc->size_y ; i++) { \
00532 flgr1d_color_convert_YUV_RGB_##dtype(*dest,*src); \
00533 dest++;src++; \
00534 } \
00535 return
00536
00537 void flgr2d_color_convert_YUV_RGB_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00538 flgr_no_define_type_function(FLGR_BIT);
00539 }
00540 void flgr2d_color_convert_YUV_RGB_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00541 FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(fgUINT8);
00542 }
00543 void flgr2d_color_convert_YUV_RGB_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00544 FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(fgUINT16);
00545 }
00546 void flgr2d_color_convert_YUV_RGB_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00547 FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(fgUINT32);
00548 }
00549 void flgr2d_color_convert_YUV_RGB_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00550 FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(fgINT8);
00551 }
00552 void flgr2d_color_convert_YUV_RGB_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00553 FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(fgINT16);
00554 }
00555 void flgr2d_color_convert_YUV_RGB_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00556 FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(fgINT32);
00557 }
00558 void flgr2d_color_convert_YUV_RGB_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00559 FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(fgFLOAT32);
00560 }
00561 void flgr2d_color_convert_YUV_RGB_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00562 FLGR_MACRO_COLOR_CONVERT2D_YUV_RGB(fgFLOAT64);
00563 }
00564
00566
00572
00573 FLGR_Ret flgr2d_color_convert_YUV_RGB(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
00574 FLGR_Ret ret;
00575
00576 if((datdest==NULL) || (datsrc==NULL)) {
00577 POST_ERROR("Null objects!\n");
00578 return FLGR_RET_NULL_OBJECT;
00579 }
00580
00581 if((ret = flgr2d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00582
00583 if(datdest->spp != 3) {
00584 POST_ERROR("Bad sample per pixel in source or destination\n");
00585 return FLGR_RET_PARAM_ERROR;
00586 }
00587
00588 FLGR_DISPATCH_PROCEDURE(datsrc->type,flgr2d_color_convert_YUV_RGB,datdest,datsrc);
00589
00590 }
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600 #define FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(dtype) \
00601 FLGR_Data1D **src = datsrc->row; \
00602 FLGR_Data1D **dest = datdest->row; \
00603 int i; \
00604 \
00605 for(i=0 ; i<datdest->size_y ; i++) { \
00606 flgr1d_color_convert_RGB_YUV_##dtype(*dest,*src); \
00607 dest++;src++; \
00608 } \
00609 \
00610 return
00611
00612
00613 void flgr2d_color_convert_RGB_YUV_fgBIT(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00614 flgr_no_define_type_function(FLGR_BIT);
00615 }
00616
00617 void flgr2d_color_convert_RGB_YUV_fgUINT8(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00618 FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(fgUINT8);
00619 }
00620
00621 void flgr2d_color_convert_RGB_YUV_fgUINT16(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00622 FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(fgUINT16);
00623 }
00624
00625 void flgr2d_color_convert_RGB_YUV_fgUINT32(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00626 FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(fgUINT32);
00627 }
00628
00629 void flgr2d_color_convert_RGB_YUV_fgINT8(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00630 FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(fgINT8);
00631 }
00632
00633 void flgr2d_color_convert_RGB_YUV_fgINT16(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00634 FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(fgINT16);
00635 }
00636
00637 void flgr2d_color_convert_RGB_YUV_fgINT32(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00638 FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(fgINT32);
00639 }
00640
00641 void flgr2d_color_convert_RGB_YUV_fgFLOAT32(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00642 FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(fgFLOAT32);
00643 }
00644
00645 void flgr2d_color_convert_RGB_YUV_fgFLOAT64(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00646 FLGR_MACRO_COLOR_CONVERT2D_RGB_YUV(fgFLOAT64);
00647 }
00648
00650
00656
00657 FLGR_Ret flgr2d_color_convert_RGB_YUV(FLGR_Data2D *datdest,FLGR_Data2D *datsrc) {
00658 FLGR_Ret ret;
00659
00660 if((datsrc==NULL) || (datdest==NULL)) {
00661 POST_ERROR("Null objects!\n");
00662 return FLGR_RET_NULL_OBJECT;
00663 }
00664
00665 if((ret = flgr2d_is_data_same_attributes(datsrc,datdest,__FUNCTION__)) != FLGR_RET_OK) return ret;
00666
00667 if(datdest->spp != 3) {
00668 POST_ERROR("Bad sample per pixel in source or destination\n");
00669 return FLGR_RET_PARAM_ERROR;
00670 }
00671
00672 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_color_convert_RGB_YUV,datdest,datsrc);
00673 }
00674
00675
00676