summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 065421b)
raw | patch | inline | side by side (parent: 065421b)
author | jucablues <jucablues@users.sourceforge.net> | |
Tue, 19 Feb 2008 14:48:10 +0000 (14:48 +0000) | ||
committer | jucablues <jucablues@users.sourceforge.net> | |
Tue, 19 Feb 2008 14:48:10 +0000 (14:48 +0000) |
* filter effects dialog warning cleanup
src/display/nr-filter-convolve-matrix.cpp | patch | blob | history | |
src/ui/dialog/filter-effects-dialog.cpp | patch | blob | history |
index 360ff6567efa5691d5ef50d22a2e6e3453bd716d..e23a8b32f8a34621328e88ae14f2a7206aa5e5ff 100644 (file)
int width = in->area.x1 - in->area.x0;
int height = in->area.y1 - in->area.y0;
+ unsigned int index;
+ unsigned int kernel_index;
+
for (x=targetX; x < width - (orderX - targetX); x++){
for (y=targetY; y < height - (orderY - targetY); y++){
result_R = 0;
@@ -64,20 +67,24 @@ int FilterConvolveMatrix::render(FilterSlot &slot, FilterUnits const &/*units*/)
for (i=0; i < orderY; i++){
for (j=0; j < orderX; j++){
if (inside_area(x - targetX + j, y - targetY + i, width, height)){
- result_R += ( (double) in_data[4*( x - targetX + j + width*(y - targetY + i) )] * kernelMatrix[orderX-j-1 + orderX*(orderY-i-1)] );
- result_G += ( (double) in_data[4*( x - targetX + j + width*(y - targetY + i) )+1] * kernelMatrix[orderX-j-1 + orderX*(orderY-i-1)] );
- result_B += ( (double) in_data[4*( x - targetX + j + width*(y - targetY + i) )+2] * kernelMatrix[orderX-j-1 + orderX*(orderY-i-1)] );
- result_A += ( (double) in_data[4*( x - targetX + j + width*(y - targetY + i) )+3] * kernelMatrix[orderX-j-1 + orderX*(orderY-i-1)] );
+ index = 4*( x - targetX + j + width*(y - targetY + i) );
+ kernel_index = orderX-j-1 + orderX*(orderY-i-1);
+ result_R += ( (double) in_data[index++] * kernelMatrix[kernel_index] );
+ result_G += ( (double) in_data[index++] * kernelMatrix[kernel_index] );
+ result_B += ( (double) in_data[index++] * kernelMatrix[kernel_index] );
+ result_A += ( (double) in_data[index] * kernelMatrix[kernel_index] );
}
}
}
+ unsigned int out_index = 4*( x + width*y );
+ out_data[out_index++] = CLAMP_D_TO_U8(result_R / divisor + bias);
+ out_data[out_index++] = CLAMP_D_TO_U8(result_G / divisor + bias);
+ out_data[out_index++] = CLAMP_D_TO_U8(result_B / divisor + bias);
- out_data[4*( x + width*y )] = CLAMP_D_TO_U8(result_R / divisor + bias);
- out_data[4*( x + width*y )+1] = CLAMP_D_TO_U8(result_G / divisor + bias);
- out_data[4*( x + width*y )+2] = CLAMP_D_TO_U8(result_B / divisor + bias);
- out_data[4*( x + width*y )+3] = CLAMP_D_TO_U8(result_A / divisor + bias);
if( preserveAlpha ) {
- out_data[4*( x + width*y )+3] = in_data[4*( x + width*y )+3];
+ out_data[out_index] = in_data[out_index];
+ } else {
+ out_data[out_index] = CLAMP_D_TO_U8(result_A / divisor + bias);
}
}
}
index 595c8612bbdb02068bccc58fb5851c93201f71f0..30b6ac4cfc73f9c9c400ec9032b761e9dacf58a5 100644 (file)
//First Tab
std::vector<Gtk::Widget*> vect1 = _settings_tab1.get_children();
- for(int i=0; i<vect1.size(); i++) vect1[i]->hide_all();
+ for(unsigned int i=0; i<vect1.size(); i++) vect1[i]->hide_all();
_empty_settings.show();
if (prefs_get_int_attribute ("options.showfiltersinfobox", "value", 1)){