diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-08 02:51:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-08 02:51:57 +0400 |
commit | cfb7aee017d95137e19b7b006d9393b5d6a935d4 (patch) | |
tree | 005a1981af6c5a0f36959d73479cc69137842eb4 /source/blender/imbuf | |
parent | d58ce290e1e4dcb8d0b96259fdf29c854bfaef49 (diff) |
style cleanup
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/allocimbuf.c | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 18 | ||||
-rw-r--r-- | source/blender/imbuf/intern/imageprocess.c | 22 | ||||
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 12 | ||||
-rw-r--r-- | source/blender/imbuf/intern/indexer_dv.c | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jp2.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jpeg.c | 14 | ||||
-rw-r--r-- | source/blender/imbuf/intern/png.c | 34 | ||||
-rw-r--r-- | source/blender/imbuf/intern/radiance_hdr.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 2 |
10 files changed, 60 insertions, 60 deletions
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 68a094c26d0..c717d8eee5a 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -424,7 +424,7 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1) /* silly trick to copy the entire contents of ibuf1 struct over to ibuf */ tbuf = *ibuf1; - // fix pointers + /* fix pointers */ tbuf.rect = ibuf2->rect; tbuf.rect_float = ibuf2->rect_float; tbuf.encodedbuffer = ibuf2->encodedbuffer; @@ -433,12 +433,12 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1) for (a = 0; a < IB_MIPMAP_LEVELS; a++) tbuf.mipmap[a] = NULL; - // set malloc flag + /* set malloc flag */ tbuf.mall = ibuf2->mall; tbuf.c_handle = NULL; tbuf.refcounter = 0; - // for now don't duplicate metadata + /* for now don't duplicate metadata */ tbuf.metadata = NULL; *ibuf2 = tbuf; diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index f0c2d754333..a27aae815da 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -42,8 +42,8 @@ #include <vfw.h> #endif -#undef AVIIF_KEYFRAME // redefined in AVI_avi.h -#undef AVIIF_LIST // redefined in AVI_avi.h +#undef AVIIF_KEYFRAME /* redefined in AVI_avi.h */ +#undef AVIIF_LIST /* redefined in AVI_avi.h */ #define FIXCC(fcc) \ { \ @@ -324,10 +324,10 @@ static int startavi(struct anim *anim) if (anim->pgf) { firstvideo = i; - // get stream length + /* get stream length */ anim->avi->header->TotalFrames = AVIStreamLength(anim->pavi[i]); - - // get information about images inside the stream + + /* get information about images inside the stream */ l = sizeof(abFormat); AVIStreamReadFormat(anim->pavi[i], 0, &abFormat, &l); lpbi = (LPBITMAPINFOHEADER)abFormat; @@ -344,12 +344,12 @@ static int startavi(struct anim *anim) } } - // register number of opened avistreams + /* register number of opened avistreams */ anim->avistreams = i; - // - // Couldn't get any video streams out of this file - // + /* + * Couldn't get any video streams out of this file + */ if ((anim->avistreams == 0) || (firstvideo == -1)) { avierror = AVI_ERROR_FORMAT; } diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index 40f6f36e06b..5114fcb3ae0 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -258,11 +258,11 @@ void bilinear_interpolation_color(struct ImBuf *in, unsigned char *outI, float * y1 = (int)floor(v); y2 = (int)ceil(v); - // sample area entirely outside image? + /* sample area entirely outside image? */ if (x2 < 0 || x1 > in->x - 1 || y2 < 0 || y1 > in->y - 1) return; if (outF) { - // sample including outside of edges of image + /* sample including outside of edges of image */ if (x1 < 0 || y1 < 0) row1 = empty; else row1 = (float *)in->rect_float + in->x * y1 * 4 + 4 * x1; @@ -285,7 +285,7 @@ void bilinear_interpolation_color(struct ImBuf *in, unsigned char *outI, float * outF[3] = ma_mb * row1[3] + a_mb * row3[3] + ma_b * row2[3] + a_b * row4[3]; } if (outI) { - // sample including outside of edges of image + /* sample including outside of edges of image */ if (x1 < 0 || y1 < 0) row1I = emptyI; else row1I = (unsigned char *)in->rect + in->x * y1 * 4 + 4 * x1; @@ -332,18 +332,18 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *outI, fl y1 = (int)floor(v); y2 = (int)ceil(v); - // sample area entirely outside image? + /* sample area entirely outside image? */ if (x2 < 0 || x1 > in->x - 1 || y2 < 0 || y1 > in->y - 1) return; - + /* wrap interpolation pixels - main difference from bilinear_interpolation_color */ if (x1 < 0) x1 = in->x + x1; if (y1 < 0) y1 = in->y + y1; - + if (x2 >= in->x) x2 = x2 - in->x; if (y2 >= in->y) y2 = y2 - in->y; if (outF) { - // sample including outside of edges of image + /* sample including outside of edges of image */ row1 = (float *)in->rect_float + in->x * y1 * 4 + 4 * x1; row2 = (float *)in->rect_float + in->x * y2 * 4 + 4 * x1; row3 = (float *)in->rect_float + in->x * y1 * 4 + 4 * x2; @@ -359,7 +359,7 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *outI, fl outF[3] = ma_mb * row1[3] + a_mb * row3[3] + ma_b * row2[3] + a_b * row4[3]; } if (outI) { - // sample including outside of edges of image + /* sample including outside of edges of image */ row1I = (unsigned char *)in->rect + in->x * y1 * 4 + 4 * x1; row2I = (unsigned char *)in->rect + in->x * y2 * 4 + 4 * x1; row3I = (unsigned char *)in->rect + in->x * y1 * 4 + 4 * x2; @@ -404,10 +404,10 @@ void neareast_interpolation_color(struct ImBuf *in, unsigned char *outI, float * x1 = (int)(u); y1 = (int)(v); - // sample area entirely outside image? + /* sample area entirely outside image? */ if (x1 < 0 || x1 > in->x - 1 || y1 < 0 || y1 > in->y - 1) return; - - // sample including outside of edges of image + + /* sample including outside of edges of image */ if (x1 < 0 || y1 < 0) { if (outI) { outI[0] = 0; diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 8b2e27ae1f3..9cf06b08ba4 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -181,12 +181,12 @@ struct anim_index *IMB_indexer_open(const char *name) fseek(fp, 0, SEEK_END); idx->num_entries = (ftell(fp) - 12) / - (sizeof(int) + // framepos - sizeof(unsigned long long) + // seek_pos - sizeof(unsigned long long) + // seek_pos_dts - sizeof(unsigned long long) // pts + (sizeof(int) + /* framepos */ + sizeof(unsigned long long) + /* seek_pos */ + sizeof(unsigned long long) + /* seek_pos_dts */ + sizeof(unsigned long long) /* pts */ ); - + fseek(fp, 12, SEEK_SET); idx->entries = MEM_callocN(sizeof(struct anim_index_entry) * @@ -472,7 +472,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( char fname[FILE_MAX]; int ffmpeg_quality; - // JPEG requires this + /* JPEG requires this */ width = round_up(width, 8); height = round_up(height, 8); diff --git a/source/blender/imbuf/intern/indexer_dv.c b/source/blender/imbuf/intern/indexer_dv.c index 0090577062f..4c6b750aa41 100644 --- a/source/blender/imbuf/intern/indexer_dv.c +++ b/source/blender/imbuf/intern/indexer_dv.c @@ -129,7 +129,7 @@ static void parse_packet(indexer_dv_context *This, unsigned char *p) b = bitstream_new(p + 1); switch (type) { - case 0x62: // Record date + case 0x62: /* Record date */ parse_num(&b, 8); This->rec_curr_day = parse_bcd(&b, 6); parse_num(&b, 2); @@ -144,7 +144,7 @@ static void parse_packet(indexer_dv_context *This, unsigned char *p) } This->got_record_date = 1; break; - case 0x63: // Record time + case 0x63: /* Record time */ This->rec_curr_frame = parse_bcd(&b, 6); parse_num(&b, 2); This->rec_curr_second = parse_bcd(&b, 7); @@ -322,7 +322,7 @@ static void proc_frame(indexer_dv_context *This, } } else if (This->ref_time_read_new == This->ref_time_read) { - // do nothing + /* do nothing */ } else { This->gap_start = This->ref_time_read; diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index 3008c233718..6477d40d695 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -880,7 +880,7 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) parameters.tcp_rates[0] = ((100 - quality) / 90.0f * 99.0f) + 1; - parameters.tcp_numlayers = 1; // only one resolution + parameters.tcp_numlayers = 1; /* only one resolution */ parameters.cp_disto_alloc = 1; image = ibuftoimage(ibuf, ¶meters); diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 47555302a59..03c949bc3d1 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -86,9 +86,9 @@ int imb_is_a_jpeg(unsigned char *mem) return 0; } -//---------------------------------------------------------- -// JPG ERROR HANDLING -//---------------------------------------------------------- +/*---------------------------------------------------------- + * JPG ERROR HANDLING + *---------------------------------------------------------- */ typedef struct my_error_mgr { struct jpeg_error_mgr pub; /* "public" fields */ @@ -112,9 +112,9 @@ static void jpeg_error(j_common_ptr cinfo) longjmp(err->setjmp_buffer, 1); } -//---------------------------------------------------------- -// INPUT HANDLER FROM MEMORY -//---------------------------------------------------------- +/*---------------------------------------------------------- + * INPUT HANDLER FROM MEMORY + *---------------------------------------------------------- */ typedef struct { unsigned char *buffer; @@ -159,7 +159,7 @@ static void skip_input_data(j_decompress_ptr cinfo, long num_bytes) my_src_ptr src = (my_src_ptr) cinfo->src; if (num_bytes > 0) { - // prevent skipping over file end + /* prevent skipping over file end */ size_t skip_size = (size_t)num_bytes <= src->pub.bytes_in_buffer ? num_bytes : src->pub.bytes_in_buffer; src->pub.next_input_byte = src->pub.next_input_byte + skip_size; diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 2aed1485700..928eb219ea5 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -73,7 +73,7 @@ static void WriteData(png_structp png_ptr, png_bytep data, png_size_t length) { ImBuf *ibuf = (ImBuf *) png_get_io_ptr(png_ptr); - // if buffer is to small increase it. + /* if buffer is to small increase it. */ while (ibuf->encodedsize + length > ibuf->encodedbuffersize) { imb_enlargeencodedbufferImBuf(ibuf); } @@ -144,7 +144,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) return 0; } - // copy image data + /* copy image data */ pixels = MEM_mallocN(ibuf->x * ibuf->y * bytesperpixel * sizeof(unsigned char), "pixels"); if (pixels == NULL) { @@ -186,7 +186,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) } if (flags & IB_mem) { - // create image in memory + /* create image in memory */ imb_addencodedbufferImBuf(ibuf); ibuf->encodedsize = 0; @@ -218,7 +218,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) png_set_compression_level(png_ptr, compression); - // png image settings + /* png image settings */ png_set_IHDR(png_ptr, info_ptr, ibuf->x, @@ -261,10 +261,10 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) png_set_pHYs(png_ptr, info_ptr, (unsigned int)(ibuf->ppm[0] + 0.5), (unsigned int)(ibuf->ppm[1] + 0.5), PNG_RESOLUTION_METER); } - // write the file header information + /* write the file header information */ png_write_info(png_ptr, info_ptr); - // allocate memory for an array of row-pointers + /* allocate memory for an array of row-pointers */ row_pointers = (png_bytepp) MEM_mallocN(ibuf->y * sizeof(png_bytep), "row_pointers"); if (row_pointers == NULL) { printf("imb_savepng: Cannot allocate row-pointers array for file '%s'\n", name); @@ -276,19 +276,19 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) return 0; } - // set the individual row-pointers to point at the correct offsets + /* set the individual row-pointers to point at the correct offsets */ for (i = 0; i < ibuf->y; i++) { row_pointers[ibuf->y - 1 - i] = (png_bytep) ((unsigned char *)pixels + (i * ibuf->x) * bytesperpixel * sizeof(unsigned char)); } - // write out the entire image data in one call + /* write out the entire image data in one call */ png_write_image(png_ptr, row_pointers); - // write the additional chunks to the PNG file (not really needed) + /* write the additional chunks to the PNG file (not really needed) */ png_write_end(png_ptr, info_ptr); - // clean up + /* clean up */ MEM_freeN(pixels); MEM_freeN(row_pointers); png_destroy_write_struct(&png_ptr, &info_ptr); @@ -419,14 +419,14 @@ ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) longjmp(png_jmpbuf(png_ptr), 1); } - // allocate memory for an array of row-pointers + /* allocate memory for an array of row-pointers */ row_pointers = (png_bytepp) MEM_mallocN(ibuf->y * sizeof(png_uint_16p), "row_pointers"); if (row_pointers == NULL) { printf("Cannot allocate row-pointers array\n"); longjmp(png_jmpbuf(png_ptr), 1); } - // set the individual row-pointers to point at the correct offsets + /* set the individual row-pointers to point at the correct offsets */ for (i = 0; i < ibuf->y; i++) { row_pointers[ibuf->y - 1 - i] = (png_bytep) ((png_uint_16 *)pixels16 + (i * ibuf->x) * bytesperpixel); @@ -434,7 +434,7 @@ ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) png_read_image(png_ptr, row_pointers); - // copy image data + /* copy image data */ to_float = ibuf->rect_float; from16 = pixels16; @@ -487,14 +487,14 @@ ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) longjmp(png_jmpbuf(png_ptr), 1); } - // allocate memory for an array of row-pointers + /* allocate memory for an array of row-pointers */ row_pointers = (png_bytepp) MEM_mallocN(ibuf->y * sizeof(png_bytep), "row_pointers"); if (row_pointers == NULL) { printf("Cannot allocate row-pointers array\n"); longjmp(png_jmpbuf(png_ptr), 1); } - // set the individual row-pointers to point at the correct offsets + /* set the individual row-pointers to point at the correct offsets */ for (i = 0; i < ibuf->y; i++) { row_pointers[ibuf->y - 1 - i] = (png_bytep) ((unsigned char *)pixels + (i * ibuf->x) * bytesperpixel * sizeof(unsigned char)); @@ -502,7 +502,7 @@ ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) png_read_image(png_ptr, row_pointers); - // copy image data + /* copy image data */ to = (unsigned char *) ibuf->rect; from = pixels; @@ -555,7 +555,7 @@ ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) png_read_end(png_ptr, info_ptr); } - // clean up + /* clean up */ if (pixels) MEM_freeN(pixels); if (pixels16) diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index 29c2e63637d..2ba1ebf90b5 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -163,8 +163,8 @@ static void FLOAT2RGBE(fCOLOR fcol, RGBE rgbe) int imb_is_a_hdr(unsigned char *buf) { - // For recognition, Blender only loads first 32 bytes, so use #?RADIANCE id instead - // update: actually, the 'RADIANCE' part is just an optional program name, the magic word is really only the '#?' part + /* For recognition, Blender only loads first 32 bytes, so use #?RADIANCE id instead */ + /* update: actually, the 'RADIANCE' part is just an optional program name, the magic word is really only the '#?' part */ //if (strstr((char*)buf, "#?RADIANCE")) return 1; if (strstr((char *)buf, "#?")) return 1; // if (strstr((char*)buf, "32-bit_rle_rgbe")) return 1; diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 615b420429a..cc57ffff812 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -466,7 +466,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul) if (success) { ibuf->profile = (bitspersample == 32) ? IB_PROFILE_LINEAR_RGB : IB_PROFILE_SRGB; -// Code seems to be not needed for 16 bits tif, on PPC G5 OSX (ton) + /* Code seems to be not needed for 16 bits tif, on PPC G5 OSX (ton) */ if (bitspersample < 16) if (ENDIAN_ORDER == B_ENDIAN) IMB_convert_rgba_to_abgr(tmpibuf); |