Diff of /ColourBrightness.c [35f549] .. [a07dce] Maximize Restore

  Switch to unified view

a/ColourBrightness.c b/ColourBrightness.c
...
...
761
761
762
762
763
int CorrectFileColourBrightness(fullPath *inPath, fullPath *outPath, magnolia_struct *magnolia, int parm3)
763
int CorrectFileColourBrightness(fullPath *inPath, fullPath *outPath, magnolia_struct *magnolia, int parm3)
764
{
764
{
765
  Image image;
765
  Image image;
766
  CropInfo crop_info;
767
  char tempString[512];
766
  char tempString[512];
768
  if (panoTiffRead (&image, inPath->name) == 0) {
767
  if (panoTiffRead (&image, inPath->name) == 0) {
769
    sprintf(tempString, "Could not read TIFF file %s", inPath->name);
768
    sprintf(tempString, "Could not read TIFF file %s", inPath->name);
770
    PrintError(tempString);
769
    PrintError(tempString);
771
    return -1;
770
    return -1;
...
...
1631
unsigned char panoColourComputeHue (unsigned char red, unsigned char green, unsigned char blue)
1630
unsigned char panoColourComputeHue (unsigned char red, unsigned char green, unsigned char blue)
1632
{
1631
{
1633
  // Compute Hue
1632
  // Compute Hue
1634
  double H, S, V;
1633
  double H, S, V;
1635
  int h;
1634
  int h;
1636
  unsigned temp;
1637
1635
1638
  panoColourRGBtoHSV(red, green, blue, &H, &S, &V);
1636
  panoColourRGBtoHSV(red, green, blue, &H, &S, &V);
1639
1637
1640
  // Normalize to 0..255 because the mapping tables are configured that way...
1638
  // Normalize to 0..255 because the mapping tables are configured that way...
1641
1639
...
...
1659
1657
1660
unsigned char panoColourComputeSaturation (unsigned char red, unsigned char green, unsigned char blue)
1658
unsigned char panoColourComputeSaturation (unsigned char red, unsigned char green, unsigned char blue)
1661
{
1659
{
1662
  double H, S, V;
1660
  double H, S, V;
1663
  int h;
1661
  int h;
1664
  unsigned temp;
1665
1662
1666
  panoColourRGBtoHSV(red, green, blue, &H, &S, &V);
1663
  panoColourRGBtoHSV(red, green, blue, &H, &S, &V);
1667
1664
1668
  // Normalize to 0..255 because the mapping tables are configured that way...
1665
  // Normalize to 0..255 because the mapping tables are configured that way...
1669
1666
...
...
1927
      while ( currentPixel < image->width ) {
1924
      while ( currentPixel < image->width ) {
1928
        
1925
        
1929
        
1926
        
1930
        if (*ptrPixel != 0 ) {
1927
        if (*ptrPixel != 0 ) {
1931
          
1928
          
1932
          int ebx,ecx;
1933
1934
          int R, G, B;
1929
          int R, G, B;
1935
          double H, S, I;
1930
          double H, S, I;
1936
1931
1937
          R = ptrPixel[1];
1932
          R = ptrPixel[1];
1938
          G = ptrPixel[2];
1933
          G = ptrPixel[2];
...
...
1950
          I = RemapDouble(I * 255.0, mappingCurves[IDX_INTENSITY]) / 255.0;
1945
          I = RemapDouble(I * 255.0, mappingCurves[IDX_INTENSITY]) / 255.0;
1951
          
1946
          
1952
          panoColourHSVtoRGB(H, S, I, &R, &G, &B);
1947
          panoColourHSVtoRGB(H, S, I, &R, &G, &B);
1953
          
1948
          
1954
          if (R < 0 || R > 255 || G < 0 || G > 255 || B < 0 || B > 255) {
1949
          if (R < 0 || R > 255 || G < 0 || G > 255 || B < 0 || B > 255) {
1955
            printf("Value of R G B %d % %d\n", R, G, B);
1950
            printf("Value of R G B %d %d %d\n", R, G, B);
1956
            assert(0);
1951
            assert(0);
1957
          }
1952
          }
1958
          //assert(R >= 0 && R <= 255);
1953
          //assert(R >= 0 && R <= 255);
1959
          //assert(G >= 0 && G <= 255);
1954
          //assert(G >= 0 && G <= 255);
1960
          //assert(B >= 0 && B <= 255);
1955
          //assert(B >= 0 && B <= 255);