Lines Matching refs:MAXVAL
335 maxval=None,
2045 maxval = 2**meta['bitdepth']-1
2055 # 0/maxval (by multiplication), and add it as the extra
2059 opa = map(maxval.__mul__, opa)
2084 def asFloat(self, maxval=1.0):
2087 *maxval*.
2093 info['maxval'] = float(maxval)
2094 factor = float(maxval)/float(sourcemaxval)
2104 maxval = 2**meta['bitdepth'] - 1
2106 maxval)
2111 if maxval == targetmaxval:
2189 maxval = 2**meta['bitdepth'] - 1
2190 maxbuffer = struct.pack('=' + typecode, maxval) * 4 * width
3580 required = ['WIDTH', 'HEIGHT', 'DEPTH', 'MAXVAL']
3582 MAXVAL = required
3585 raise Error('PAM file must specify WIDTH, HEIGHT, DEPTH, and MAXVAL')
3589 maxval = int(header[MAXVAL])
3593 maxval <= 0):
3595 'WIDTH, HEIGHT, DEPTH, MAXVAL must all be positive integers')
3596 return 'P7', width, height, depth, maxval
3600 Read a PNM header, returning (format,width,height,depth,maxval).
3603 PPM as 3; for PAM images it is read from the header. `maxval` is
3629 # final whitespace character (immediately following the MAXVAL in
3672 # synthesize a MAXVAL
3681 maxval = 2**bitdepth - 1
3691 # Could generate PBM if maxval is 1, but we don't (for one
3698 file.write('%s %d %d %d\n' % (fmt, width, height, maxval))
3708 (width, height, planes, maxval, tupltype))
3713 if maxval > 0xff:
3809 format, width, height, depth, maxval = \
3821 mi = supported.index(maxval)
3824 'your maxval (%s) not in supported list %s' %
3825 (maxval, str(supported)))
3842 'maxval %s not supported for alpha channel' % amaxval)