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:
authorCampbell Barton <ideasman42@gmail.com>2014-04-01 04:34:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-01 08:22:28 +0400
commit617557b08ea94e2b65a1697ddf0b79651204d92b (patch)
tree50b24bab075b42fa20456140c9a9681cfb01325b /source/blender/blenkernel/intern/image.c
parent2c00ecc738c04dc5dc22d4a6b81a1e937526ba6d (diff)
Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c71
1 files changed, 37 insertions, 34 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index b74424a1d28..76643678a0b 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -382,7 +382,7 @@ void BKE_image_make_local(struct Image *ima)
Tex *tex;
Brush *brush;
Mesh *me;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -403,14 +403,14 @@ void BKE_image_make_local(struct Image *ima)
for (tex = bmain->tex.first; tex; tex = tex->id.next) {
if (tex->ima == ima) {
- if (tex->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (tex->id.lib) is_lib = true;
+ else is_local = true;
}
}
for (brush = bmain->brush.first; brush; brush = brush->id.next) {
if (brush->clone.image == ima) {
- if (brush->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (brush->id.lib) is_lib = true;
+ else is_local = true;
}
}
for (me = bmain->mesh.first; me; me = me->id.next) {
@@ -424,8 +424,8 @@ void BKE_image_make_local(struct Image *ima)
for (a = 0; a < me->totface; a++, tface++) {
if (tface->tpage == ima) {
- if (me->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (me->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -442,8 +442,8 @@ void BKE_image_make_local(struct Image *ima)
for (a = 0; a < me->totpoly; a++, mtpoly++) {
if (mtpoly->tpage == ima) {
- if (me->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (me->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -452,7 +452,7 @@ void BKE_image_make_local(struct Image *ima)
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &ima->id);
extern_local_image(ima);
}
@@ -739,7 +739,7 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
/* both byte and float buffers are filling in sRGB space, need to linearize float buffer after BKE_image_buf_fill* functions */
IMB_buffer_float_from_float(rect_float, rect_float, ibuf->channels, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB,
- TRUE, ibuf->x, ibuf->y, ibuf->x, ibuf->x);
+ true, ibuf->x, ibuf->y, ibuf->x, ibuf->x);
}
return ibuf;
@@ -1156,7 +1156,7 @@ int BKE_imtype_requires_linear_float(const char imtype)
case R_IMF_IMTYPE_RADHDR:
case R_IMF_IMTYPE_OPENEXR:
case R_IMF_IMTYPE_MULTILAYER:
- return TRUE;
+ return true;
}
return 0;
}
@@ -1372,7 +1372,7 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
}
else {
- return FALSE;
+ return false;
}
}
@@ -1895,7 +1895,7 @@ bool BKE_imbuf_alpha_test(ImBuf *ibuf)
float *buf = ibuf->rect_float;
for (tot = ibuf->x * ibuf->y; tot--; buf += 4) {
if (buf[3] < 1.0f) {
- return TRUE;
+ return true;
}
}
}
@@ -1903,12 +1903,12 @@ bool BKE_imbuf_alpha_test(ImBuf *ibuf)
unsigned char *buf = (unsigned char *)ibuf->rect;
for (tot = ibuf->x * ibuf->y; tot--; buf += 4) {
if (buf[3] != 255) {
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
/* note: imf->planes is ignored here, its assumed the image channels
@@ -2055,7 +2055,7 @@ int BKE_imbuf_write(ImBuf *ibuf, const char *name, ImageFormatData *imf)
/* same as BKE_imbuf_write() but crappy workaround not to perminantly modify
* _some_, values in the imbuf */
int BKE_imbuf_write_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
- const short save_copy)
+ const bool save_copy)
{
ImBuf ibuf_back = *ibuf;
int ok;
@@ -2098,12 +2098,14 @@ static void do_makepicstring(char *string, const char *base, const char *relbase
do_add_image_extension(string, imtype, im_format);
}
-void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const ImageFormatData *im_format, const short use_ext, const short use_frames)
+void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame,
+ const ImageFormatData *im_format, const bool use_ext, const bool use_frames)
{
do_makepicstring(string, base, relbase, frame, im_format->imtype, im_format, use_ext, use_frames);
}
-void BKE_makepicstring_from_type(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames)
+void BKE_makepicstring_from_type(char *string, const char *base, const char *relbase, int frame,
+ const char imtype, const bool use_ext, const bool use_frames)
{
do_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames);
}
@@ -2441,7 +2443,7 @@ void BKE_image_backup_render(Scene *scene, Image *ima)
static void image_create_multilayer(Image *ima, ImBuf *ibuf, int framenr)
{
const char *colorspace = ima->colorspace_settings.name;
- int predivide = ima->alpha_mode == IMA_ALPHA_PREMUL;
+ bool predivide = (ima->alpha_mode == IMA_ALPHA_PREMUL);
ima->rr = RE_MultilayerConvert(ibuf->userdata, colorspace, predivide, ibuf->x, ibuf->y);
@@ -3004,16 +3006,16 @@ static ImBuf *image_get_cached_ibuf(Image *ima, ImageUser *iuser, int *r_frame,
BLI_INLINE bool image_quick_test(Image *ima, ImageUser *iuser)
{
if (ima == NULL)
- return FALSE;
+ return false;
if (iuser) {
if (iuser->ok == 0)
- return FALSE;
+ return false;
}
else if (ima->ok == 0)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
/* Checks optional ImageUser and verifies/creates ImBuf.
@@ -3157,7 +3159,7 @@ bool BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
/* quick reject tests */
if (!image_quick_test(ima, iuser))
- return FALSE;
+ return false;
BLI_spin_lock(&image_spin);
@@ -3215,15 +3217,15 @@ void BKE_image_pool_free(ImagePool *pool)
MEM_freeN(pool);
}
-BLI_INLINE ImBuf *image_pool_find_entry(ImagePool *pool, Image *image, int frame, int index, int *found)
+BLI_INLINE ImBuf *image_pool_find_entry(ImagePool *pool, Image *image, int frame, int index, bool *found)
{
ImagePoolEntry *entry;
- *found = FALSE;
+ *found = false;
for (entry = pool->image_buffers.first; entry; entry = entry->next) {
if (entry->image == image && entry->frame == frame && entry->index == index) {
- *found = TRUE;
+ *found = true;
return entry->ibuf;
}
}
@@ -3234,7 +3236,8 @@ BLI_INLINE ImBuf *image_pool_find_entry(ImagePool *pool, Image *image, int frame
ImBuf *BKE_image_pool_acquire_ibuf(Image *ima, ImageUser *iuser, ImagePool *pool)
{
ImBuf *ibuf;
- int index, frame, found;
+ int index, frame;
+ bool found;
if (!image_quick_test(ima, iuser))
return NULL;
@@ -3291,7 +3294,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool
const int len = (iuser->fie_ima * iuser->frames) / 2;
if (r_is_in_range) {
- *r_is_in_range = FALSE;
+ *r_is_in_range = false;
}
if (len == 0) {
@@ -3308,7 +3311,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool
if (cfra == 0) cfra = len;
if (r_is_in_range) {
- *r_is_in_range = TRUE;
+ *r_is_in_range = true;
}
}
@@ -3320,7 +3323,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool
}
else {
if (r_is_in_range) {
- *r_is_in_range = TRUE;
+ *r_is_in_range = true;
}
}
@@ -3470,7 +3473,7 @@ unsigned char *BKE_image_get_pixels_for_frame(struct Image *image, int frame)
unsigned char *pixels = NULL;
iuser.framenr = frame;
- iuser.ok = TRUE;
+ iuser.ok = true;
ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock);
@@ -3497,7 +3500,7 @@ float *BKE_image_get_float_pixels_for_frame(struct Image *image, int frame)
float *pixels = NULL;
iuser.framenr = frame;
- iuser.ok = TRUE;
+ iuser.ok = true;
ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock);