Changeset 439 for pkpgcounter/trunk/pkpgpdls
- Timestamp:
- 12/10/06 19:15:07 (18 years ago)
- Location:
- pkpgcounter/trunk/pkpgpdls
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/analyzer.py
r434 r439 211 211 dest="colorspace", 212 212 type="cichoice", 213 cichoices=["bw", "rgb", "cmyk", "cmy" ],214 help="Activate the computation of ink usage, and defines the colorspace to use. Supported values are 'BW', 'RGB', 'CMYK', and 'CMY'.")213 cichoices=["bw", "rgb", "cmyk", "cmy", "gc"], 214 help="Activate the computation of ink usage, and defines the colorspace to use. Supported values are 'BW', 'RGB', 'CMYK', 'CMY', and 'GC'.") 215 215 parser.add_option("-r", "--resolution", 216 216 type="int", -
pkpgcounter/trunk/pkpgpdls/inkcoverage.py
r433 r439 64 64 } 65 65 66 def getPercentGC(img, nbpix) : 67 """Determines if a page is in grayscale or colour mode.""" 68 result = getPercentCMYK(img, nbpix) 69 if result["C"] == result["M"] == result["Y"] == 0.0 : 70 return { "G" : 100.0, "C" : 0.0 } 71 else : 72 return { "G" : 0.0, "C" : 100.0 } 73 66 74 def getPercentBW(img, nbpix) : 67 75 """Extracts the percents of Black from a picture, once converted to gray levels.""" … … 92 100 colorspace = colorspace.upper() 93 101 computation = globals()["getPercent%s" % colorspace] 94 if colorspace == "CMYK": # faster with psyco on my machine102 if colorspace in ("CMYK", "GC") : # faster with psyco on my machine 95 103 try : 96 104 import psyco … … 98 106 pass 99 107 else : 100 psyco.bind( computation)108 psyco.bind(getPercentCMYK) 101 109 102 110 index = 0 -
pkpgcounter/trunk/pkpgpdls/version.py
r437 r439 23 23 24 24 25 __version__ = "2.1 2"25 __version__ = "2.13" 26 26 27 27 __doc__ = """pkpgcounter : a generic Page Description Languages parser."""