#NEWLINE# def __init__( self ) : #NEWLINE# #INDENT# libraw = util . find_library ( 'raw' ) #NEWLINE# try : #NEWLINE# #INDENT# if ( libraw is not None ) : #NEWLINE# #INDENT# super ( LibRaw , self ) . __init__ ( libraw ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ImportError #NEWLINE# #UNINDENT# #UNINDENT# except ( ImportError , AttributeError , OSError , IOError ) : #NEWLINE# #INDENT# raise ImportError ( 'Cannot find LibRaw on your system!' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# structs = { #NEWLINE# #INDENT# 16 : structs_16 , #NEWLINE# 17 : structs_17 , #NEWLINE# #UNINDENT# } [ libraw . version_number [ 1 ] ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise ImportError ( ( 'Unsupported Libraw version: %s.%s.%s.' % self . version_number ) ) #NEWLINE# #UNINDENT# libraw_data_t = structs . libraw_data_t #NEWLINE# libraw_decoder_info_t = structs . libraw_decoder_info_t #NEWLINE# libraw_processed_image_t = structs . libraw_processed_image_t #NEWLINE# self . libraw_init . argtypes = [ c_int ] #NEWLINE# self . libraw_strprogress . argtypes = [ c_int ] #NEWLINE# self . libraw_unpack_function_name . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_subtract_black . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_open_file . argtypes = [ POINTER ( libraw_data_t ) , c_char_p ] #NEWLINE# self . libraw_open_file_ex . argtypes = [ POINTER ( libraw_data_t ) , c_char_p , c_int64 ] #NEWLINE# self . libraw_open_buffer . argtypes = [ POINTER ( libraw_data_t ) , c_void_p , c_int64 ] #NEWLINE# self . libraw_unpack . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_unpack_thumb . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_recycle_datastream . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_recycle . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_close . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_set_memerror_handler . argtypes = [ POINTER ( libraw_data_t ) , memory_callback , c_void_p ] #NEWLINE# self . libraw_set_dataerror_handler . argtypes = [ POINTER ( libraw_data_t ) , data_callback , c_void_p ] #NEWLINE# self . libraw_set_progress_handler . argtypes = [ POINTER ( libraw_data_t ) , progress_callback , c_void_p ] #NEWLINE# self . libraw_adjust_sizes_info_only . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_dcraw_ppm_tiff_writer . argtypes = [ POINTER ( libraw_data_t ) , c_char_p ] #NEWLINE# self . libraw_dcraw_thumb_writer . argtypes = [ POINTER ( libraw_data_t ) , c_char_p ] #NEWLINE# self . libraw_dcraw_process . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_dcraw_make_mem_image . argtypes = [ POINTER ( libraw_data_t ) , POINTER ( c_int ) ] #NEWLINE# self . libraw_dcraw_make_mem_thumb . argtypes = [ POINTER ( libraw_data_t ) , POINTER ( c_int ) ] #NEWLINE# self . libraw_dcraw_clear_mem . argtypes = [ POINTER ( libraw_processed_image_t ) ] #NEWLINE# self . libraw_raw2image . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_free_image . argtypes = [ POINTER ( libraw_data_t ) ] #NEWLINE# self . libraw_get_decoder_info . argtypes = [ POINTER ( libraw_data_t ) , POINTER ( libraw_decoder_info_t ) ] #NEWLINE# self . libraw_COLOR . argtypes = [ POINTER ( libraw_data_t ) , c_int , c_int ] #NEWLINE# self . libraw_init . restype = POINTER ( libraw_data_t ) #NEWLINE# self . libraw_version . restype = c_char_p #NEWLINE# self . libraw_strprogress . restype = c_char_p #NEWLINE# self . libraw_versionNumber . restype = c_int #NEWLINE# self . libraw_cameraCount . restype = c_int #NEWLINE# self . libraw_cameraList . restype = POINTER ( ( c_char_p * self . libraw_cameraCount ( ) ) ) #NEWLINE# self . libraw_unpack_function_name . restype = c_char_p #NEWLINE# self . libraw_subtract_black . restype = POINTER ( libraw_data_t ) #NEWLINE# self . libraw_open_file . restype = c_error #NEWLINE# self . libraw_open_file_ex . restype = c_error #NEWLINE# self . libraw_open_buffer . restype = c_error #NEWLINE# self . libraw_unpack . restype = c_error #NEWLINE# self . libraw_unpack_thumb . restype = c_error #NEWLINE# self . libraw_adjust_sizes_info_only . restype = c_error #NEWLINE# self . libraw_dcraw_ppm_tiff_writer . restype = c_error #NEWLINE# self . libraw_dcraw_thumb_writer . restype = c_error #NEWLINE# self . libraw_dcraw_process . restype = c_error #NEWLINE# self . libraw_dcraw_make_mem_image . restype = POINTER ( libraw_processed_image_t ) #NEWLINE# self . libraw_dcraw_make_mem_thumb . restype = POINTER ( libraw_processed_image_t ) #NEWLINE# self . libraw_raw2image . restype = c_error #NEWLINE# self . libraw_get_decoder_info . restype = c_error #NEWLINE# self . libraw_COLOR . restype = c_int #NEWLINE# try : #NEWLINE# #INDENT# self . libraw_open_wfile . argtypes = [ POINTER ( libraw_data_t ) , c_wchar_p ] #NEWLINE# self . libraw_open_wfile_ex . argtypes = [ POINTER ( libraw_data_t ) , c_wchar_p , c_int64 ] #NEWLINE# self . libraw_open_wfile . restype = c_error #NEWLINE# self . libraw_open_wfile_ex . restype = c_error #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass