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>2011-01-08 15:43:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-08 15:43:44 +0300
commit3b74074aec8ad551f210fda9ed13cf654d98876f (patch)
treeeec1e688ae024187c2d999126da5cdd61fc1b875 /source/blender/blenkernel/intern/colortools.c
parent988e5371fac894a6b35e561fc43e5e9ea6bc3c40 (diff)
remove unused code & variables.
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r--source/blender/blenkernel/intern/colortools.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 1bfefef4b71..7cf6b21e2f1 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -1012,6 +1012,9 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
int savedlines, saveline;
float rgb[3], ycc[3], luma;
int ycc_mode=-1;
+ const short is_float = (ibuf->rect_float != NULL);
+
+ if (ibuf->rect==NULL && ibuf->rect_float==NULL) return;
if (scopes->ok == 1 ) return;
@@ -1019,6 +1022,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
/* hmmmm */
if (!(ELEM(ibuf->channels, 3, 4))) return;
+
scopes->hist.channels = 3;
scopes->hist.x_resolution = 256;
@@ -1073,9 +1077,9 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
scopes->waveform_3= MEM_callocN(scopes->waveform_tot * 2 * sizeof(float), "waveform point channel 3");
scopes->vecscope= MEM_callocN(scopes->waveform_tot * 2 * sizeof(float), "vectorscope point channel");
- if (ibuf->rect_float)
+ if (is_float)
rf = ibuf->rect_float;
- else if (ibuf->rect)
+ else
rc = (unsigned char *)ibuf->rect;
for (y = 0; y < ibuf->y; y++) {
@@ -1084,13 +1088,13 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
} else saveline=0;
for (x = 0; x < ibuf->x; x++) {
- if (ibuf->rect_float) {
+ if (is_float) {
if (use_color_management)
linearrgb_to_srgb_v3_v3(rgb, rf);
else
copy_v3_v3(rgb, rf);
}
- else if (ibuf->rect) {
+ else {
for (c=0; c<3; c++)
rgb[c] = rc[c] * INV_255;
}