File: depthmap.config

package info (click to toggle)
libimage-exiftool-perl 12.57%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 27,740 kB
  • sloc: perl: 280,930; xml: 120; makefile: 13
file content (56 lines) | stat: -rw-r--r-- 1,735 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#------------------------------------------------------------------------------
# File:         depthmap.config
#
# Description:  Composite tag definitions to extract DepthMap and ConfidenceMap
#               images from Google Dynamic-depth images
#
# Usage:        exiftool -config depthmap.config -W %d%f_%t.%s -depthmap -confidencemap -b DIR
#
# Requires:     ExifTool version 11.88 or later
#
# Revisions:    2020/02/20 - P. Harvey Created
#------------------------------------------------------------------------------

sub GetTrailerImage($$)
{
    my ($val, $type) = @_;
    my @uri = ref $$val[1] ? @{$$val[1]} : $$val[1];
    my @len = ref $$val[2] ? @{$$val[2]} : $$val[2];
    my $start = 0;
    for (my $i=0; $i<@uri; ++$i) {
        if ($uri[$i] =~ /$type/) {
            my $img = substr(${$$val[0]}, $start, $len[$i]);
            return \$img;
        }
        $start += $len[$i];
    }
    return undef;
}

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        DepthMap => {
            Require => {
                0 => 'Trailer',
                1 => 'ContainerDirectoryItemDataURI',
                2 => 'ContainerDirectoryItemLength',
            },
            ValueConv => 'GetTrailerImage(\@val, "depthmap")',
        },
        ConfidenceMap => {
            Require => {
                0 => 'Trailer',
                1 => 'ContainerDirectoryItemDataURI',
                2 => 'ContainerDirectoryItemLength',
            },
            ValueConv => 'GetTrailerImage(\@val, "confidencemap")',
        },
    },
);

%Image::ExifTool::UserDefined::Options = (
    RequestTags => 'Trailer',
);

#------------------------------------------------------------------------------
1;  #end