diff options
Diffstat (limited to 'source/blender/imbuf/intern/scaling.c')
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 14b1753f586..b3e25b52140 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -263,7 +263,7 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1) for(x = ibuf2->x ; x>0 ; x--) *dest1++ = *dest2++ = *p1++; dest1 = dest2; } - if (do_float) { + if (do_float) { dest2f = dest1f + (4*ibuf2->x); for(x = ibuf2->x*4 ; x>0 ; x--) *dest1f++ = *dest2f++ = *p1f++; dest1f = dest2f; @@ -520,38 +520,38 @@ static void enlarge_picture_byte( *dst++ = ((((line1[x] * weight1y) >> 16) * weight1x) >> 16) + ((((line2[x] * weight2y) >> 16) - * weight1x) >> 16) + * weight1x) >> 16) + ((((line1[4 + x] * weight1y) >> 16) * weight2x) >> 16) + ((((line2[4 + x] * weight2y) >> 16) - * weight2x) >> 16); + * weight2x) >> 16); *dst++ = ((((line1[x + 1] * weight1y) >> 16) * weight1x) >> 16) + ((((line2[x + 1] * weight2y) >> 16) - * weight1x) >> 16) + * weight1x) >> 16) + ((((line1[4 + x + 1] * weight1y) >> 16) * weight2x) >> 16) + ((((line2[4 + x + 1] * weight2y) >> 16) - * weight2x) >> 16); + * weight2x) >> 16); *dst++ = ((((line1[x + 2] * weight1y) >> 16) * weight1x) >> 16) + ((((line2[x + 2] * weight2y) >> 16) - * weight1x) >> 16) + * weight1x) >> 16) + ((((line1[4 + x + 2] * weight1y) >> 16) * weight2x) >> 16) + ((((line2[4 + x + 2] * weight2y) >> 16) - * weight2x) >> 16); + * weight2x) >> 16); *dst++ = ((((line1[x + 3] * weight1y) >> 16) * weight1x) >> 16) + ((((line2[x + 3] * weight2y) >> 16) - * weight1x) >> 16) + * weight1x) >> 16) + ((((line1[4 + x + 3] * weight1y) >> 16) * weight2x) >> 16) + ((((line2[4 + x + 3] * weight2y) >> 16) - * weight2x) >> 16); + * weight2x) >> 16); x_src += dx_src; } @@ -661,7 +661,7 @@ static void shrink_picture_byte( *dst++ = (val= (dst_line1[x].a * f) >> 15) > 255 ? 255: val; } memset(dst_line1, 0, dst_width * - sizeof(struct scale_outpix_byte)); + sizeof(struct scale_outpix_byte)); temp = dst_line1; dst_line1 = dst_line2; dst_line2 = temp; @@ -688,10 +688,10 @@ static void q_scale_byte(unsigned char* in, unsigned char* out, int in_width, { if (dst_width > in_width && dst_height > in_height) { enlarge_picture_byte(in, out, in_width, in_height, - dst_width, dst_height); + dst_width, dst_height); } else if (dst_width < in_width && dst_height < in_height) { shrink_picture_byte(in, out, in_width, in_height, - dst_width, dst_height); + dst_width, dst_height); } } @@ -777,7 +777,7 @@ static void shrink_picture_float( double ratioy = (double) (dst_height) / (double) (src_height); uintptr_t x_src; uintptr_t y_src; - float dx_dst, x_dst; + float dx_dst, x_dst; float dy_dst, y_dst; float y_counter; float * dst_begin = dst; @@ -862,7 +862,7 @@ static void shrink_picture_float( *dst++ = dst_line1[x].a * f; } memset(dst_line1, 0, dst_width * - sizeof(struct scale_outpix_float)); + sizeof(struct scale_outpix_float)); temp = dst_line1; dst_line1 = dst_line2; dst_line2 = temp; @@ -888,10 +888,10 @@ static void q_scale_float(float* in, float* out, int in_width, { if (dst_width > in_width && dst_height > in_height) { enlarge_picture_float(in, out, in_width, in_height, - dst_width, dst_height); + dst_width, dst_height); } else if (dst_width < in_width && dst_height < in_height) { shrink_picture_float(in, out, in_width, in_height, - dst_width, dst_height); + dst_width, dst_height); } } @@ -906,7 +906,7 @@ static void q_scale_float(float* in, float* out, int in_width, but that is pretty fast: * does only blit once instead of two passes like the old code - (fewer cache misses) + (fewer cache misses) * uses fixed point integer arithmetic for byte buffers * doesn't branch in tight loops @@ -920,7 +920,7 @@ static int q_scale_linear_interpolation( struct ImBuf *ibuf, int newx, int newy) { if ((newx >= ibuf->x && newy <= ibuf->y) || - (newx <= ibuf->x && newy >= ibuf->y)) { + (newx <= ibuf->x && newy >= ibuf->y)) { return FALSE; } @@ -928,7 +928,7 @@ static int q_scale_linear_interpolation( unsigned char * newrect = MEM_mallocN(newx * newy * sizeof(int), "q_scale rect"); q_scale_byte((unsigned char *)ibuf->rect, newrect, ibuf->x, ibuf->y, - newx, newy); + newx, newy); imb_freerectImBuf(ibuf); ibuf->mall |= IB_rect; @@ -937,9 +937,9 @@ static int q_scale_linear_interpolation( if (ibuf->rect_float) { float * newrect = MEM_mallocN(newx * newy * 4 *sizeof(float), - "q_scale rectfloat"); + "q_scale rectfloat"); q_scale_float(ibuf->rect_float, newrect, ibuf->x, ibuf->y, - newx, newy); + newx, newy); imb_freerectfloatImBuf(ibuf); ibuf->mall |= IB_rectfloat; ibuf->rect_float = newrect; |