@@ -411,15 +411,13 @@ cdef class RawPy:
411411 with nogil:
412412 self .p.recycle()
413413
414- def open_file (self , path , shot_select = 0 ):
414+ def open_file (self , path ):
415415 """
416416 Opens the given RAW image file. Should be followed by a call to :meth:`~rawpy.RawPy.unpack`.
417417
418418 .. NOTE:: This is a low-level method, consider using :func:`rawpy.imread` instead.
419419
420420 :param str path: The path to the RAW image.
421- :param int shot_select: select which image to extract from RAW files that contain multiple images
422- (e.g., Dual Pixel RAW). Default is 0 for the first/main image.
423421 """
424422 cdef wchar_t * wchars
425423 cdef Py_ssize_t wchars_len
@@ -435,19 +433,14 @@ cdef class RawPy:
435433 ELSE :
436434 res = self .p.open_file(path.encode(' UTF-8' ))
437435 self .handle_error(res)
438- # Set shot_select after opening file
439- cdef libraw_raw_unpack_params_t* rp = & self .p.imgdata.rawparams
440- rp.shot_select = shot_select
441436
442- def open_buffer (self , fileobj , shot_select = 0 ):
437+ def open_buffer (self , fileobj ):
443438 """
444439 Opens the given RAW image file-like object. Should be followed by a call to :meth:`~rawpy.RawPy.unpack`.
445440
446441 .. NOTE:: This is a low-level method, consider using :func:`rawpy.imread` instead.
447442
448443 :param file fileobj: The file-like object.
449- :param int shot_select: select which image to extract from RAW files that contain multiple images
450- (e.g., Dual Pixel RAW). Default is 0 for the first/main image.
451444 """
452445 self .unpack_called = False
453446 self .unpack_thumb_called = False
@@ -458,7 +451,19 @@ cdef class RawPy:
458451 with nogil:
459452 e = self .p.open_buffer(buf, buf_len)
460453 self .handle_error(e)
461- # Set shot_select after opening buffer
454+
455+ def set_unpack_params (self , shot_select = 0 ):
456+ """
457+ Set parameters that affect RAW image unpacking.
458+
459+ This should be called after opening a file and before unpacking.
460+
461+ .. NOTE:: This is a low-level method. When using :func:`rawpy.imread`,
462+ unpack parameters can be provided directly.
463+
464+ :param int shot_select: select which image to extract from RAW files that contain multiple images
465+ (e.g., Dual Pixel RAW). Default is 0 for the first/main image.
466+ """
462467 cdef libraw_raw_unpack_params_t* rp = & self .p.imgdata.rawparams
463468 rp.shot_select = shot_select
464469
0 commit comments