Changeset 2019 for trunk/MagicSoft/Cosy/videodev
- Timestamp:
- 04/28/03 11:04:17 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/videodev/Filter.cc
r1959 r2019 205 205 void Filter::Stretch(byte *img) 206 206 { 207 const int offset = 10;207 const int offset = 25; 208 208 209 209 int max; … … 212 212 /*const float mean =*/Mean(img, offset, &min, &max); 213 213 214 const byte diff = max-min; 215 214 216 for (int x=0; x<768; x++) 215 217 for (int y=0; y<576; y++) 216 218 { 217 img[y*768+x] -= min; 218 img[y*768+x] *= 255/(max-min); 219 } 220 } 219 byte &b = img[y*768+x]; 220 221 if (b<min) 222 { 223 b=0; 224 continue; 225 } 226 if (b>max) 227 { 228 b=max; 229 continue; 230 } 231 b -= min; 232 b *= 255/diff; 233 } 234 }
Note:
See TracChangeset
for help on using the changeset viewer.