Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4180694

(porting) shared code mods for OpenVMS platform, img_colors.c

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • CPU:
      generic
    • OS:
      generic

      Description

      For the JDK 116 release on the OpenVMS platform running on DIGITAL's
      hardware, DIGITAL has changed, the following JDK 116 source file
      in the shared part of the JDK.

      diff -c -r JDK116/src/share/sun/images/img_colors.c
      sun_JDK116/src/share/sun/images/img_colors.c
      *** JDK116/src/share/sun/images/img_colors.c Tue May 5 14:01:53 1998
      --- sun_JDK116/src/share/sun/images/img_colors.c Thu Apr 16 16:51:44 1998
      ***************
      *** 1,6 ****
      - /* Modifications Copyright 1997 Digital Equipment Corporation */
        /*
      ! * @(#)img_colors.c 1.8 97/03/14
         *
         * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
         *
      --- 1,5 ----
        /*
      ! * @(#)img_colors.c 1.9 98/01/30
         *
         * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
         *
      ***************
      *** 115,149 ****
            float X = Rmat[0][red] + Gmat[0][grn] + Bmat[0][blu];
            float Y = Rmat[1][red] + Gmat[1][grn] + Bmat[1][blu];
            float Z = Rmat[2][red] + Gmat[2][grn] + Bmat[2][blu];
        
      ! float sum = X+Y+Z;
      ! float x;
      ! float y;
      ! float dnm;
      ! float uprm;
      ! float vprm;
      ! float ytmp;
      !
      ! /*** cds - special case for zero sum, to avoid generating NaN ***/
      ! /*** this is both a bug fix and performance improvement ***/
      ! if (sum == 0.0) {
      ! *L = 0.0;
      ! *u = 0.0;
      ! *v = 0.0;
            } else {
      ! x = X/sum;
      ! y = Y/sum;
      ! dnm = -2*x + 12*y + 3;
      ! uprm = 4*x/dnm;
      ! vprm = 9*y/dnm;
      ! ytmp = (float) pow(Y/whiteXYZ[1], 1.0/3.0);
      ! if (ytmp < .206893f) {
      ! *L = 903.3f*Y/whiteXYZ[1];
      ! } else {
      ! *L = 116*(ytmp) - 16;
      ! }
      ! *u = 13*(*L)*(uprm-uwht);
      ! *v = 13*(*L)*(vprm-vwht);
            }
        }
        
      --- 114,146 ----
            float X = Rmat[0][red] + Gmat[0][grn] + Bmat[0][blu];
            float Y = Rmat[1][red] + Gmat[1][grn] + Bmat[1][blu];
            float Z = Rmat[2][red] + Gmat[2][grn] + Bmat[2][blu];
      + float sum = X+Y+Z;
        
      ! if (sum != 0.0f) {
      ! float x = X/sum;
      ! float y = Y/sum;
      ! float dnm = -2*x + 12*y + 3;
      ! float ytmp = (float) pow(Y/whiteXYZ[1], 1.0/3.0);
      !
      ! if (ytmp < .206893f) {
      ! *L = 903.3f*Y/whiteXYZ[1];
      ! } else {
      ! *L = 116*(ytmp) - 16;
      ! }
      ! if (dnm != 0.0f) {
      ! float uprm = 4*x/dnm;
      ! float vprm = 9*y/dnm;
      !
      ! *u = 13*(*L)*(uprm-uwht);
      ! *v = 13*(*L)*(vprm-vwht);
      ! } else {
      ! *u = 0.0f;
      ! *v = 0.0f;
      ! }
            } else {
      ! *L = 0.0f;
      ! *u = 0.0f;
      ! *v = 0.0f;
            }
        }
        
      ***************

        Attachments

          Activity

            People

            Assignee:
            flar Jim Graham
            Reporter:
            jbenoit Jonathan Benoit (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: