glymur/jp2box.py
def _validate(self, writing=False):
        """Verify that the box obeys the specifications."""
        if (((len(self.bits_per_component) != len(self.signed))
             or (len(self.signed) != self.palette.shape[1]))):
            msg = ("The length of the 'bits_per_component' and the 'signed' "
                   "members must equal the number of columns of the palette.")
            self._dispatch_validation_error(msg, writing=writing)
        bps = self.bits_per_component
        if writing and not all(b == bps[0] for b in bps):
            # We don't support writing palettes with bit depths that are
            # different.
            msg = "Writing palettes with varying bit depths is not supported."
            self._dispatch_validation_error(msg, writing=writing)
Verify that the box obeys the specifications.
Verify that the box obeys the specifications.
Verify that the box obeys the specifications .
def _validate(self, writing=False):
        if (((len(self.bits_per_component) != len(self.signed))
             or (len(self.signed) != self.palette.shape[1]))):
            msg = ("The length of the 'bits_per_component' and the 'signed' "
                   "members must equal the number of columns of the palette.")
            self._dispatch_validation_error(msg, writing=writing)
        bps = self.bits_per_component
        if writing and not all(b == bps[0] for b in bps):
            msg = "Writing palettes with varying bit depths is not supported."
            self._dispatch_validation_error(msg, writing=writing)
def _validate ( self , writing = False ) : if ( ( ( len ( self . bits_per_component ) != len ( self . signed ) ) or ( len ( self . signed ) != self . palette . shape [ 1 ] ) ) ) : msg = ( "The length of the 'bits_per_component' and the 'signed' " "members must equal the number of columns of the palette." ) self . _dispatch_validation_error ( msg , writing = writing ) bps = self . bits_per_component if writing and not all ( b == bps [ 0 ] for b in bps ) : msg = "Writing palettes with varying bit depths is not supported." self . _dispatch_validation_error ( msg , writing = writing )
Verify that the box obeys the specifications.
Verify that the box obeys the specifications .
"""Verify that the box obeys the specifications.""" # We don't support writing palettes with bit depths that are # different.
self
writing