comparison test/testoverlay.c @ 605:6399f4e90211

IRIX patches from Andrea Suatoni
author Sam Lantinga <slouken@libsdl.org>
date Thu, 06 Mar 2003 06:12:41 +0000
parents 2e726be3dc08
children be9c9c8f6d53
comparison
equal deleted inserted replaced
604:31d3af76488b 605:6399f4e90211
90 */ 90 */
91 91
92 /* Convert */ 92 /* Convert */
93 for(y=0; y<s->h && y<o->h; y++) 93 for(y=0; y<s->h && y<o->h; y++)
94 { 94 {
95 p=s->pixels+s->pitch*y; 95 p=((Uint8 *) s->pixels)+s->pitch*y;
96 op[0]=o->pixels[0]+o->pitches[0]*y; 96 op[0]=o->pixels[0]+o->pitches[0]*y;
97 op[1]=o->pixels[1]+o->pitches[1]*(y/2); 97 op[1]=o->pixels[1]+o->pitches[1]*(y/2);
98 op[2]=o->pixels[2]+o->pitches[2]*(y/2); 98 op[2]=o->pixels[2]+o->pitches[2]*(y/2);
99 for(x=0; x<s->w && x<o->w; x++) 99 for(x=0; x<s->w && x<o->w; x++)
100 { 100 {
130 */ 130 */
131 131
132 /* Convert */ 132 /* Convert */
133 for(y=0; y<s->h && y<o->h; y++) 133 for(y=0; y<s->h && y<o->h; y++)
134 { 134 {
135 p=s->pixels+s->pitch*y; 135 p=((Uint8 *) s->pixels)+s->pitch*y;
136 op[0]=o->pixels[0]+o->pitches[0]*y; 136 op[0]=o->pixels[0]+o->pitches[0]*y;
137 op[1]=o->pixels[1]+o->pitches[1]*(y/2); 137 op[1]=o->pixels[1]+o->pitches[1]*(y/2);
138 op[2]=o->pixels[2]+o->pitches[2]*(y/2); 138 op[2]=o->pixels[2]+o->pitches[2]*(y/2);
139 for(x=0; x<s->w && x<o->w; x++) 139 for(x=0; x<s->w && x<o->w; x++)
140 { 140 {
162 SDL_LockSurface(s); 162 SDL_LockSurface(s);
163 SDL_LockYUVOverlay(o); 163 SDL_LockYUVOverlay(o);
164 164
165 for(y=0; y<s->h && y<o->h; y++) 165 for(y=0; y<s->h && y<o->h; y++)
166 { 166 {
167 p=s->pixels+s->pitch*y; 167 p=((Uint8 *) s->pixels)+s->pitch*y;
168 op=o->pixels[0]+o->pitches[0]*y; 168 op=o->pixels[0]+o->pitches[0]*y;
169 for(x=0; x<s->w && x<o->w; x++) 169 for(x=0; x<s->w && x<o->w; x++)
170 { 170 {
171 RGBtoYUV(p, yuv, monochrome, luminance); 171 RGBtoYUV(p, yuv, monochrome, luminance);
172 if(x%2==0) 172 if(x%2==0)
195 SDL_LockSurface(s); 195 SDL_LockSurface(s);
196 SDL_LockYUVOverlay(o); 196 SDL_LockYUVOverlay(o);
197 197
198 for(y=0; y<s->h && y<o->h; y++) 198 for(y=0; y<s->h && y<o->h; y++)
199 { 199 {
200 p=s->pixels+s->pitch*y; 200 p=((Uint8 *) s->pixels)+s->pitch*y;
201 op=o->pixels[0]+o->pitches[0]*y; 201 op=o->pixels[0]+o->pitches[0]*y;
202 for(x=0; x<s->w && x<o->w; x++) 202 for(x=0; x<s->w && x<o->w; x++)
203 { 203 {
204 RGBtoYUV(p,yuv, monochrome, luminance); 204 RGBtoYUV(p,yuv, monochrome, luminance);
205 if(x%2==0) 205 if(x%2==0)
231 SDL_LockSurface(s); 231 SDL_LockSurface(s);
232 SDL_LockYUVOverlay(o); 232 SDL_LockYUVOverlay(o);
233 233
234 for(y=0; y<s->h && y<o->h; y++) 234 for(y=0; y<s->h && y<o->h; y++)
235 { 235 {
236 p=s->pixels+s->pitch*y; 236 p=((Uint8 *) s->pixels)+s->pitch*y;
237 op=o->pixels[0]+o->pitches[0]*y; 237 op=o->pixels[0]+o->pitches[0]*y;
238 for(x=0; x<s->w && x<o->w; x++) 238 for(x=0; x<s->w && x<o->w; x++)
239 { 239 {
240 RGBtoYUV(p,yuv, monochrome, luminance); 240 RGBtoYUV(p,yuv, monochrome, luminance);
241 if(x%2==0) 241 if(x%2==0)