コード例 #1
0
    def test_slicing_rect_inversion(self):
        """Ensures that slicing2rect and rect2slicing are inverse
        operations.

        """
        a = self.slicing
        b = st.slicing2rect(a)
        c = st.rect2slicing(b)

        self.assertEquals(a, c)

        a = self.qrect
        b = st.rect2slicing(a)
        c = st.slicing2rect(b)

        self.assertEquals(a, c)
コード例 #2
0
    def test_slicing_rect_inversion(self):
        """Ensures that slicing2rect and rect2slicing are inverse
        operations.

        """
        a = self.slicing
        b = st.slicing2rect(a)
        c = st.rect2slicing(b)

        self.assertEquals(a, c)

        a = self.qrect
        b = st.rect2slicing(a)
        c = st.slicing2rect(b)

        self.assertEquals(a, c)
コード例 #3
0
    def setDirty(self, slicing):
        """Mark a region of the image as dirty.

        slicing -- if one ore more slices in the slicing
                   are unbounded, the whole image is marked dirty;
                   since an image has two dimensions, only the first
                   two slices in the slicing are used

        """
        if not is_pure_slicing(slicing):
            raise Exception("dirty region: slicing is not pure")
        if not is_bounded(slicing):
            self.isDirty.emit(QRect())  # empty rect == everything is dirty
        else:
            self.isDirty.emit(slicing2rect(slicing))
コード例 #4
0
ファイル: imagesources.py プロジェクト: buotex/volumina
    def setDirty( self, slicing ):
        '''Mark a region of the image as dirty.

        slicing -- if one ore more slices in the slicing
                   are unbounded, the whole image is marked dirty;
                   since an image has two dimensions, only the first
                   two slices in the slicing are used

        '''
        if not is_pure_slicing(slicing):
            raise Exception('dirty region: slicing is not pure')
        if not is_bounded( slicing ):
            self.isDirty.emit(QRect()) # empty rect == everything is dirty
        else:
            self.isDirty.emit(slicing2rect( slicing ))
コード例 #5
0
 def test_slicing2rect(self):
     qrect = st.slicing2rect(self.slicing)
     self.assertEquals(qrect, self.qrect)
コード例 #6
0
 def test_slicing2rect(self):
     qrect = st.slicing2rect(self.slicing)
     self.assertEquals(qrect, self.qrect)