Changeset 3573 for pkpgcounter/trunk/pkpgpdls
- Timestamp:
- 07/17/13 22:17:23 (11 years ago)
- Location:
- pkpgcounter/trunk/pkpgpdls
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/inkcoverage.py
r3474 r3573 33 33 34 34 def getPercent(img, nbpix) : 35 """Extracts the percents per color component from a picture. 36 37 Faster without Psyco on my own machine. 38 """ 35 """Extracts the percents per color component from a picture.""" 39 36 result = {} 40 37 bands = img.split() … … 47 44 48 45 PIL doesn't produce useable CMYK for our algorithm, so we use the algorithm from PrintBill. 49 Psyco speeds this function up by around 2.5 times on my computer.50 46 """ 51 47 if img.mode != "RGB" : … … 105 101 colorspace = colorspace.upper() 106 102 computation = globals()["getPercent%s" % colorspace] 107 if colorspace in ("CMYK", "GC") : # faster with psyco on my machine108 try :109 import psyco110 except ImportError :111 pass112 else :113 psyco.bind(getPercentCMYK)114 115 103 index = 0 116 104 try : -
pkpgcounter/trunk/pkpgpdls/pcl345.py
r3495 r3573 102 102 firstblock = self.firstblock[pos:] 103 103 if firstblock.startswith("\033E\033") or \ 104 firstblock.startswith("\033(") or \ 104 105 firstblock.startswith("\033%1BBPIN;") or \ 105 106 ((pos == 11000) and firstblock.startswith("\033")) or \ -
pkpgcounter/trunk/pkpgpdls/pdlparser.py
r3474 r3573 58 58 else : 59 59 self.logdebug("Input file is in the '%s' file format." % self.format) 60 try :61 import psyco62 except ImportError :63 pass # Psyco is not installed64 else :65 # Psyco is installed, tell it to compile66 # the CPU intensive methods : PCL and PCLXL67 # parsing will greatly benefit from this.68 psyco.bind(self.getJobSize)69 60 self.infile = open(self.filename, self.openmode) 70 61 # self.logdebug("Opened %s in '%s' mode." % (self.filename, self.openmode))