Diff of /ColourBrightness.c [84521e] .. [839d2e]  Maximize  Restore

Switch to unified view

a/ColourBrightness.c b/ColourBrightness.c
...
...
93
{
93
{
94
  int j;
94
  int j;
95
  int i; 
95
  int i; 
96
  magnolia_struct *magnolia = NULL;
96
  magnolia_struct *magnolia = NULL;
97
  double *ptrDouble;
97
  double *ptrDouble;
98
  int var04;
99
  double var16;
98
  double var16;
100
  int ecx;
99
  int ecx;
101
100
102
  if ((magnolia = malloc(numberImages * sizeof(magnolia_struct) )) == 0) {
101
  if ((magnolia = malloc(numberImages * sizeof(magnolia_struct) )) == 0) {
103
    
102
    
104
    return 0;
103
    return 0;
105
    
104
    
106
  }
105
  }
107
  
108
  var04 = size - 1;
109
  
106
  
110
  var16 = (size -1 ) / 255.0; /// shouldn't this be a 256?
107
  var16 = (size -1 ) / 255.0; /// shouldn't this be a 256?
111
  
108
  
112
  for (i=0; i < numberImages; i++) {
109
  for (i=0; i < numberImages; i++) {
113
110
...
...
147
144
148
  double deltaPrev;
145
  double deltaPrev;
149
  double deltaNext;
146
  double deltaNext;
150
147
151
  double var48;
148
  double var48;
152
  int var44;
153
149
154
  double tablePrevValue;
150
  double tablePrevValue;
155
  double tableNextValue;
151
  double tableNextValue;
156
  int tempInt;
157
  int nextValueInt;
152
  int nextValueInt;
158
  int prevValueInt;
153
  int prevValueInt;
159
154
160
  int edx;
155
  int edx;
161
156
...
...
189
  }
184
  }
190
185
191
  if (fabs(tableNextValue - tablePrevValue) <= 2.0) {
186
  if (fabs(tableNextValue - tablePrevValue) <= 2.0) {
192
    // if the difference |f(value - 1)  -f(value+1) is too small
187
    // if the difference |f(value - 1)  -f(value+1) is too small
193
188
194
    tempInt =  (int)mapTable[value];
195
196
    if ((int)mapTable[value] == 0xff ) {
189
    if ((int)mapTable[value] == 0xff ) {
197
      return 0xff;
190
      return 0xff;
198
    }
191
    }
199
192
200
    delta = mapTable[value] - (int)mapTable[value];
193
    delta = mapTable[value] - (int)mapTable[value];
...
...
244
  deltaNext = tableNextValue - mapTable[value];
237
  deltaNext = tableNextValue - mapTable[value];
245
238
246
  edx = prevValueInt;
239
  edx = prevValueInt;
247
240
248
  var48 = 0;
241
  var48 = 0;
249
  var44 = 0;
250
242
251
  //  if ( %edx > %nextValueInt ) /// [(int)tablePrevValue] > [(int)tableNextValue] 
243
  //  if ( %edx > %nextValueInt ) /// [(int)tablePrevValue] > [(int)tableNextValue] 
252
  while ( edx <= nextValueInt ) { /// [(int)tablePrevValue] > [(int)tableNextValue] 
244
  while ( edx <= nextValueInt ) { /// [(int)tablePrevValue] > [(int)tableNextValue] 
253
245
254
    if (edx < mapTable[value]) {
246
    if (edx < mapTable[value]) {
...
...
595
587
596
void ColourBrightness(  fullPath *fullPathImages,  fullPath *outputFullPathImages, 
588
void ColourBrightness(  fullPath *fullPathImages,  fullPath *outputFullPathImages, 
597
                        int counterImages, int indexReferenceImage, int parm3, int createCurvesType)
589
                        int counterImages, int indexReferenceImage, int parm3, int createCurvesType)
598
{
590
{
599
591
600
  histograms_struct * ptrHistograms;
601
  histograms_struct * ptrHistograms2;
592
  histograms_struct * ptrHistograms2;
602
  int numberHistograms;
593
  int numberHistograms;
603
  int index;
594
  int index;
604
  calla_struct calla;  
595
  calla_struct calla;  
605
  char string[128];
596
  char string[128];
...
...
621
612
622
  calla.ptrHistograms = ReadHistograms(fullPathImages, counterImages);
613
  calla.ptrHistograms = ReadHistograms(fullPathImages, counterImages);
623
614
624
  if ( calla.ptrHistograms == 0 )
615
  if ( calla.ptrHistograms == 0 )
625
    return ;
616
    return ;
626
627
  ptrHistograms = calla.ptrHistograms;
628
617
629
  fprintf(debugFile, "\nQuality before optimization:\n");
618
  fprintf(debugFile, "\nQuality before optimization:\n");
630
619
631
  //  printf("\nQuality before optimization:\n");
620
  //  printf("\nQuality before optimization:\n");
632
621
...
...
1414
1403
1415
    for (currentPixel = 0;  currentPixel < (int)imageWidth; currentPixel++, ptrCurrentPixelLineBuffer+= bytesPerPixel ) {
1404
    for (currentPixel = 0;  currentPixel < (int)imageWidth; currentPixel++, ptrCurrentPixelLineBuffer+= bytesPerPixel ) {
1416
1405
1417
      unsigned char *ptrPixel;
1406
      unsigned char *ptrPixel;
1418
      unsigned char *ptrOtherPixel;
1407
      unsigned char *ptrOtherPixel;
1419
      int ecx;
1420
1408
1421
      // We process each currentHistogram
1409
      // We process each currentHistogram
1422
      currentHistogram = ptrHistograms;
1410
      currentHistogram = ptrHistograms;
1423
1411
1424
      currentImage = 0;
1412
      currentImage = 0;
1425
1413
1426
      ptrPixel = ptrCurrentPixelLineBuffer;
1414
      ptrPixel = ptrCurrentPixelLineBuffer;
1427
      assert(ptrPixel < imagesDataBuffer + numberImages * bytesPerLine);
1415
      assert(ptrPixel < imagesDataBuffer + numberImages * bytesPerLine);
1428
1429
      ecx = numberImages;
1430
1416
1431
      // for each pixel of each line of each image...
1417
      // for each pixel of each line of each image...
1432
      for (currentImage = 0; currentImage < numberImages ; currentImage++, ptrPixel+= bytesPerLine) {
1418
      for (currentImage = 0; currentImage < numberImages ; currentImage++, ptrPixel+= bytesPerLine) {
1433
1419
1434
        assert(ptrPixel < imagesDataBuffer + numberImages * bytesPerLine);
1420
        assert(ptrPixel < imagesDataBuffer + numberImages * bytesPerLine);
...
...
1925
  int currentRow;
1911
  int currentRow;
1926
  int currentPixel;
1912
  int currentPixel;
1927
  unsigned char *pixel;
1913
  unsigned char *pixel;
1928
  int edi;
1914
  int edi;
1929
  double * (mappingCurves[6]);
1915
  double * (mappingCurves[6]);
1930
  int edx;
1931
  unsigned char *ptrPixel;
1916
  unsigned char *ptrPixel;
1932
  int channel;
1917
  int channel;
1933
  int level;
1918
  int level;
1934
  
1919
  
1935
  for (channel = 0; channel < 6; channel++ ) {
1920
  for (channel = 0; channel < 6; channel++ ) {
...
...
1968
  case 1:
1953
  case 1:
1969
    
1954
    
1970
    printf("**************************Bright\n");
1955
    printf("**************************Bright\n");
1971
1956
1972
    currentRow = 0;
1957
    currentRow = 0;
1973
    
1974
    edx = currentRow;
1975
    
1958
    
1976
    while ( currentRow < image->height) {
1959
    while ( currentRow < image->height) {
1977
1960
1978
      currentPixel = 0;
1961
      currentPixel = 0;
1979
      
1962
      

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks