Skip to content

Commit

Permalink
top-level global wrapper has all top-level classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Mar 19, 2023
1 parent cfd7c24 commit 70e2c94
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
0.001 TBC
- This is a basic working perl/PDL OpencCV binding release.
- This is a basic working perl/PDL OpenCV binding
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ sub MY::postamble {
my $const = -f 'constlist.txt' ? 'wraplocal.h : constlist.txt' : '';
join "\n", pdlpp_postamble($package),
genwrap_from('opencv_wrapper', 0, ','),
genwrap_from('wraplocal', 0, ','),
genwrap_from('wraplocal', 0, ',', 'nocons'),
$const,
cpp_build($self, qw(opencv_wrapper wraplocal));
}
8 changes: 4 additions & 4 deletions genwrap.pl
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@ sub readclasses {
}

my $filegen = $ARGV[0] || die "No file given";
my @cvheaders = grep length, split /,/, $ARGV[1]||'';
my $cons_arg = $ARGV[2] // '';
my $extras = $filegen eq 'opencv_wrapper' ? [$HBODY_GLOBAL,gen_gettype().$CBODY_GLOBAL] : [qq{#include "opencv_wrapper.h"\n},""];
my $localclasses = readclasses();
my $globalclasses = +{ map +($_=>[$GLOBALTYPES{$_}, undef, "cv::$_", $extra_cons_args{$_}]), keys %GLOBALTYPES };
$globalclasses->{$_} = delete $localclasses->{$_} for grep exists $localclasses->{$_}, keys %$globalclasses;
my $typespec = $filegen eq 'opencv_wrapper' ? $globalclasses : $localclasses;
my $globalclasses = +{ (map +($_=>[$GLOBALTYPES{$_}, undef, "cv::$_", $extra_cons_args{$_}]), keys %GLOBALTYPES), %$localclasses };
my $typespec = $filegen eq 'opencv_wrapper' ? $globalclasses : $cons_arg eq 'nocons' ? +{} : $localclasses;
my $vectorspecs = $filegen eq 'opencv_wrapper' ? \%VECTORTYPES : +{};
my @cvheaders = grep length, split /,/, $ARGV[1]||'';
my $funclist = $filegen eq 'opencv_wrapper' ? [] : \@funclist;
my $consts = $filegen eq 'opencv_wrapper' ? [] : -f 'constlist.txt' ? gen_consts() : [];
make_chfiles($filegen, $extras, $typespec, $vectorspecs, \@cvheaders, $funclist, $consts);
4 changes: 4 additions & 0 deletions typemap
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ vector_KeyPointWrapper* T_OPENCV_VECTOR
vector_MatWrapper* T_OPENCV_VECTOR
vector_StringWrapper* T_OPENCV_VECTOR
vector_vector_Point2fWrapper* T_OPENCV_VECTOR
KeyPointWrapper* T_PTROBJ_SPECIAL
DMatchWrapper* T_PTROBJ_SPECIAL
FileStorageWrapper* T_PTROBJ_SPECIAL
FileNodeWrapper* T_PTROBJ_SPECIAL

INPUT
T_PTROBJ_SPECIAL
Expand Down

0 comments on commit 70e2c94

Please sign in to comment.