diff options
Diffstat (limited to 'source/blender/avi/intern/rgb32.c')
-rw-r--r-- | source/blender/avi/intern/rgb32.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/avi/intern/rgb32.c b/source/blender/avi/intern/rgb32.c index 7b4958ca026..84630f09fe5 100644 --- a/source/blender/avi/intern/rgb32.c +++ b/source/blender/avi/intern/rgb32.c @@ -39,33 +39,33 @@ #include "MEM_guardedalloc.h" #include "rgb32.h" -void *avi_converter_from_rgb32 (AviMovie *movie, int stream, unsigned char *buffer, int *size) +void *avi_converter_from_rgb32(AviMovie *movie, int stream, unsigned char *buffer, int *size) { int y, x, rowstridea, rowstrideb; unsigned char *buf; (void)stream; /* unused */ - buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromrgb32buf"); + buf = MEM_mallocN(movie->header->Height * movie->header->Width * 3, "fromrgb32buf"); *size = movie->header->Height * movie->header->Width * 3; - rowstridea = movie->header->Width*3; - rowstrideb = movie->header->Width*4; + rowstridea = movie->header->Width * 3; + rowstrideb = movie->header->Width * 4; - for (y=0; y < movie->header->Height; y++) { - for (x=0; x < movie->header->Width; x++) { - buf[y*rowstridea + x*3 + 0] = buffer[y*rowstrideb + x*4 + 3]; - buf[y*rowstridea + x*3 + 1] = buffer[y*rowstrideb + x*4 + 2]; - buf[y*rowstridea + x*3 + 2] = buffer[y*rowstrideb + x*4 + 1]; + for (y = 0; y < movie->header->Height; y++) { + for (x = 0; x < movie->header->Width; x++) { + buf[y * rowstridea + x * 3 + 0] = buffer[y * rowstrideb + x * 4 + 3]; + buf[y * rowstridea + x * 3 + 1] = buffer[y * rowstrideb + x * 4 + 2]; + buf[y * rowstridea + x * 3 + 2] = buffer[y * rowstrideb + x * 4 + 1]; } } - MEM_freeN (buffer); + MEM_freeN(buffer); return buf; } -void *avi_converter_to_rgb32 (AviMovie *movie, int stream, unsigned char *buffer, int *size) +void *avi_converter_to_rgb32(AviMovie *movie, int stream, unsigned char *buffer, int *size) { int i; unsigned char *buf; @@ -73,20 +73,20 @@ void *avi_converter_to_rgb32 (AviMovie *movie, int stream, unsigned char *buffer (void)stream; /* unused */ - buf= MEM_mallocN (movie->header->Height * movie->header->Width * 4, "torgb32buf"); - *size= movie->header->Height * movie->header->Width * 4; + buf = MEM_mallocN(movie->header->Height * movie->header->Width * 4, "torgb32buf"); + *size = movie->header->Height * movie->header->Width * 4; memset(buf, 255, *size); - to= buf; from= buffer; - i=movie->header->Height*movie->header->Width; + to = buf; from = buffer; + i = movie->header->Height * movie->header->Width; while (i--) { memcpy(to, from, 3); - to+=4; from+=3; + to += 4; from += 3; } - MEM_freeN (buffer); + MEM_freeN(buffer); return buf; } |