00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __INTERN_VIDEO_H__
00031 #define __INTERN_VIDEO_H__
00032
00034
00035
00036
00037
00038
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 extern int ClipX1;
00069 extern int ClipY1;
00070 extern int ClipX2;
00071 extern int ClipY2;
00072
00073
00074
00075
00076
00094 #define CLIP_RECTANGLE(x, y, width, height) do { \
00095 int f; \
00096 if (x < ClipX1) { \
00097 f = ClipX1 - x; \
00098 if (width <= f) { \
00099 return; \
00100 } \
00101 width -= f; \
00102 x = ClipX1; \
00103 } \
00104 if ((x + width) > ClipX2 + 1) { \
00105 if (x > ClipX2) { \
00106 return; \
00107 } \
00108 width = ClipX2 - x + 1; \
00109 } \
00110 if (y < ClipY1) { \
00111 f = ClipY1 - y; \
00112 if (height <= f) { \
00113 return; \
00114 } \
00115 height -= f; \
00116 y = ClipY1; \
00117 } \
00118 if ((y + height) > ClipY2 + 1) { \
00119 if (y > ClipY2) { \
00120 return; \
00121 } \
00122 height = ClipY2 - y + 1; \
00123 } \
00124 } while(0)
00125
00149 #define CLIP_RECTANGLE_OFS(x, y, width, height, ofsx, ofsy, endx) do { \
00150 if (y < ClipY1) { \
00151 ofsy = ClipY1 - y; \
00152 if (height <= ofsy) { \
00153 return; \
00154 } \
00155 height -= ofsy; \
00156 y = ClipY1; \
00157 } else { \
00158 ofsy = 0; \
00159 } \
00160 if ((y + height) > ClipY2 + 1) { \
00161 if (y > ClipY2) { \
00162 return; \
00163 } \
00164 height = ClipY2 - y + 1; \
00165 } \
00166 if (x < ClipX1) { \
00167 ofsx = ClipX1 - x; \
00168 if (width <= ofsx) { \
00169 return; \
00170 } \
00171 width -= ofsx; \
00172 x = ClipX1; \
00173 } else { \
00174 ofsx = 0; \
00175 } \
00176 if ((x + width) > ClipX2 + 1) { \
00177 if (x > ClipX2) { \
00178 return; \
00179 } \
00180 endx = (x + width) - (ClipX2 + 1); \
00181 width = ClipX2 - x + 1; \
00182 } else { \
00183 endx = 0; \
00184 } \
00185 } while(0)
00186
00187
00188
00189
00190
00191
00192
00194
00195 #endif // !__INTERN_VIDEO_H__