Changeset 8255
- Timestamp:
- 06/13/12 20:56:42 (11 months ago)
- Location:
- ImageMagick/branches/ImageMagick-6/magick
- Files:
-
- 4 edited
-
color-private.h (modified) (5 diffs)
-
colorspace.c (modified) (11 diffs)
-
xwindow-private.h (modified) (1 diff)
-
xwindow.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ImageMagick/branches/ImageMagick-6/magick/color-private.h
r8111 r8255 108 108 const MagickPixelPacket *pixel) 109 109 { 110 return((MagickRealType) (0.29 9*pixel->red+0.587*pixel->green+0.114*pixel->blue));110 return((MagickRealType) (0.298839*pixel->red+0.586811*pixel->green+0.114350*pixel->blue)); 111 111 } 112 112 … … 115 115 { 116 116 #if !defined(MAGICKCORE_HDRI_SUPPORT) 117 return((Quantum) (0.29 9*pixel->red+0.587*pixel->green+0.114*pixel->blue+0.5));117 return((Quantum) (0.298839*pixel->red+0.586811*pixel->green+0.114350*pixel->blue+0.5)); 118 118 #else 119 return((Quantum) (0.29 9*pixel->red+0.587*pixel->green+0.114*pixel->blue));119 return((Quantum) (0.298839*pixel->red+0.586811*pixel->green+0.114350*pixel->blue)); 120 120 #endif 121 121 } … … 139 139 (GetPixelGreen(pixel) == GetPixelBlue(pixel))) 140 140 return((MagickRealType) pixel->red); 141 intensity=(MagickRealType) (0.29 9*GetPixelRed(pixel)+0.587*142 GetPixelGreen(pixel)+0.114 *GetPixelBlue(pixel));141 intensity=(MagickRealType) (0.298839*GetPixelRed(pixel)+0.586811* 142 GetPixelGreen(pixel)+0.114350*GetPixelBlue(pixel)); 143 143 return(intensity); 144 144 } … … 150 150 (GetPixelGreen(pixel) == GetPixelBlue(pixel))) 151 151 return(GetPixelRed(pixel)); 152 return((Quantum) (0.29 9*GetPixelRed(pixel)+0.587*153 GetPixelGreen(pixel)+0.114 *GetPixelBlue(pixel)+0.5));152 return((Quantum) (0.298839*GetPixelRed(pixel)+0.586811* 153 GetPixelGreen(pixel)+0.114350*GetPixelBlue(pixel)+0.5)); 154 154 #else 155 155 { … … 160 160 alpha=GetPixelRed(pixel)-GetPixelGreen(pixel); 161 161 beta=GetPixelGreen(pixel)-GetPixelBlue(pixel); 162 if ((fabs((double) alpha) <= MagickEpsilon) && (fabs(beta) <= MagickEpsilon)) 162 if ((fabs((double) alpha) <= MagickEpsilon) && 163 (fabs(beta) <= MagickEpsilon)) 163 164 return(GetPixelRed(pixel)); 164 return((Quantum) (0.29 9*GetPixelRed(pixel)+0.587*165 GetPixelGreen(pixel)+0.114 *GetPixelBlue(pixel)));165 return((Quantum) (0.298839*GetPixelRed(pixel)+0.586811* 166 GetPixelGreen(pixel)+0.114350*GetPixelBlue(pixel))); 166 167 } 167 168 #endif -
ImageMagick/branches/ImageMagick-6/magick/colorspace.c
r8249 r8255 821 821 Initialize Rec601 luma tables: 822 822 823 G = 0.29 900*R+0.58700*G+0.11400*B823 G = 0.298839*R+0.586811*G+0.114350*B 824 824 */ 825 825 #if defined(MAGICKCORE_OPENMP_SUPPORT) … … 829 829 for (i=0; i <= (ssize_t) MaxMap; i++) 830 830 { 831 x_map[i].x=0.29 900f*(MagickRealType) i;832 y_map[i].x=0.58 700f*(MagickRealType) i;833 z_map[i].x=0.114 00f*(MagickRealType) i;834 x_map[i].y=0.29 900f*(MagickRealType) i;835 y_map[i].y=0.58 700f*(MagickRealType) i;836 z_map[i].y=0.114 00f*(MagickRealType) i;837 x_map[i].z=0.29 900f*(MagickRealType) i;838 y_map[i].z=0.58 700f*(MagickRealType) i;839 z_map[i].z=0.114 00f*(MagickRealType) i;831 x_map[i].x=0.298839f*(MagickRealType) i; 832 y_map[i].x=0.586811f*(MagickRealType) i; 833 z_map[i].x=0.114350f*(MagickRealType) i; 834 x_map[i].y=0.298839f*(MagickRealType) i; 835 y_map[i].y=0.586811f*(MagickRealType) i; 836 z_map[i].y=0.114350f*(MagickRealType) i; 837 x_map[i].z=0.298839f*(MagickRealType) i; 838 y_map[i].z=0.586811f*(MagickRealType) i; 839 z_map[i].z=0.114350f*(MagickRealType) i; 840 840 } 841 841 image->type=GrayscaleType; … … 848 848 Initialize YCbCr tables (ITU-R BT.601): 849 849 850 Y = 0.29 9000*R+0.587000*G+0.114000*B850 Y = 0.2988390*R+0.5868110*G+0.1143500*B 851 851 Cb= -0.168736*R-0.331264*G+0.500000*B 852 852 Cr= 0.500000*R-0.418688*G-0.081312*B … … 863 863 for (i=0; i <= (ssize_t) MaxMap; i++) 864 864 { 865 x_map[i].x=0.29 9000f*(MagickRealType) i;866 y_map[i].x=0.58 7000f*(MagickRealType) i;867 z_map[i].x=0.114 000f*(MagickRealType) i;865 x_map[i].x=0.2988390f*(MagickRealType) i; 866 y_map[i].x=0.5868110f*(MagickRealType) i; 867 z_map[i].x=0.1143500f*(MagickRealType) i; 868 868 x_map[i].y=(-0.168730f)*(MagickRealType) i; 869 869 y_map[i].y=(-0.331264f)*(MagickRealType) i; … … 968 968 Initialize YCC tables: 969 969 970 Y = 0.29 900*R+0.58700*G+0.11400*B971 C1= -0.29 900*R-0.58700*G+0.88600*B972 C2= 0.70100*R-0.58 700*G-0.11400*B970 Y = 0.298839*R+0.586811*G+0.114350*B 971 C1= -0.298839*R-0.586811*G+0.88600*B 972 C2= 0.70100*R-0.586811*G-0.114350*B 973 973 974 974 YCC is scaled by 1.3584. C1 zero is 156 and C2 is at 137. … … 1007 1007 Initialize YIQ tables: 1008 1008 1009 Y = 0.29 900*R+0.58700*G+0.11400*B1009 Y = 0.298839*R+0.586811*G+0.114350*B 1010 1010 I = 0.59600*R-0.27400*G-0.32200*B 1011 1011 Q = 0.21100*R-0.52300*G+0.31200*B … … 1022 1022 for (i=0; i <= (ssize_t) MaxMap; i++) 1023 1023 { 1024 x_map[i].x=0.29 900f*(MagickRealType) i;1025 y_map[i].x=0.58 700f*(MagickRealType) i;1026 z_map[i].x=0.114 00f*(MagickRealType) i;1024 x_map[i].x=0.298839f*(MagickRealType) i; 1025 y_map[i].x=0.586811f*(MagickRealType) i; 1026 z_map[i].x=0.114350f*(MagickRealType) i; 1027 1027 x_map[i].y=0.59600f*(MagickRealType) i; 1028 1028 y_map[i].y=(-0.27400f)*(MagickRealType) i; … … 1039 1039 Initialize YPbPr tables (ITU-R BT.601): 1040 1040 1041 Y = 0.29 9000*R+0.587000*G+0.114000*B1041 Y = 0.2988390*R+0.5868110*G+0.1143500*B 1042 1042 Pb= -0.168736*R-0.331264*G+0.500000*B 1043 1043 Pr= 0.500000*R-0.418688*G-0.081312*B … … 1054 1054 for (i=0; i <= (ssize_t) MaxMap; i++) 1055 1055 { 1056 x_map[i].x=0.29 9000f*(MagickRealType) i;1057 y_map[i].x=0.58 7000f*(MagickRealType) i;1058 z_map[i].x=0.114 000f*(MagickRealType) i;1056 x_map[i].x=0.2988390f*(MagickRealType) i; 1057 y_map[i].x=0.5868110f*(MagickRealType) i; 1058 z_map[i].x=0.1143500f*(MagickRealType) i; 1059 1059 x_map[i].y=(-0.168736f)*(MagickRealType) i; 1060 1060 y_map[i].y=(-0.331264f)*(MagickRealType) i; … … 1071 1071 Initialize YUV tables: 1072 1072 1073 Y = 0.29 900*R+0.58700*G+0.11400*B1073 Y = 0.298839*R+0.586811*G+0.114350*B 1074 1074 U = -0.14740*R-0.28950*G+0.43690*B 1075 1075 V = 0.61500*R-0.51500*G-0.10000*B … … 1086 1086 for (i=0; i <= (ssize_t) MaxMap; i++) 1087 1087 { 1088 x_map[i].x=0.29 900f*(MagickRealType) i;1089 y_map[i].x=0.58 700f*(MagickRealType) i;1090 z_map[i].x=0.114 00f*(MagickRealType) i;1088 x_map[i].x=0.298839f*(MagickRealType) i; 1089 y_map[i].x=0.586811f*(MagickRealType) i; 1090 z_map[i].x=0.114350f*(MagickRealType) i; 1091 1091 x_map[i].y=(-0.14740f)*(MagickRealType) i; 1092 1092 y_map[i].y=(-0.28950f)*(MagickRealType) i; -
ImageMagick/branches/ImageMagick-6/magick/xwindow-private.h
r6227 r8255 592 592 intensity; 593 593 594 intensity=0.29 9*pixel->red+0.587*pixel->green+0.114*pixel->blue;594 intensity=0.298839*pixel->red+0.586811*pixel->green+0.114350*pixel->blue; 595 595 return(intensity); 596 596 } -
ImageMagick/branches/ImageMagick-6/magick/xwindow.c
r7579 r8255 7650 7650 intensity; 7651 7651 7652 intensity=0.29 9*pixel->red+0.587*pixel->green+0.114*pixel->blue;7652 intensity=0.298839*pixel->red+0.586811*pixel->green+0.114350*pixel->blue; 7653 7653 return(intensity); 7654 7654 }
Note: See TracChangeset
for help on using the changeset viewer.
