@@ -567,7 +567,7 @@ def encode_array(
567567
568568
569569def encode_buffer (
570- src : Union [ bytes , bytearray ] ,
570+ src : bytes ,
571571 columns : int ,
572572 rows : int ,
573573 samples_per_pixel : int ,
@@ -609,7 +609,7 @@ def encode_buffer(
609609
610610 Parameters
611611 ----------
612- src : bytes | bytearray
612+ src : bytes
613613 A single frame of little endian, colour-by-pixel ordered image data to
614614 be JPEG 2000 encoded. Each pixel should be encoded using the following
615615 (each pixel has 1 or more samples):
@@ -712,16 +712,14 @@ def encode_buffer(
712712 return cast (bytes , buffer )
713713
714714
715- def encode_pixel_data (
716- src : Union [bytes , bytearray ], ** kwargs : Any
717- ) -> bytes :
715+ def encode_pixel_data (src : bytes , ** kwargs : Any ) -> bytes :
718716 """Return the JPEG 2000 compressed `src`.
719717
720718 .. versionadded:: 2.2
721719
722720 Parameters
723721 ----------
724- src : bytes | bytearray
722+ src : bytes
725723 A single frame of little endian, colour-by-pixel ordered image data to
726724 be JPEG2000 encoded. Each pixel should be encoded using the following:
727725
@@ -743,7 +741,7 @@ def encode_pixel_data(
743741
744742 * ``'use_mct'``: bool: ``True`` to use MCT with RGB images (default)
745743 ``False`` otherwise. Will be ignored if `photometric_interpretation`
746- is not RGB, YBR_RCT or YBR_ICT.
744+ is not YBR_RCT or YBR_ICT.
747745 * ''`compression_ratios'``: list[float] - required for lossy encoding if
748746 `signal_noise_ratios` is not used. The desired compression ratio to
749747 use for each quality layer.
@@ -759,7 +757,7 @@ def encode_pixel_data(
759757 # A J2K codestream doesn't track the colour space, so the photometric
760758 # interpretation is only used to help with setting MCT
761759 pi = kwargs ["photometric_interpretation" ]
762- if pi in ("RGB" , " YBR_ICT" , "YBR_RCT" ):
760+ if pi in ("YBR_ICT" , "YBR_RCT" ):
763761 kwargs ["photometric_interpretation" ] = 1
764762 else :
765763 kwargs ["photometric_interpretation" ] = 0
0 commit comments