From 77dad7166334bb229639fcc398341e08ce9a0125 Mon Sep 17 00:00:00 2001 From: Ed J Date: Wed, 20 Nov 2024 17:09:34 +0000 Subject: [PATCH] PDL::ImageRGB switch to new lib/*.pd scheme --- Basic/.gitignore | 3 +++ Basic/Lib-ImageRGB/.gitignore | 3 --- Basic/Lib-ImageRGB/Makefile.PL | 16 ---------------- Basic/Makefile.PL | 6 +++--- .../imagergb.pd => lib/PDL/ImageRGB.pd} | 5 +++++ .../{Lib-ImageRGB => lib/PDL/ImageRGB}/pdlppm.h | 0 .../PDL/ImageRGB}/ppm_quant.c | 0 Basic/{Lib-ImageRGB => }/t/imagergb.t | 0 Basic/{Lib-ImageRGB => }/t/picnorgb.t | 0 Basic/{Lib-ImageRGB => }/t/picrgb.t | 0 MANIFEST | 13 ++++++------- MANIFEST.SKIP | 2 +- 12 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 Basic/Lib-ImageRGB/.gitignore delete mode 100644 Basic/Lib-ImageRGB/Makefile.PL rename Basic/{Lib-ImageRGB/imagergb.pd => lib/PDL/ImageRGB.pd} (96%) rename Basic/{Lib-ImageRGB => lib/PDL/ImageRGB}/pdlppm.h (100%) rename Basic/{Lib-ImageRGB => lib/PDL/ImageRGB}/ppm_quant.c (100%) rename Basic/{Lib-ImageRGB => }/t/imagergb.t (100%) rename Basic/{Lib-ImageRGB => }/t/picnorgb.t (100%) rename Basic/{Lib-ImageRGB => }/t/picrgb.t (100%) diff --git a/Basic/.gitignore b/Basic/.gitignore index 5c0266995..0b3fb1a07 100644 --- a/Basic/.gitignore +++ b/Basic/.gitignore @@ -6,6 +6,9 @@ lib/PDL/Core/pdl.h lib/PDL/FFT.c lib/PDL/FFT.pm lib/PDL/FFT.xs +lib/PDL/ImageRGB.c +lib/PDL/ImageRGB.pm +lib/PDL/ImageRGB.xs lib/PDL/Math.c lib/PDL/Math.pm lib/PDL/Math.xs diff --git a/Basic/Lib-ImageRGB/.gitignore b/Basic/Lib-ImageRGB/.gitignore deleted file mode 100644 index 470927e4f..000000000 --- a/Basic/Lib-ImageRGB/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -ImageRGB.c -ImageRGB.pm -ImageRGB.xs diff --git a/Basic/Lib-ImageRGB/Makefile.PL b/Basic/Lib-ImageRGB/Makefile.PL deleted file mode 100644 index f7104a38f..000000000 --- a/Basic/Lib-ImageRGB/Makefile.PL +++ /dev/null @@ -1,16 +0,0 @@ -use strict; -use warnings; -# Use this as a template for the Makefile.PL for -# any external PDL module. - -use ExtUtils::MakeMaker; -my @pack = ([qw(imagergb.pd ImageRGB PDL::ImageRGB)]); -my %hash = pdlpp_stdargs_int(@pack); -$hash{'OBJECT'} .= ' ppm_quant$(OBJ_EXT)'; -$hash{'clean'}{FILES} .= ' ppm_quant$(OBJ_EXT)'; - -# Add genpp rule -undef &MY::postamble; # suppress warning -*MY::postamble = sub { pdlpp_postamble_int(@pack); }; - -WriteMakefile(%hash); diff --git a/Basic/Makefile.PL b/Basic/Makefile.PL index b39ef3b65..46079b7ca 100644 --- a/Basic/Makefile.PL +++ b/Basic/Makefile.PL @@ -32,7 +32,7 @@ EOT slice subclass thread thread_def ufunc ); my $basictest = join ' ', map catfile('t', $_.'.t'), qw( - fft + fft imagergb picnorgb picrgb ); $text .= < 'PDL', VERSION_FROM => 'lib/PDL/Core.pm', diff --git a/Basic/Lib-ImageRGB/imagergb.pd b/Basic/lib/PDL/ImageRGB.pd similarity index 96% rename from Basic/Lib-ImageRGB/imagergb.pd rename to Basic/lib/PDL/ImageRGB.pd index 54f7ea489..db3ee2ec1 100644 --- a/Basic/Lib-ImageRGB/imagergb.pd +++ b/Basic/lib/PDL/ImageRGB.pd @@ -1,6 +1,11 @@ use strict; use warnings; +{ no warnings 'once'; # pass info back to Makefile.PL +$PDL::Core::Dev::EXTRAS{$::PDLMOD}{OBJECT} .= join '', map " $::PDLBASE/$_\$(OBJ_EXT)", qw(ppm_quant); +$PDL::Core::Dev::EXTRAS{$::PDLMOD}{INC} .= qq{ "-I$::PDLBASE"}; +} + pp_add_exported('',"interlrgb rgbtogr bytescl cquant "); pp_addhdr(' #include "pdlppm.h" /* Local decs */ diff --git a/Basic/Lib-ImageRGB/pdlppm.h b/Basic/lib/PDL/ImageRGB/pdlppm.h similarity index 100% rename from Basic/Lib-ImageRGB/pdlppm.h rename to Basic/lib/PDL/ImageRGB/pdlppm.h diff --git a/Basic/Lib-ImageRGB/ppm_quant.c b/Basic/lib/PDL/ImageRGB/ppm_quant.c similarity index 100% rename from Basic/Lib-ImageRGB/ppm_quant.c rename to Basic/lib/PDL/ImageRGB/ppm_quant.c diff --git a/Basic/Lib-ImageRGB/t/imagergb.t b/Basic/t/imagergb.t similarity index 100% rename from Basic/Lib-ImageRGB/t/imagergb.t rename to Basic/t/imagergb.t diff --git a/Basic/Lib-ImageRGB/t/picnorgb.t b/Basic/t/picnorgb.t similarity index 100% rename from Basic/Lib-ImageRGB/t/picnorgb.t rename to Basic/t/picnorgb.t diff --git a/Basic/Lib-ImageRGB/t/picrgb.t b/Basic/t/picrgb.t similarity index 100% rename from Basic/Lib-ImageRGB/t/picrgb.t rename to Basic/t/picrgb.t diff --git a/MANIFEST b/MANIFEST index 5d482923b..bf69eba10 100644 --- a/MANIFEST +++ b/MANIFEST @@ -29,13 +29,6 @@ Basic/Lib-Compression/t/basic.t Basic/Lib-ImageND/imagend.pd Basic/Lib-ImageND/Makefile.PL Basic/Lib-ImageND/t/imagend.t -Basic/Lib-ImageRGB/imagergb.pd -Basic/Lib-ImageRGB/Makefile.PL -Basic/Lib-ImageRGB/pdlppm.h -Basic/Lib-ImageRGB/ppm_quant.c -Basic/Lib-ImageRGB/t/imagergb.t -Basic/Lib-ImageRGB/t/picnorgb.t -Basic/Lib-ImageRGB/t/picrgb.t Basic/lib/Inline/Pdlpp.pm Basic/lib/PDL.pm Basic/lib/PDL/API.pod @@ -88,6 +81,9 @@ Basic/lib/PDL/FFT.pd Basic/lib/PDL/FFT/fftn.c Basic/lib/PDL/FFT/fftn.h Basic/lib/PDL/Graphics.pod +Basic/lib/PDL/ImageRGB.pd +Basic/lib/PDL/ImageRGB/pdlppm.h +Basic/lib/PDL/ImageRGB/ppm_quant.c Basic/lib/PDL/Index.pod Basic/lib/PDL/Indexing.pod Basic/lib/PDL/Install/Files.pm @@ -197,6 +193,7 @@ Basic/t/flexraw-iotypes.t Basic/t/flexraw.t Basic/t/flexraw_fortran.t Basic/t/func.pdl +Basic/t/imagergb.t Basic/t/inline-with.t Basic/t/inlinepdlpp.t Basic/t/lvalue.t @@ -211,6 +208,8 @@ Basic/t/ops-bitwise.t Basic/t/ops.t Basic/t/pdl_from_string.t Basic/t/pdlchar.t +Basic/t/picnorgb.t +Basic/t/picrgb.t Basic/t/pp_croaking.t Basic/t/pp_line_numbers.t Basic/t/ppt-01_ref_counting.t diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index b27059c7d..1047d83ec 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -41,6 +41,7 @@ RCS \b_eumm/ ^Basic/lib/PDL/Bad(\.(pm|xs|c)$|-pp-) ^Basic/lib/PDL/FFT(\.(pm|xs|c)$|-pp-) +^Basic/lib/PDL/ImageRGB(\.(pm|xs|c)$|-pp-) ^Basic/lib/PDL/Math(\.(pm|xs|c)$|-pp-) ^Basic/lib/PDL/MatrixOps(\.(pm|xs|c)$|-pp-) ^Basic/lib/PDL/Ops(\.(pm|xs|c)$|-pp-) @@ -55,7 +56,6 @@ RCS ^Basic/IO-Storable/Storable\..* ^Basic/Lib-Compression/Compression\..* ^Basic/Lib-ImageND/ImageND\..* -^Basic/Lib-ImageRGB/ImageRGB\..* ^Basic/script/pdl$ ^Graphics/TriD/OpenGLQ/OpenGLQ\.* ^Graphics/TriD/Rout/Rout\.*