/usr/share/octave/site/m/pfstools/pfs_read_rgb.m is in octave-pfstools 2.1.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | function [R G B] = pfs_read_rgb( fileName )
## Read hdr image file (formats accepted by pfsin) and return R, G,
## and B color channels.
##
## [R G B] = hdr_read_rgb( fileName )
## Check if file exists
fid = fopen( fileName, "rb" );
if( fid == -1 )
error( sprintf( "pfs_read_rgb: File '%s' does not exist", fileName ) );
endif
fclose( fid );
unwind_protect
fid = popen( sprintf( 'pfsin %s', fileName ), 'r' );
pin = pfsopen( fid );
pin = pfsget( pin );
[R G B] = pfstransform_colorspace( 'XYZ', pin.channels.X, pin.channels.Y, pin.channels.Z, 'RGB' );
unwind_protect_cleanup
pfsclose( pin );
fclose( fid );
end_unwind_protect
endfunction
|