def _validate_compression_params(self, img_array, cparams, colorspace):
self._validate_j2k_colorspace(cparams, colorspace)<EOL>self._validate_codeblock_size(cparams)<EOL>self._validate_precinct_size(cparams)<EOL>self._validate_image_rank(img_array)<EOL>self._validate_image_datatype(img_array)<EOL>
Check that the compression parameters are valid.

        Parameters
        ----------
        img_array : ndarray
            Image data to be written to file.
        cparams : CompressionParametersType(ctypes.Structure)
            Corresponds to cparameters_t type in openjp2 headers.