Logo Search packages:      
Sourcecode: eikazo version File versions  Download package

def Eikazo::Widgets::SaneDevice::getMaxScanArea (   self  ) 

return the max size of the scan area (tlx, brx, tly, bry)
    The units are millemeters, if the resolution can be determined.
    Otherwise, the default unit is returned

Definition at line 553 of file Widgets.py.

00553                             :
        """ return the max size of the scan area (tlx, brx, tly, bry)
            The units are millemeters, if the resolution can be determined.
            Otherwise, the default unit is returned
        """
        res = getattr(self, '_scanarea', None)
        if res: return res
        found = 0
        resol = None
        for opt in self.getOptions():
            if opt[1] == 'tl-x':
                found |= 1
                tlx = opt
                if found == 31: break
            if opt[1] == 'tl-y':
                found |= 2
                tly = opt
                if found == 31: break
            if opt[1] == 'br-x':
                found |= 4
                brx = opt
                if found == 31: break
            if opt[1] == 'br-y':
                found |= 8
                bry = opt
                if found == 31: break
            elif opt[1] == 'resolution':
                found |= 16
                resol = opt
                if found == 31: break
        
        if (found & 15) != 15:
            raise EikazoWidgetError("Sane backend does not provide scan window size")
        
        if resol:
            resol = self._device.resolution
        self._scanarea = (_millimeters(_getMinConstraint(tlx), tlx, resol),
                          _millimeters(_getMaxConstraint(brx), brx, resol),
                          _millimeters(_getMinConstraint(tly), tly, resol),
                          _millimeters(_getMaxConstraint(bry), bry, resol))
        return self._scanarea
    
    def geometryChanged(self):


Generated by  Doxygen 1.6.0   Back to index