summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5141030)
raw | patch | inline | side by side (parent: 5141030)
author | tavmjong <tavmjong@users.sourceforge.net> | |
Fri, 28 Sep 2007 15:31:46 +0000 (15:31 +0000) | ||
committer | tavmjong <tavmjong@users.sourceforge.net> | |
Fri, 28 Sep 2007 15:31:46 +0000 (15:31 +0000) |
Matrix mode: set default to Identity matrix.
Matrix mode: multiply 5th column by 255.
Hue Rotation mode: convert degrees to radians for sin/cos.
Matrix mode: multiply 5th column by 255.
Hue Rotation mode: convert degrees to radians for sin/cos.
src/display/nr-filter-colormatrix.cpp | patch | blob | history | |
src/ui/dialog/filter-effects-dialog.cpp | patch | blob | history |
index 74394bfc1909c6a4e9ca48eeb4bb117f4a971cc6..3ed193984a02bbc1027670a833c6ef95b862f62b 100644 (file)
switch(type){
case COLORMATRIX_MATRIX:
if (values.size()!=20) {
- g_warning("ColorMatrix: values parameter error. Wrong size.");
+ g_warning("ColorMatrix: values parameter error. Wrong size: %i.", values.size());
return -1;
}
for (x=x0;x<x1;x++){
g = in_data[i+1];
b = in_data[i+2];
a = in_data[i+3];
- out_data[i] = CLAMP_D_TO_U8( r*values[0] + g*values[1] + b*values[2] + a*values[3] + values[4] );
- out_data[i+1] = CLAMP_D_TO_U8( r*values[5] + g*values[6] + b*values[7] + a*values[8] + values[9] );
- out_data[i+2] = CLAMP_D_TO_U8( r*values[10] + g*values[11] + b*values[12] + a*values[13] + values[14] );
- out_data[i+3] = CLAMP_D_TO_U8( r*values[15] + g*values[16] + b*values[17] + a*values[18] + values[19] );
+ out_data[i] = CLAMP_D_TO_U8( r*values[0] + g*values[1] + b*values[2] + a*values[3] + 255*values[4] );
+ out_data[i+1] = CLAMP_D_TO_U8( r*values[5] + g*values[6] + b*values[7] + a*values[8] + 255*values[9] );
+ out_data[i+2] = CLAMP_D_TO_U8( r*values[10] + g*values[11] + b*values[12] + a*values[13] + 255*values[14] );
+ out_data[i+3] = CLAMP_D_TO_U8( r*values[15] + g*values[16] + b*values[17] + a*values[18] + 255*values[19] );
}
}
break;
}
break;
case COLORMATRIX_HUEROTATE:
- coshue = cos(value);
- sinhue = sin(value);
+ coshue = cos(value * M_PI/180.0);
+ sinhue = sin(value * M_PI/180.0);
a00 = 0.213 + coshue*( 0.787) + sinhue*(-0.213);
a01 = 0.715 + coshue*(-0.715) + sinhue*(-0.715);
a02 = 0.072 + coshue*(-0.072) + sinhue*( 0.928);
index 4ea5faf138a1c9b68d655f72e1bc9298877f2436..dc6fc06bb7eae81c5118a3efbfe7737bfb442260 100644 (file)
for(int r = 0; r < rows; ++r) {
Gtk::TreeRow row = *(_model->append());
+ // Default to identity matrix
for(int c = 0; c < cols; ++c, ++ndx)
- row[_columns.cols[c]] = ndx < (int)values->size() ? (*values)[ndx] : 0;
+ row[_columns.cols[c]] = ndx < (int)values->size() ? (*values)[ndx] : (r == c ? 1 : 0);
}
}
}