Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef INDEX_H
00017 #define INDEX_H
00018
00019 #define GRAY(IMAGE, X, Y) \
00020 ((uchar*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[X]
00021 #define RED(IMAGE, X, Y) \
00022 ((uchar*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3+2]
00023 #define GREEN(IMAGE, X, Y) \
00024 ((uchar*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3+1]
00025 #define BLUE(IMAGE, X, Y) \
00026 ((uchar*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3]
00027 #define HUE(IMAGE, X, Y) \
00028 ((uchar*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3]
00029 #define SAT(IMAGE, X, Y) \
00030 ((uchar*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3+1]
00031 #define VAL(IMAGE, X, Y) \
00032 ((uchar*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3+2]
00033
00034 #define GRAY16(IMAGE, X, Y) \
00035 ((unsigned short*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[X]
00036 #define GRAY32(IMAGE, X, Y) \
00037 ((int*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[X]
00038
00039 #define GRAY_T(TYPE, IMAGE, X, Y) \
00040 ((TYPE*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[X]
00041 #define RED_T(TYPE, IMAGE, X, Y) \
00042 ((TYPE*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3+2]
00043 #define GREEN_T(TYPE, IMAGE, X, Y) \
00044 ((TYPE*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3+1]
00045 #define BLUE_T(TYPE, IMAGE, X, Y) \
00046 ((TYPE*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[(X)*3]
00047
00048 #define GRAY32F(IMAGE, X, Y) \
00049 ((float*)((IMAGE)->imageData + (IMAGE)->widthStep*(Y)))[X]
00050
00051 #endif