diff options
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/cineon/cineonlib.c | 32 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/dpxlib.c | 36 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/logImageCore.h | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/logmemfile.c | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/logmemfile.h | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 72 |
6 files changed, 75 insertions, 75 deletions
diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c index 3b45a9de822..ecee3c7d6c0 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.c +++ b/source/blender/imbuf/intern/cineon/cineonlib.c @@ -67,12 +67,12 @@ fillCineonFileInfo(CineonFile* cineon, CineonFileInformation* fileInfo, const ch static void dumpCineonFileInfo(CineonFileInformation* fileInfo) { d_printf("\n--File Information--\n"); - d_printf("Magic: %8.8lX\n", (unsigned long)ntohl(fileInfo->magic_num)); - d_printf("Image Offset %ld\n", (long)ntohl(fileInfo->image_offset)); - d_printf("Generic Header size %ld\n", (long)ntohl(fileInfo->gen_hdr_size)); - d_printf("Industry Header size %ld\n", (long)ntohl(fileInfo->ind_hdr_size)); - d_printf("User Data size %ld\n", (long)ntohl(fileInfo->user_data_size)); - d_printf("File size %ld\n", (long)ntohl(fileInfo->file_size)); + d_printf("Magic: %8.8lX\n", (uintptr_t)ntohl(fileInfo->magic_num)); + d_printf("Image Offset %ld\n", (intptr_t)ntohl(fileInfo->image_offset)); + d_printf("Generic Header size %ld\n", (intptr_t)ntohl(fileInfo->gen_hdr_size)); + d_printf("Industry Header size %ld\n", (intptr_t)ntohl(fileInfo->ind_hdr_size)); + d_printf("User Data size %ld\n", (intptr_t)ntohl(fileInfo->user_data_size)); + d_printf("File size %ld\n", (intptr_t)ntohl(fileInfo->file_size)); d_printf("Version \"%s\"\n", fileInfo->vers); d_printf("File name \"%s\"\n", fileInfo->file_name); d_printf("Creation date \"%s\"\n", fileInfo->create_date); @@ -112,11 +112,11 @@ dumpCineonChannelInfo(CineonChannelInformation* chan) { default: d_printf(" (unknown)\n"); break; } d_printf(" Bits per pixel %d\n", chan->bits_per_pixel); - d_printf(" Pixels per line %ld\n", (long)ntohl(chan->pixels_per_line)); - d_printf(" Lines per image %ld\n", (long)ntohl(chan->lines_per_image)); - d_printf(" Ref low data %ld\n", (long)ntohl(chan->ref_low_data)); + d_printf(" Pixels per line %ld\n", (intptr_t)ntohl(chan->pixels_per_line)); + d_printf(" Lines per image %ld\n", (intptr_t)ntohl(chan->lines_per_image)); + d_printf(" Ref low data %ld\n", (intptr_t)ntohl(chan->ref_low_data)); d_printf(" Ref low quantity %f\n", ntohf(chan->ref_low_quantity)); - d_printf(" Ref high data %ld\n", (long)ntohl(chan->ref_high_data)); + d_printf(" Ref high data %ld\n", (intptr_t)ntohl(chan->ref_high_data)); d_printf(" Ref high quantity %f\n", ntohf(chan->ref_high_quantity)); } @@ -231,8 +231,8 @@ dumpCineonFormatInfo(CineonFormatInformation* formatInfo) { } else { d_printf(" positive\n"); } - d_printf("End of line padding %ld\n", (long)ntohl(formatInfo->line_padding)); - d_printf("End of channel padding %ld\n", (long)ntohl(formatInfo->channel_padding)); + d_printf("End of line padding %ld\n", (intptr_t)ntohl(formatInfo->line_padding)); + d_printf("End of channel padding %ld\n", (intptr_t)ntohl(formatInfo->channel_padding)); } static void @@ -256,8 +256,8 @@ fillCineonOriginationInfo(CineonFile* cineon, static void dumpCineonOriginationInfo(CineonOriginationInformation* originInfo) { d_printf("\n--Origination Information--\n"); - d_printf("X offset %ld\n", (long)ntohl(originInfo->x_offset)); - d_printf("Y offset %ld\n", (long)ntohl(originInfo->y_offset)); + d_printf("X offset %ld\n", (intptr_t)ntohl(originInfo->x_offset)); + d_printf("Y offset %ld\n", (intptr_t)ntohl(originInfo->y_offset)); d_printf("File name \"%s\"\n", originInfo->file_name); d_printf("Creation date \"%s\"\n", originInfo->create_date); d_printf("Creation time \"%s\"\n", originInfo->create_time); @@ -529,7 +529,7 @@ cineonOpen(const char* filename) { /* let's assume cineon files are always network order */ if (header.fileInfo.magic_num != ntohl(CINEON_FILE_MAGIC)) { if (verbose) d_printf("Bad magic number %8.8lX in \"%s\".\n", - (unsigned long)ntohl(header.fileInfo.magic_num), filename); + (uintptr_t)ntohl(header.fileInfo.magic_num), filename); cineonClose(cineon); return 0; } @@ -628,7 +628,7 @@ cineonOpenFromMem(unsigned char *mem, unsigned int size) { /* let's assume cineon files are always network order */ if (header.fileInfo.magic_num != ntohl(CINEON_FILE_MAGIC)) { - if (verbose) d_printf("Bad magic number %8.8lX in\n", (unsigned long)ntohl(header.fileInfo.magic_num)); + if (verbose) d_printf("Bad magic number %8.8lX in\n", (uintptr_t)ntohl(header.fileInfo.magic_num)); cineonClose(cineon); return 0; diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c index 500c09ba265..1710cdde501 100644 --- a/source/blender/imbuf/intern/cineon/dpxlib.c +++ b/source/blender/imbuf/intern/cineon/dpxlib.c @@ -58,15 +58,15 @@ fillDpxChannelInfo(DpxFile* dpx, DpxChannelInformation* chan, int des) { static void dumpDpxChannelInfo(DpxChannelInformation* chan) { - d_printf(" Signage %ld", (long)ntohl(chan->signage)); - d_printf(" Ref low data %ld\n", (long)ntohl(chan->ref_low_data)); + d_printf(" Signage %ld", (intptr_t)ntohl(chan->signage)); + d_printf(" Ref low data %ld\n", (intptr_t)ntohl(chan->ref_low_data)); d_printf(" Ref low quantity %f\n", ntohf(chan->ref_low_quantity)); - d_printf(" Ref high data %ld\n", (long)ntohl(chan->ref_high_data)); + d_printf(" Ref high data %ld\n", (intptr_t)ntohl(chan->ref_high_data)); d_printf(" Ref high quantity %f\n", ntohf(chan->ref_high_quantity)); d_printf(" Designator1: %d,", chan->designator1); d_printf(" Bits per pixel %d\n", chan->bits_per_pixel); d_printf(" Packing: %d,", ntohs(chan->packing)); - d_printf(" Data Offset: %ld,", (long)ntohl(chan->data_offset)); + d_printf(" Data Offset: %ld,", (intptr_t)ntohl(chan->data_offset)); } static void @@ -110,19 +110,19 @@ static void dumpDpxFileInfo(DpxFileInformation* fileInfo) { d_printf("\n--File Information--\n"); d_printf("Magic: %8.8lX\n", (unsigned long)ntohl(fileInfo->magic_num)); - d_printf("Image Offset %ld\n", (long)ntohl(fileInfo->offset)); + d_printf("Image Offset %ld\n", (intptr_t)ntohl(fileInfo->offset)); d_printf("Version \"%s\"\n", fileInfo->vers); - d_printf("File size %ld\n", (long)ntohl(fileInfo->file_size)); - d_printf("Ditto key %ld\n", (long)ntohl(fileInfo->ditto_key)); - d_printf("Generic Header size %ld\n", (long)ntohl(fileInfo->gen_hdr_size)); - d_printf("Industry Header size %ld\n", (long)ntohl(fileInfo->ind_hdr_size)); - d_printf("User Data size %ld\n", (long)ntohl(fileInfo->user_data_size)); + d_printf("File size %ld\n", (intptr_t)ntohl(fileInfo->file_size)); + d_printf("Ditto key %ld\n", (intptr_t)ntohl(fileInfo->ditto_key)); + d_printf("Generic Header size %ld\n", (intptr_t)ntohl(fileInfo->gen_hdr_size)); + d_printf("Industry Header size %ld\n", (intptr_t)ntohl(fileInfo->ind_hdr_size)); + d_printf("User Data size %ld\n", (intptr_t)ntohl(fileInfo->user_data_size)); d_printf("File name \"%s\"\n", fileInfo->file_name); d_printf("Creation date \"%s\"\n", fileInfo->create_date); d_printf("Creator \"%s\"\n", fileInfo->creator); d_printf("Project \"%s\"\n", fileInfo->project); d_printf("Copyright \"%s\"\n", fileInfo->copyright); - d_printf("Key %ld\n", (long)ntohl(fileInfo->key)); + d_printf("Key %ld\n", (intptr_t)ntohl(fileInfo->key)); } static void @@ -150,8 +150,8 @@ dumpDpxImageInfo(DpxImageInformation* imageInfo) { d_printf("Image orientation %d,", ntohs(imageInfo->orientation)); n = ntohs(imageInfo->channels_per_image); d_printf("Channels %d\n", n); - d_printf("Pixels per line %ld\n", (long)ntohl(imageInfo->pixels_per_line)); - d_printf("Lines per image %ld\n", (long)ntohl(imageInfo->lines_per_image)); + d_printf("Pixels per line %ld\n", (intptr_t)ntohl(imageInfo->pixels_per_line)); + d_printf("Lines per image %ld\n", (intptr_t)ntohl(imageInfo->lines_per_image)); for (i = 0; i < n; ++i) { d_printf(" --Channel %d--\n", i); dumpDpxChannelInfo(&imageInfo->channel[i]); @@ -166,12 +166,12 @@ fillDpxOriginationInfo( static void dumpDpxOriginationInfo(DpxOriginationInformation* originInfo) { d_printf("\n--Origination Information--\n"); - d_printf("X offset %ld\n", (long)ntohl(originInfo->x_offset)); - d_printf("Y offset %ld\n", (long)ntohl(originInfo->y_offset)); + d_printf("X offset %ld\n", (intptr_t)ntohl(originInfo->x_offset)); + d_printf("Y offset %ld\n", (intptr_t)ntohl(originInfo->y_offset)); d_printf("X centre %f\n", ntohf(originInfo->x_centre)); d_printf("Y centre %f\n", ntohf(originInfo->y_centre)); - d_printf("Original X %ld\n", (long)ntohl(originInfo->x_original_size)); - d_printf("Original Y %ld\n", (long)ntohl(originInfo->y_original_size)); + d_printf("Original X %ld\n", (intptr_t)ntohl(originInfo->x_original_size)); + d_printf("Original Y %ld\n", (intptr_t)ntohl(originInfo->y_original_size)); d_printf("File name \"%s\"\n", originInfo->file_name); d_printf("Creation time \"%s\"\n", originInfo->creation_time); d_printf("Input device \"%s\"\n", originInfo->input_device); @@ -417,7 +417,7 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) { /* let's assume dpx files are always network order */ if (header.fileInfo.magic_num != ntohl(DPX_FILE_MAGIC)) { if (verbose) d_printf("Bad magic number %8.8lX in \"%s\".\n", - (unsigned long)ntohl(header.fileInfo.magic_num), filename); + (uintptr_t)ntohl(header.fileInfo.magic_num), filename); dpxClose(dpx); return 0; } diff --git a/source/blender/imbuf/intern/cineon/logImageCore.h b/source/blender/imbuf/intern/cineon/logImageCore.h index 01eff8d570d..b23509bb94d 100644 --- a/source/blender/imbuf/intern/cineon/logImageCore.h +++ b/source/blender/imbuf/intern/cineon/logImageCore.h @@ -80,7 +80,7 @@ struct _Log_Image_File_t_ CloseFn* close; unsigned char *membuffer; - unsigned long membuffersize; + uintptr_t membuffersize; unsigned char *memcursor; }; diff --git a/source/blender/imbuf/intern/cineon/logmemfile.c b/source/blender/imbuf/intern/cineon/logmemfile.c index 20359335933..160e8453713 100644 --- a/source/blender/imbuf/intern/cineon/logmemfile.c +++ b/source/blender/imbuf/intern/cineon/logmemfile.c @@ -24,10 +24,10 @@ #include "logImageCore.h" -int logimage_fseek(void* logfile, long offsett, int origin) +int logimage_fseek(void* logfile, intptr_t offsett, int origin) { struct _Log_Image_File_t_ *file = (struct _Log_Image_File_t_*) logfile; - long offset = offsett; + intptr_t offset = offsett; if (file->file) fseek(file->file, offset, origin); else { /*we're seeking in memory*/ @@ -38,7 +38,7 @@ int logimage_fseek(void* logfile, long offsett, int origin) if (offset > file->membuffersize) return 1; file->memcursor = (file->membuffer + file->membuffersize) - offset; } else if (origin==SEEK_CUR) { - unsigned long pos = (unsigned long)file->membuffer - (unsigned long)file->memcursor; + uintptr_t pos = (uintptr_t)file->membuffer - (uintptr_t)file->memcursor; if (pos + offset > file->membuffersize) return 1; if (pos < 0) return 1; file->memcursor += offset; diff --git a/source/blender/imbuf/intern/cineon/logmemfile.h b/source/blender/imbuf/intern/cineon/logmemfile.h index 6e82cf2b145..39e2f36dad9 100644 --- a/source/blender/imbuf/intern/cineon/logmemfile.h +++ b/source/blender/imbuf/intern/cineon/logmemfile.h @@ -22,7 +22,7 @@ #ifndef _LOGMEMFILE_H #define _LOGMEMFILE_H -int logimage_fseek(void* logfile, long offsett, int origin); +int logimage_fseek(void* logfile, intptr_t offsett, int origin); int logimage_fwrite(void *buffer, unsigned int size, unsigned int count, void *logfile); int logimage_fread(void *buffer, unsigned int size, unsigned int count, void *logfile); diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 40c1f83c98c..66a38223b4c 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -490,8 +490,8 @@ static void enlarge_picture_byte( / (double) (src_width - 1.001); double ratioy = (double) (dst_height - 1.0) / (double) (src_height - 1.001); - unsigned long x_src, dx_src, x_dst; - unsigned long y_src, dy_src, y_dst; + uintptr_t x_src, dx_src, x_dst; + uintptr_t y_src, dy_src, y_dst; dx_src = 65536.0 / ratiox; dy_src = 65536.0 / ratioy; @@ -500,8 +500,8 @@ static void enlarge_picture_byte( for (y_dst = 0; y_dst < dst_height; y_dst++) { unsigned char* line1 = src + (y_src >> 16) * 4 * src_width; unsigned char* line2 = line1 + 4 * src_width; - unsigned long weight1y = 65536 - (y_src & 0xffff); - unsigned long weight2y = 65536 - weight1y; + uintptr_t weight1y = 65536 - (y_src & 0xffff); + uintptr_t weight2y = 65536 - weight1y; if ((y_src >> 16) == src_height - 1) { line2 = line1; @@ -509,8 +509,8 @@ static void enlarge_picture_byte( x_src = 0; for (x_dst = 0; x_dst < dst_width; x_dst++) { - unsigned long weight1x = 65536 - (x_src & 0xffff); - unsigned long weight2x = 65536 - weight1x; + uintptr_t weight1x = 65536 - (x_src & 0xffff); + uintptr_t weight2x = 65536 - weight1x; unsigned long x = (x_src >> 16) * 4; @@ -557,12 +557,12 @@ static void enlarge_picture_byte( } struct scale_outpix_byte { - unsigned long r; - unsigned long g; - unsigned long b; - unsigned long a; + uintptr_t r; + uintptr_t g; + uintptr_t b; + uintptr_t a; - unsigned long weight; + uintptr_t weight; }; static void shrink_picture_byte( @@ -571,9 +571,9 @@ static void shrink_picture_byte( { double ratiox = (double) (dst_width) / (double) (src_width); double ratioy = (double) (dst_height) / (double) (src_height); - unsigned long x_src, dx_dst, x_dst; - unsigned long y_src, dy_dst, y_dst; - long y_counter; + uintptr_t x_src, dx_dst, x_dst; + uintptr_t y_src, dy_dst, y_dst; + intptr_t y_counter; unsigned char * dst_begin = dst; struct scale_outpix_byte * dst_line1 = NULL; @@ -593,16 +593,16 @@ static void shrink_picture_byte( y_counter = 65536; for (y_src = 0; y_src < src_height; y_src++) { unsigned char* line = src + y_src * 4 * src_width; - unsigned long weight1y = 65536 - (y_dst & 0xffff); - unsigned long weight2y = 65536 - weight1y; + uintptr_t weight1y = 65536 - (y_dst & 0xffff); + uintptr_t weight2y = 65536 - weight1y; x_dst = 0; for (x_src = 0; x_src < src_width; x_src++) { - unsigned long weight1x = 65536 - (x_dst & 0xffff); - unsigned long weight2x = 65536 - weight1x; + uintptr_t weight1x = 65536 - (x_dst & 0xffff); + uintptr_t weight2x = 65536 - weight1x; - unsigned long x = x_dst >> 16; + uintptr_t x = x_dst >> 16; - unsigned long w; + uintptr_t w; w = (weight1y * weight1x) >> 16; @@ -643,13 +643,13 @@ static void shrink_picture_byte( y_dst += dy_dst; y_counter -= dy_dst; if (y_counter < 0) { - unsigned long x; + uintptr_t x; struct scale_outpix_byte * temp; y_counter += 65536; for (x=0; x < dst_width; x++) { - unsigned long f = 0x80000000UL + uintptr_t f = 0x80000000UL / dst_line1[x].weight; *dst++ = (dst_line1[x].r * f) >> 15; *dst++ = (dst_line1[x].g * f) >> 15; @@ -664,9 +664,9 @@ static void shrink_picture_byte( } } if (dst - dst_begin < dst_width * dst_height * 4) { - unsigned long x; + uintptr_t x; for (x = 0; x < dst_width; x++) { - unsigned long f = 0x80000000UL / dst_line1[x].weight; + uintptr_t f = 0x80000000UL / dst_line1[x].weight; *dst++ = (dst_line1[x].r * f) >> 15; *dst++ = (dst_line1[x].g * f) >> 15; *dst++ = (dst_line1[x].b * f) >> 15; @@ -698,8 +698,8 @@ static void enlarge_picture_float( / (double) (src_width - 1.001); double ratioy = (double) (dst_height - 1.0) / (double) (src_height - 1.001); - unsigned long x_dst; - unsigned long y_dst; + uintptr_t x_dst; + uintptr_t y_dst; double x_src, dx_src; double y_src, dy_src; @@ -727,7 +727,7 @@ static void enlarge_picture_float( float w12 = weight1y * weight2x; float w22 = weight2y * weight2x; - unsigned long x = ((int) x_src) * 4; + uintptr_t x = ((int) x_src) * 4; *dst++ = line1[x] * w11 + line2[x] * w21 @@ -770,8 +770,8 @@ static void shrink_picture_float( { double ratiox = (double) (dst_width) / (double) (src_width); double ratioy = (double) (dst_height) / (double) (src_height); - unsigned long x_src; - unsigned long y_src; + uintptr_t x_src; + uintptr_t y_src; float dx_dst, x_dst; float dy_dst, y_dst; float y_counter; @@ -794,14 +794,14 @@ static void shrink_picture_float( y_counter = 1.0; for (y_src = 0; y_src < src_height; y_src++) { float* line = src + y_src * 4 * src_width; - unsigned long weight1y = 1.0 - (y_dst - (int) y_dst); - unsigned long weight2y = 1.0 - weight1y; + uintptr_t weight1y = 1.0 - (y_dst - (int) y_dst); + uintptr_t weight2y = 1.0 - weight1y; x_dst = 0; for (x_src = 0; x_src < src_width; x_src++) { - unsigned long weight1x = 1.0 - (x_dst - (int) x_dst); - unsigned long weight2x = 1.0 - weight1x; + uintptr_t weight1x = 1.0 - (x_dst - (int) x_dst); + uintptr_t weight2x = 1.0 - weight1x; - unsigned long x = (int) x_dst; + uintptr_t x = (int) x_dst; float w; @@ -844,7 +844,7 @@ static void shrink_picture_float( y_dst += dy_dst; y_counter -= dy_dst; if (y_counter < 0) { - unsigned long x; + uintptr_t x; struct scale_outpix_float * temp; y_counter += 1.0; @@ -864,7 +864,7 @@ static void shrink_picture_float( } } if (dst - dst_begin < dst_width * dst_height * 4) { - unsigned long x; + uintptr_t x; for (x = 0; x < dst_width; x++) { float f = 1.0 / dst_line1[x].weight; *dst++ = dst_line1[x].r * f; |