mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	two bands case
This commit is contained in:
		
							parent
							
								
									1a7c9b72ab
								
							
						
					
					
						commit
						abc5e11371
					
				| 
						 | 
					@ -216,7 +216,18 @@ ImagingStretchHorizontal(Imaging imIn, int xsize, int filter)
 | 
				
			||||||
                    xmin = xbounds[xx * 2 + 0];
 | 
					                    xmin = xbounds[xx * 2 + 0];
 | 
				
			||||||
                    xmax = xbounds[xx * 2 + 1];
 | 
					                    xmax = xbounds[xx * 2 + 1];
 | 
				
			||||||
                    k = &kk[xx * kmax];
 | 
					                    k = &kk[xx * kmax];
 | 
				
			||||||
                    if (imIn->bands == 3) {
 | 
					                    if (imIn->bands == 2) {
 | 
				
			||||||
 | 
					                        ss0 = ss1 = 0.5;
 | 
				
			||||||
 | 
					                        for (x = xmin; x < xmax; x++) {
 | 
				
			||||||
 | 
					                            ss0 += i2f((UINT8) imIn->image[yy][x*4 + 0]) * k[x - xmin];
 | 
				
			||||||
 | 
					                            ss1 += i2f((UINT8) imIn->image[yy][x*4 + 3]) * k[x - xmin];
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					#ifdef WORDS_BIGENDIAN
 | 
				
			||||||
 | 
					                        imOut->image32[yy][xx] = clip8(ss1) | clip8(ss0) << 24;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					                        imOut->image32[yy][xx] = clip8(ss0) | clip8(ss1) << 24;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					                    } else if (imIn->bands == 3) {
 | 
				
			||||||
                        ss0 = ss1 = ss2 = 0.5;
 | 
					                        ss0 = ss1 = ss2 = 0.5;
 | 
				
			||||||
                        for (x = xmin; x < xmax; x++) {
 | 
					                        for (x = xmin; x < xmax; x++) {
 | 
				
			||||||
                            ss0 += i2f((UINT8) imIn->image[yy][x*4 + 0]) * k[x - xmin];
 | 
					                            ss0 += i2f((UINT8) imIn->image[yy][x*4 + 0]) * k[x - xmin];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user