Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/IMB_imbuf.h16
-rw-r--r--source/blender/imbuf/intern/anim_movie.c23
-rw-r--r--source/blender/imbuf/intern/colormanagement.c12
-rw-r--r--source/blender/imbuf/intern/divers.c16
-rw-r--r--source/blender/imbuf/intern/imbuf.h3
-rw-r--r--source/blender/imbuf/intern/indexer.c22
-rw-r--r--source/blender/imbuf/intern/indexer_dv.c4
-rw-r--r--source/blender/imbuf/intern/jp2.c12
-rw-r--r--source/blender/imbuf/intern/jpeg.c16
-rw-r--r--source/blender/imbuf/intern/moviecache.c8
-rw-r--r--source/blender/imbuf/intern/scaling.c26
-rw-r--r--source/blender/imbuf/intern/targa.c4
-rw-r--r--source/blender/imbuf/intern/util.c14
-rw-r--r--source/blender/imbuf/intern/writeimage.c6
14 files changed, 91 insertions, 91 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index be0069f5bfa..c941f1b065e 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -240,11 +240,11 @@ int IMB_anim_get_duration(struct anim *anim, IMB_Timecode_Type tc);
/**
- * Return the fps contained in movie files (function rval is FALSE,
+ * Return the fps contained in movie files (function rval is false,
* and frs_sec and frs_sec_base untouched if none available!)
*/
-int IMB_anim_get_fps(struct anim *anim,
- short *frs_sec, float *frs_sec_base);
+bool IMB_anim_get_fps(struct anim *anim,
+ short *frs_sec, float *frs_sec_base);
/**
*
@@ -354,7 +354,7 @@ short IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags);
*
* \attention Defined in util.c
*/
-int IMB_ispic(const char *name);
+bool IMB_ispic(const char *name);
/**
*
@@ -386,16 +386,16 @@ void IMB_saturation(struct ImBuf *ibuf, float sat);
/* converting pixel buffers */
void IMB_buffer_byte_from_float(unsigned char *rect_to, const float *rect_from,
- int channels_from, float dither, int profile_to, int profile_from, int predivide,
+ int channels_from, float dither, int profile_to, int profile_from, bool predivide,
int width, int height, int stride_to, int stride_from);
void IMB_buffer_float_from_byte(float *rect_to, const unsigned char *rect_from,
- int profile_to, int profile_from, int predivide,
+ int profile_to, int profile_from, bool predivide,
int width, int height, int stride_to, int stride_from);
void IMB_buffer_float_from_float(float *rect_to, const float *rect_from,
- int channels_from, int profile_to, int profile_from, int predivide,
+ int channels_from, int profile_to, int profile_from, bool predivide,
int width, int height, int stride_to, int stride_from);
void IMB_buffer_byte_from_byte(unsigned char *rect_to, const unsigned char *rect_from,
- int profile_to, int profile_from, int predivide,
+ int profile_to, int profile_from, bool predivide,
int width, int height, int stride_to, int stride_from);
void IMB_buffer_float_clamp(float *buf, int width, int height);
void IMB_buffer_float_unpremultiply(float *buf, int width, int height);
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index a6c51b1d397..40fdf19ccc1 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -147,7 +147,8 @@ static void free_anim_movie(struct anim *UNUSED(anim))
static int an_stringdec(const char *string, char *head, char *tail, unsigned short *numlen)
{
unsigned short len, nume, nums = 0;
- short i, found = FALSE;
+ short i;
+ bool found = false;
len = strlen(string);
nume = len;
@@ -161,7 +162,7 @@ static int an_stringdec(const char *string, char *head, char *tail, unsigned sho
else {
nume = i;
nums = i;
- found = TRUE;
+ found = true;
}
}
else {
@@ -178,7 +179,7 @@ static int an_stringdec(const char *string, char *head, char *tail, unsigned sho
tail[0] = '\0';
strcpy(head, string);
*numlen = 0;
- return TRUE;
+ return true;
}
@@ -567,7 +568,7 @@ static int startffmpeg(struct anim *anim)
anim->next_packet.stream_index = -1;
anim->pFrame = avcodec_alloc_frame();
- anim->pFrameComplete = FALSE;
+ anim->pFrameComplete = false;
anim->pFrameDeinterlaced = avcodec_alloc_frame();
anim->pFrameRGB = avcodec_alloc_frame();
@@ -690,7 +691,7 @@ static void ffmpeg_postprocess(struct anim *anim)
anim->pCodecCtx->width,
anim->pCodecCtx->height) < 0)
{
- filter_y = TRUE;
+ filter_y = true;
}
else {
input = anim->pFrameDeinterlaced;
@@ -936,18 +937,18 @@ static int ffmpeg_seek_by_byte(AVFormatContext *pFormatCtx)
const char **p;
if (pFormatCtx->iformat->flags & AVFMT_TS_DISCONT) {
- return TRUE;
+ return true;
}
p = byte_seek_list;
while (*p) {
if (match_format(*p++, pFormatCtx)) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
@@ -1425,15 +1426,15 @@ int IMB_anim_get_duration(struct anim *anim, IMB_Timecode_Type tc)
return IMB_indexer_get_duration(idx);
}
-int IMB_anim_get_fps(struct anim *anim,
+bool IMB_anim_get_fps(struct anim *anim,
short *frs_sec, float *frs_sec_base)
{
if (anim->frs_sec) {
*frs_sec = anim->frs_sec;
*frs_sec_base = anim->frs_sec_base;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void IMB_anim_set_preseek(struct anim *anim, int preseek)
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index efd3037cda0..8aa9615feac 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -1404,12 +1404,12 @@ static void *do_display_buffer_apply_thread(void *handle_v)
if (cm_processor == NULL) {
if (display_buffer_byte) {
IMB_buffer_byte_from_byte(display_buffer_byte, handle->byte_buffer, IB_PROFILE_SRGB, IB_PROFILE_SRGB,
- FALSE, width, height, width, width);
+ false, width, height, width, width);
}
if (display_buffer) {
IMB_buffer_float_from_byte(display_buffer, handle->byte_buffer, IB_PROFILE_SRGB, IB_PROFILE_SRGB,
- FALSE, width, height, width, width);
+ false, width, height, width, width);
}
}
else {
@@ -1976,7 +1976,7 @@ void IMB_colormanagement_buffer_make_display_space(float *buffer, unsigned char
IMB_buffer_byte_from_float(display_buffer, display_buffer_float,
channels, dither, IB_PROFILE_SRGB, IB_PROFILE_SRGB,
- TRUE, width, height, width, width);
+ true, width, height, width, width);
MEM_freeN(display_buffer_float);
IMB_colormanagement_processor_free(cm_processor);
@@ -2095,7 +2095,7 @@ void IMB_display_buffer_transform_apply(unsigned char *display_buffer, float *li
IMB_colormanagement_processor_free(cm_processor);
IMB_buffer_byte_from_float(display_buffer, buffer, channels, 0.0f, IB_PROFILE_SRGB, IB_PROFILE_SRGB,
- FALSE, width, height, width, width);
+ false, width, height, width, width);
MEM_freeN(buffer);
}
@@ -2704,7 +2704,7 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
if (display_buffer_float) {
/* huh, for dither we need float buffer first, no cheaper way. currently */
IMB_buffer_float_from_byte(display_buffer_float, byte_buffer,
- IB_PROFILE_SRGB, IB_PROFILE_SRGB, TRUE,
+ IB_PROFILE_SRGB, IB_PROFILE_SRGB, true,
width, height, width, display_stride);
}
else {
@@ -2723,7 +2723,7 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
int display_index = (ymin * display_stride + xmin) * channels;
IMB_buffer_byte_from_float(display_buffer + display_index, display_buffer_float, channels, dither,
- IB_PROFILE_SRGB, IB_PROFILE_SRGB, TRUE, width, height, display_stride, width);
+ IB_PROFILE_SRGB, IB_PROFILE_SRGB, true, width, height, display_stride, width);
MEM_freeN(display_buffer_float);
}
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index 6f6169b6a92..ef1bc9eaafa 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -175,7 +175,7 @@ MINLINE void float_to_byte_dither_v4(uchar b[4], const float f[4], DitherContext
/* float to byte pixels, output 4-channel RGBA */
void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
- int channels_from, float dither, int profile_to, int profile_from, int predivide,
+ int channels_from, float dither, int profile_to, int profile_from, bool predivide,
int width, int height, int stride_to, int stride_from)
{
float tmp[4];
@@ -329,7 +329,7 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
/* byte to float pixels, input and output 4-channel RGBA */
void IMB_buffer_float_from_byte(float *rect_to, const uchar *rect_from,
- int profile_to, int profile_from, int predivide,
+ int profile_to, int profile_from, bool predivide,
int width, int height, int stride_to, int stride_from)
{
float tmp[4];
@@ -382,7 +382,7 @@ void IMB_buffer_float_from_byte(float *rect_to, const uchar *rect_from,
/* float to float pixels, output 4-channel RGBA */
void IMB_buffer_float_from_float(float *rect_to, const float *rect_from,
- int channels_from, int profile_to, int profile_from, int predivide,
+ int channels_from, int profile_to, int profile_from, bool predivide,
int width, int height, int stride_to, int stride_from)
{
int x, y;
@@ -468,7 +468,7 @@ void IMB_buffer_float_from_float(float *rect_to, const float *rect_from,
/* byte to byte pixels, input and output 4-channel RGBA */
void IMB_buffer_byte_from_byte(uchar *rect_to, const uchar *rect_from,
- int profile_to, int profile_from, int predivide,
+ int profile_to, int profile_from, bool predivide,
int width, int height, int stride_to, int stride_from)
{
float tmp[4];
@@ -556,7 +556,7 @@ void IMB_rect_from_float(ImBuf *ibuf)
/* convert float to byte */
IMB_buffer_byte_from_float((unsigned char *) ibuf->rect, buffer, ibuf->channels, ibuf->dither, IB_PROFILE_SRGB, IB_PROFILE_SRGB,
- FALSE, ibuf->x, ibuf->y, ibuf->x, ibuf->x);
+ false, ibuf->x, ibuf->y, ibuf->x, ibuf->x);
MEM_freeN(buffer);
@@ -591,12 +591,12 @@ void IMB_partial_rect_from_float(ImBuf *ibuf, float *buffer, int x, int y, int w
/* and do color space conversion to byte */
IMB_buffer_byte_from_float(rect_byte, rect_float,
- 4, ibuf->dither, IB_PROFILE_SRGB, profile_from, TRUE,
+ 4, ibuf->dither, IB_PROFILE_SRGB, profile_from, true,
w, h, ibuf->x, w);
}
else {
IMB_buffer_float_from_float(buffer, rect_float,
- ibuf->channels, IB_PROFILE_SRGB, profile_from, TRUE,
+ ibuf->channels, IB_PROFILE_SRGB, profile_from, true,
w, h, w, ibuf->x);
/* XXX: need to convert to image buffer's rect space */
@@ -637,7 +637,7 @@ void IMB_float_from_rect(ImBuf *ibuf)
/* first, create float buffer in non-linear space */
IMB_buffer_float_from_byte(rect_float, (unsigned char *) ibuf->rect, IB_PROFILE_SRGB, IB_PROFILE_SRGB,
- FALSE, ibuf->x, ibuf->y, ibuf->x, ibuf->x);
+ false, ibuf->x, ibuf->y, ibuf->x, ibuf->x);
/* then make float be in linear space */
IMB_colormanagement_colorspace_to_scene_linear(rect_float, ibuf->x, ibuf->y, ibuf->channels,
diff --git a/source/blender/imbuf/intern/imbuf.h b/source/blender/imbuf/intern/imbuf.h
index 999aae81cb7..897a149a45c 100644
--- a/source/blender/imbuf/intern/imbuf.h
+++ b/source/blender/imbuf/intern/imbuf.h
@@ -69,9 +69,6 @@
typedef unsigned char uchar;
-#define TRUE 1
-#define FALSE 0
-
#define IMB_DPI_DEFAULT 72.0f
#endif /* __IMBUF_H__ */
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 14967c32477..841e13d3ff1 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -376,7 +376,7 @@ static void get_index_dir(struct anim *anim, char *index_dir, size_t index_dir_l
}
static void get_proxy_filename(struct anim *anim, IMB_Proxy_Size preview_size,
- char *fname, int temp)
+ char *fname, bool temp)
{
char index_dir[FILE_MAXDIR];
int i = IMB_proxy_size_to_array_index(preview_size);
@@ -484,7 +484,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg(
rv->proxy_size = proxy_size;
rv->anim = anim;
- get_proxy_filename(rv->anim, rv->proxy_size, fname, TRUE);
+ get_proxy_filename(rv->anim, rv->proxy_size, fname, true);
BLI_make_existing_file(fname);
rv->of = avformat_alloc_context();
@@ -677,14 +677,14 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx *ctx,
}
get_proxy_filename(ctx->anim, ctx->proxy_size,
- fname_tmp, TRUE);
+ fname_tmp, true);
if (rollback) {
unlink(fname_tmp);
}
else {
get_proxy_filename(ctx->anim, ctx->proxy_size,
- fname, FALSE);
+ fname, false);
unlink(fname);
BLI_rename(fname_tmp, fname);
}
@@ -856,7 +856,7 @@ static void index_rebuild_ffmpeg_proc_decoded_frame(
if (!context->start_pts_set) {
context->start_pts = pts;
- context->start_pts_set = TRUE;
+ context->start_pts_set = true;
}
context->frameno = floor((pts - context->start_pts) *
@@ -917,7 +917,7 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context,
if (*progress != next_progress) {
*progress = next_progress;
- *do_update = TRUE;
+ *do_update = true;
}
if (*stop) {
@@ -1056,7 +1056,7 @@ static IndexBuildContext *index_fallback_create_context(struct anim *anim, IMB_T
if (context->proxy_sizes_in_use & proxy_sizes[i]) {
char fname[FILE_MAX];
- get_proxy_filename(anim, proxy_sizes[i], fname, TRUE);
+ get_proxy_filename(anim, proxy_sizes[i], fname, true);
BLI_make_existing_file(fname);
context->proxy_ctx[i] = alloc_proxy_output_avi(anim, fname,
@@ -1079,8 +1079,8 @@ static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context,
AVI_close_compress(context->proxy_ctx[i]);
MEM_freeN(context->proxy_ctx[i]);
- get_proxy_filename(anim, proxy_sizes[i], fname_tmp, TRUE);
- get_proxy_filename(anim, proxy_sizes[i], fname, FALSE);
+ get_proxy_filename(anim, proxy_sizes[i], fname_tmp, true);
+ get_proxy_filename(anim, proxy_sizes[i], fname, false);
if (stop) {
unlink(fname_tmp);
@@ -1107,7 +1107,7 @@ static void index_rebuild_fallback(FallbackIndexBuilderContext *context,
if (*progress != next_progress) {
*progress = next_progress;
- *do_update = TRUE;
+ *do_update = true;
}
if (*stop) {
@@ -1261,7 +1261,7 @@ struct anim *IMB_anim_open_proxy(
return NULL;
}
- get_proxy_filename(anim, preview_size, fname, FALSE);
+ get_proxy_filename(anim, preview_size, fname, false);
/* proxies are generated in the same color space as animation itself */
anim->proxy_anim[i] = IMB_open_anim(fname, 0, 0, anim->colorspace);
diff --git a/source/blender/imbuf/intern/indexer_dv.c b/source/blender/imbuf/intern/indexer_dv.c
index 4e8c13d2e99..f456fc420b2 100644
--- a/source/blender/imbuf/intern/indexer_dv.c
+++ b/source/blender/imbuf/intern/indexer_dv.c
@@ -351,8 +351,8 @@ static void indexer_dv_proc_frame(anim_index_builder *idx,
isPAL = (buffer[3] & 0x80);
- This->got_record_date = FALSE;
- This->got_record_time = FALSE;
+ This->got_record_date = false;
+ This->got_record_time = false;
parse_frame(This, buffer, isPAL);
proc_frame(This, buffer, isPAL);
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index f4ac4322747..18c096450af 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -122,8 +122,8 @@ static void info_callback(const char *msg, void *client_data)
struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
{
struct ImBuf *ibuf = NULL;
- int use_float = FALSE; /* for precision higher then 8 use float */
- int use_alpha = FALSE;
+ bool use_float = false; /* for precision higher then 8 use float */
+ bool use_alpha = false;
long signed_offsets[4] = {0, 0, 0, 0};
int float_divs[4] = {1, 1, 1, 1};
@@ -201,11 +201,11 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags, char co
case 1: /* Grayscale */
case 3: /* Color */
planes = 24;
- use_alpha = FALSE;
+ use_alpha = false;
break;
default: /* 2 or 4 - Grayscale or Color + alpha */
planes = 32; /* grayscale + alpha */
- use_alpha = TRUE;
+ use_alpha = true;
break;
}
@@ -217,7 +217,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags, char co
i--;
if (image->comps[i].prec > 8)
- use_float = TRUE;
+ use_float = true;
if (image->comps[i].sgnd)
signed_offsets[i] = 1 << (image->comps[i].prec - 1);
@@ -432,7 +432,7 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres)
static void cinema_parameters(opj_cparameters_t *parameters)
{
- parameters->tile_size_on = 0; /* FALSE */
+ parameters->tile_size_on = 0; /* false */
parameters->cp_tdx = 1;
parameters->cp_tdy = 1;
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index a31ed5e7420..f8a8beb72bc 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -157,7 +157,7 @@ static boolean fill_input_buffer(j_decompress_ptr cinfo)
src->terminal[0] = (JOCTET) 0xFF;
src->terminal[1] = (JOCTET) JPEG_EOI;
- return TRUE;
+ return true;
}
@@ -234,7 +234,7 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t
/* Read a byte into variable V.
- * If must suspend, take the specified action (typically "return FALSE").
+ * If must suspend, take the specified action (typically "return false").
*/
#define INPUT_BYTE(cinfo, V, action) \
MAKESTMT(MAKE_BYTE_AVAIL(cinfo, action); \
@@ -262,18 +262,18 @@ handle_app1(j_decompress_ptr cinfo)
INPUT_VARS(cinfo);
- INPUT_2BYTES(cinfo, length, return FALSE);
+ INPUT_2BYTES(cinfo, length, return false);
length -= 2;
if (length < 16) {
- for (i = 0; i < length; i++) INPUT_BYTE(cinfo, neogeo[i], return FALSE);
+ for (i = 0; i < length; i++) INPUT_BYTE(cinfo, neogeo[i], return false);
length = 0;
if (strncmp(neogeo, "NeoGeo", 6) == 0) memcpy(&ibuf_ftype, neogeo + 6, 4);
ibuf_ftype = BIG_LONG(ibuf_ftype);
}
INPUT_SYNC(cinfo); /* do before skip_input_data */
if (length > 0) (*cinfo->src->skip_input_data)(cinfo, length);
- return TRUE;
+ return true;
}
@@ -294,7 +294,7 @@ static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo, int fla
cinfo->dct_method = JDCT_FLOAT;
jpeg_save_markers(cinfo, JPEG_COM, 0xffff);
- if (jpeg_read_header(cinfo, FALSE) == JPEG_HEADER_OK) {
+ if (jpeg_read_header(cinfo, false) == JPEG_HEADER_OK) {
x = cinfo->image_width;
y = cinfo->image_height;
depth = cinfo->num_components;
@@ -482,7 +482,7 @@ static void write_jpeg(struct jpeg_compress_struct *cinfo, struct ImBuf *ibuf)
ImMetaData *iptr;
char *text;
- jpeg_start_compress(cinfo, TRUE);
+ jpeg_start_compress(cinfo, true);
strcpy(neogeo, "NeoGeo");
ibuf_ftype = BIG_LONG(ibuf->ftype);
@@ -600,7 +600,7 @@ static int init_jpeg(FILE *outfile, struct jpeg_compress_struct *cinfo, struct I
/* own settings */
cinfo->dct_method = JDCT_FLOAT;
- jpeg_set_quality(cinfo, quality, TRUE);
+ jpeg_set_quality(cinfo, quality, true);
return(0);
}
diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c
index f699afd3475..6b2251eb24a 100644
--- a/source/blender/imbuf/intern/moviecache.c
+++ b/source/blender/imbuf/intern/moviecache.c
@@ -335,7 +335,7 @@ void IMB_moviecache_set_priority_callback(struct MovieCache *cache, MovieCacheGe
cache->prioritydeleterfp = prioritydeleterfp;
}
-static void do_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf, int need_lock)
+static void do_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf, bool need_lock)
{
MovieCacheKey *key;
MovieCacheItem *item;
@@ -393,7 +393,7 @@ static void do_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf, int
void IMB_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf)
{
- do_moviecache_put(cache, userkey, ibuf, TRUE);
+ do_moviecache_put(cache, userkey, ibuf, true);
}
bool IMB_moviecache_put_if_possible(MovieCache *cache, void *userkey, ImBuf *ibuf)
@@ -408,8 +408,8 @@ bool IMB_moviecache_put_if_possible(MovieCache *cache, void *userkey, ImBuf *ibu
mem_in_use = MEM_CacheLimiter_get_memory_in_use(limitor);
if (mem_in_use + elem_size <= mem_limit) {
- do_moviecache_put(cache, userkey, ibuf, FALSE);
- result = TRUE;
+ do_moviecache_put(cache, userkey, ibuf, false);
+ result = true;
}
BLI_mutex_unlock(&limitor_lock);
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c
index 3c24864c671..d9cec1f3047 100644
--- a/source/blender/imbuf/intern/scaling.c
+++ b/source/blender/imbuf/intern/scaling.c
@@ -821,13 +821,13 @@ static void q_scale_float(float *in, float *out, int in_width,
*
* NOTE: disabled, due to unacceptable inaccuracy and quality loss, see bug #18609 (ton)
*/
-static int q_scale_linear_interpolation(
+static bool q_scale_linear_interpolation(
struct ImBuf *ibuf, int newx, int newy)
{
if ((newx >= ibuf->x && newy <= ibuf->y) ||
(newx <= ibuf->x && newy >= ibuf->y))
{
- return FALSE;
+ return false;
}
if (ibuf->rect) {
@@ -853,7 +853,7 @@ static int q_scale_linear_interpolation(
ibuf->x = newx;
ibuf->y = newy;
- return TRUE;
+ return true;
}
static ImBuf *scaledownx(struct ImBuf *ibuf, int newx)
@@ -1141,12 +1141,12 @@ static ImBuf *scaleupx(struct ImBuf *ibuf, int newx)
if (ibuf->rect == NULL && ibuf->rect_float == NULL) return (ibuf);
if (ibuf->rect) {
- do_rect = TRUE;
+ do_rect = true;
_newrect = MEM_mallocN(newx * ibuf->y * sizeof(int), "scaleupx");
if (_newrect == NULL) return(ibuf);
}
if (ibuf->rect_float) {
- do_float = TRUE;
+ do_float = true;
_newrectf = MEM_mallocN(newx * ibuf->y * sizeof(float) * 4, "scaleupxf");
if (_newrectf == NULL) {
if (_newrect) MEM_freeN(_newrect);
@@ -1298,7 +1298,8 @@ static ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
float val_bf, nval_bf, diff_bf;
float val_gf, nval_gf, diff_gf;
float val_rf, nval_rf, diff_rf;
- int x, y, do_rect = FALSE, do_float = FALSE, skipx;
+ int x, y, skipx;
+ bool do_rect = false, do_float = false;
val_a = nval_a = diff_a = val_b = nval_b = diff_b = 0;
val_g = nval_g = diff_g = val_r = nval_r = diff_r = 0;
@@ -1308,12 +1309,12 @@ static ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
if (ibuf->rect == NULL && ibuf->rect_float == NULL) return (ibuf);
if (ibuf->rect) {
- do_rect = TRUE;
+ do_rect = true;
_newrect = MEM_mallocN(ibuf->x * newy * sizeof(int), "scaleupy");
if (_newrect == NULL) return(ibuf);
}
if (ibuf->rect_float) {
- do_float = TRUE;
+ do_float = true;
_newrectf = MEM_mallocN(ibuf->x * newy * sizeof(float) * 4, "scaleupyf");
if (_newrectf == NULL) {
if (_newrect) MEM_freeN(_newrect);
@@ -1527,16 +1528,17 @@ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned
{
unsigned int *rect, *_newrect, *newrect;
struct imbufRGBA *rectf, *_newrectf, *newrectf;
- int x, y, do_float = FALSE, do_rect = FALSE;
+ int x, y;
+ bool do_float = false, do_rect = false;
int ofsx, ofsy, stepx, stepy;
rect = NULL; _newrect = NULL; newrect = NULL;
rectf = NULL; _newrectf = NULL; newrectf = NULL;
if (ibuf == NULL) return(NULL);
- if (ibuf->rect) do_rect = TRUE;
- if (ibuf->rect_float) do_float = TRUE;
- if (do_rect == FALSE && do_float == FALSE) return(ibuf);
+ if (ibuf->rect) do_rect = true;
+ if (ibuf->rect_float) do_float = true;
+ if (do_rect == false && do_float == false) return(ibuf);
if (newx == ibuf->x && newy == ibuf->y) return(ibuf);
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index 6dbd7a4027e..07c6bb6f84f 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -163,7 +163,7 @@ static short makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE
rect = temp;
last = this;
- copy = FALSE;
+ copy = 0;
}
else {
while (*rect++ == this) { /* seek for first different byte */
@@ -189,7 +189,7 @@ static short makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE
}
if (out(last, file) == EOF) return 0;
}
- copy = TRUE;
+ copy = 1;
}
}
}
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index 9259c4f743d..a91990774fc 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -183,7 +183,7 @@ const char *imb_ext_audio[] = {
NULL
};
-int IMB_ispic(const char *name)
+bool IMB_ispic(const char *name)
{
/* increased from 32 to 64 because of the bitmaps header size */
#define HEADER_SIZE 64
@@ -196,17 +196,17 @@ int IMB_ispic(const char *name)
if (UTIL_DEBUG) printf("IMB_ispic_name: loading %s\n", name);
if (BLI_stat(name, &st) == -1)
- return FALSE;
+ return false;
if (((st.st_mode) & S_IFMT) != S_IFREG)
- return FALSE;
+ return false;
if ((fp = BLI_open(name, O_BINARY | O_RDONLY, 0)) < 0)
- return FALSE;
+ return false;
memset(buf, 0, sizeof(buf));
if (read(fp, buf, HEADER_SIZE) <= 0) {
close(fp);
- return FALSE;
+ return false;
}
close(fp);
@@ -228,7 +228,7 @@ int IMB_ispic(const char *name)
}
}
- return FALSE;
+ return false;
#undef HEADER_SIZE
}
@@ -240,7 +240,7 @@ static int isavi(const char *name)
return AVI_is_avi(name);
#else
(void)name;
- return FALSE;
+ return false;
#endif
}
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c
index 1519fc1990d..d4a9bf7dc09 100644
--- a/source/blender/imbuf/intern/writeimage.c
+++ b/source/blender/imbuf/intern/writeimage.c
@@ -64,13 +64,13 @@ short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
{
ImFileType *type;
- if (ibuf == NULL) return (FALSE);
+ if (ibuf == NULL) return (false);
ibuf->flags = flags;
for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) {
if (type->save && type->ftype(type, ibuf)) {
ImBuf *write_ibuf;
- short result = FALSE;
+ short result = false;
write_ibuf = prepare_write_imbuf(type, ibuf);
@@ -85,6 +85,6 @@ short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
fprintf(stderr, "Couldn't save picture.\n");
- return FALSE;
+ return false;
}