(self)
return get_pixel_array(newarr, self.width, self.height, self.pixelsize)
Flip the lines from top to bottom into a new copy of this pixel array
Flip the lines from top to bottom into a new copy of this pixel array
Flip the lines from top to bottom into a new copy of this pixel array
def copy_flipped_top_bottom(self):
        """
        Flip the lines from top to bottom into a new copy of this pixel array
        """
        newarr = array.array('B', [0]) *  self.size
        for i in range(self.height):
            dst_start = i * self.line_length
            dst_end = dst_start + self.line_length
            src_start = ((self.height - i) * self.line_length) - self.line_length
            src_end = src_start + self.line_length
            newarr[dst_start:dst_end] = self.data[src_start:src_end]
        return get_pixel_array(newarr, self.width, self.height, self.pixelsize)
def copy_flipped_top_bottom ( self ) : newarr = array . array ( 'B' , [ 0 ] ) * self . size for i in range ( self . height ) : dst_start = i * self . line_length dst_end = dst_start + self . line_length src_start = ( ( self . height - i ) * self . line_length ) - self . line_length src_end = src_start + self . line_length newarr [ dst_start : dst_end ] = self . data [ src_start : src_end ] return get_pixel_array ( newarr , self . width , self . height , self . pixelsize )