@basemaps/lambda-tiler 6.19.0 → 6.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE +2 -2
- package/build/__test__/tile.style.json.test.d.ts +2 -0
- package/build/__test__/tile.style.json.test.d.ts.map +1 -0
- package/build/__test__/tile.style.json.test.js +33 -0
- package/build/__test__/xyz.test.js +24 -23
- package/build/cli/dump.js +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/routes/esri/rest.d.ts +10 -0
- package/build/routes/esri/rest.d.ts.map +1 -0
- package/build/routes/esri/rest.js +87 -0
- package/build/routes/imagery.d.ts +2 -0
- package/build/routes/imagery.d.ts.map +1 -1
- package/build/routes/imagery.js +3 -1
- package/build/routes/response.d.ts +4 -0
- package/build/routes/response.d.ts.map +1 -0
- package/build/routes/response.js +3 -0
- package/build/routes/tile.d.ts +0 -20
- package/build/routes/tile.d.ts.map +1 -1
- package/build/routes/tile.js +11 -161
- package/build/routes/tile.json.d.ts +10 -0
- package/build/routes/tile.json.d.ts.map +1 -0
- package/build/routes/tile.json.js +31 -0
- package/build/routes/tile.style.json.d.ts +10 -0
- package/build/routes/tile.style.json.d.ts.map +1 -0
- package/build/routes/tile.style.json.js +74 -0
- package/build/routes/tile.wmts.d.ts +9 -0
- package/build/routes/tile.wmts.d.ts.map +1 -0
- package/build/routes/tile.wmts.js +57 -0
- package/build/routes/tile.xyz.d.ts +13 -0
- package/build/routes/tile.xyz.d.ts.map +1 -0
- package/build/routes/tile.xyz.js +28 -0
- package/build/tile.set.raster.d.ts +2 -0
- package/build/tile.set.raster.d.ts.map +1 -1
- package/build/tile.set.raster.js +3 -1
- package/build/tile.set.vector.js +1 -1
- package/dist/index.js +10545 -9583
- package/dist/node_modules/color/README.md +7 -7
- package/dist/node_modules/color/index.js +173 -158
- package/dist/node_modules/color/package.json +18 -16
- package/dist/node_modules/color-convert/conversions.js +281 -310
- package/dist/node_modules/color-convert/index.js +27 -24
- package/dist/node_modules/color-convert/package.json +16 -14
- package/dist/node_modules/color-convert/route.js +22 -22
- package/dist/node_modules/color-name/package.json +17 -14
- package/dist/node_modules/color-string/package.json +5 -5
- package/dist/node_modules/decompress-response/index.d.ts +14 -21
- package/dist/node_modules/decompress-response/index.js +34 -16
- package/dist/node_modules/decompress-response/license +1 -1
- package/dist/node_modules/decompress-response/package.json +23 -17
- package/dist/node_modules/decompress-response/readme.md +2 -6
- package/dist/node_modules/detect-libc/package.json +0 -1
- package/dist/node_modules/mimic-response/index.d.ts +2 -2
- package/dist/node_modules/mimic-response/index.js +41 -2
- package/dist/node_modules/mimic-response/package.json +17 -17
- package/dist/node_modules/mimic-response/readme.md +22 -1
- package/dist/node_modules/node-abi/.circleci/config.yml +63 -0
- package/dist/node_modules/node-abi/.releaserc.json +9 -0
- package/dist/node_modules/node-abi/abi_registry.json +39 -4
- package/dist/node_modules/node-abi/index.js +5 -2
- package/dist/node_modules/node-abi/package.json +17 -16
- package/dist/node_modules/node-abi/test/index.js +7 -15
- package/dist/node_modules/node-addon-api/README.md +2 -2
- package/dist/node_modules/node-addon-api/except.gypi +20 -11
- package/dist/node_modules/node-addon-api/napi-inl.h +734 -196
- package/dist/node_modules/node-addon-api/napi.h +420 -164
- package/dist/node_modules/node-addon-api/noexcept.gypi +21 -11
- package/dist/node_modules/node-addon-api/package.json +43 -14
- package/dist/node_modules/node-addon-api/tools/clang-format.js +18 -17
- package/dist/node_modules/node-addon-api/tools/eslint-format.js +71 -0
- package/dist/node_modules/prebuild-install/CHANGELOG.md +24 -7
- package/dist/node_modules/prebuild-install/README.md +24 -4
- package/dist/node_modules/prebuild-install/asset.js +10 -10
- package/dist/node_modules/prebuild-install/bin.js +13 -13
- package/dist/node_modules/prebuild-install/download.js +22 -22
- package/dist/node_modules/prebuild-install/log.js +4 -4
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/LICENSE +201 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/README.md +160 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/index.d.ts +11 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/detect-libc.js +178 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/process.js +16 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/package.json +71 -0
- package/dist/node_modules/prebuild-install/package.json +18 -19
- package/dist/node_modules/prebuild-install/proxy.js +10 -10
- package/dist/node_modules/prebuild-install/rc.js +12 -12
- package/dist/node_modules/prebuild-install/util.js +14 -14
- package/dist/node_modules/semver/package.json +1 -0
- package/dist/node_modules/sharp/README.md +2 -2
- package/dist/node_modules/sharp/binding.gyp +12 -9
- package/dist/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
- package/dist/node_modules/sharp/install/dll-copy.js +6 -6
- package/dist/node_modules/sharp/install/libvips.js +4 -8
- package/dist/node_modules/sharp/lib/channel.js +11 -7
- package/dist/node_modules/sharp/lib/colour.js +42 -1
- package/dist/node_modules/sharp/lib/constructor.js +18 -31
- package/dist/node_modules/sharp/lib/input.js +45 -3
- package/dist/node_modules/sharp/lib/is.js +19 -5
- package/dist/node_modules/sharp/lib/libvips.js +4 -19
- package/dist/node_modules/sharp/lib/operation.js +28 -5
- package/dist/node_modules/sharp/lib/output.js +147 -16
- package/dist/node_modules/sharp/lib/sharp.js +31 -0
- package/dist/node_modules/sharp/lib/utility.js +3 -2
- package/dist/node_modules/sharp/package.json +32 -23
- package/dist/node_modules/sharp/src/common.cc +67 -11
- package/dist/node_modules/sharp/src/common.h +25 -5
- package/dist/node_modules/sharp/src/libvips/cplusplus/VConnection.cpp +0 -26
- package/dist/node_modules/sharp/src/libvips/cplusplus/VImage.cpp +54 -16
- package/dist/node_modules/sharp/src/libvips/cplusplus/VInterpolate.cpp +0 -13
- package/dist/node_modules/sharp/src/libvips/cplusplus/vips-operators.cpp +185 -1
- package/dist/node_modules/sharp/src/metadata.cc +14 -0
- package/dist/node_modules/sharp/src/metadata.h +1 -0
- package/dist/node_modules/sharp/src/operations.cc +29 -3
- package/dist/node_modules/sharp/src/operations.h +13 -2
- package/dist/node_modules/sharp/src/pipeline.cc +103 -35
- package/dist/node_modules/sharp/src/pipeline.h +23 -3
- package/dist/node_modules/sharp/src/utilities.cc +1 -1
- package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/THIRD-PARTY-NOTICES.md +2 -3
- package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/lib/libvips-cpp.so.42 +0 -0
- package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/platform.json +0 -0
- package/dist/node_modules/sharp/vendor/8.11.3/linux-x64/versions.json +30 -0
- package/dist/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/dist/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/dist/node_modules/simple-get/README.md +17 -3
- package/dist/node_modules/simple-get/index.js +9 -0
- package/dist/node_modules/simple-get/package.json +27 -13
- package/dist/package-lock.json +51 -51
- package/dist/package.json +9 -9
- package/package.json +10 -10
- package/src/__test__/tile.style.json.test.ts +40 -0
- package/src/__test__/xyz.test.ts +32 -30
- package/src/cli/dump.ts +2 -2
- package/src/index.ts +2 -0
- package/src/routes/esri/rest.ts +90 -0
- package/src/routes/imagery.ts +3 -1
- package/src/routes/response.ts +4 -0
- package/src/routes/tile.json.ts +44 -0
- package/src/routes/tile.style.json.ts +77 -0
- package/src/routes/tile.ts +11 -183
- package/src/routes/tile.wmts.ts +59 -0
- package/src/routes/tile.xyz.ts +30 -0
- package/src/tile.set.raster.ts +4 -1
- package/src/tile.set.vector.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/color-name/.eslintrc.json +0 -43
- package/dist/node_modules/color-name/test.js +0 -7
- package/dist/node_modules/node-abi/.travis.yml +0 -17
- package/dist/node_modules/node-abi/node_modules/semver/CHANGELOG.md +0 -39
- package/dist/node_modules/node-abi/node_modules/semver/LICENSE +0 -15
- package/dist/node_modules/node-abi/node_modules/semver/README.md +0 -412
- package/dist/node_modules/node-abi/node_modules/semver/bin/semver +0 -160
- package/dist/node_modules/node-abi/node_modules/semver/package.json +0 -60
- package/dist/node_modules/node-abi/node_modules/semver/range.bnf +0 -16
- package/dist/node_modules/node-abi/node_modules/semver/semver.js +0 -1483
- package/dist/node_modules/node-addon-api/CHANGELOG.md +0 -722
- package/dist/node_modules/sharp/build/Release/sharp.node +0 -0
- package/dist/node_modules/sharp/vendor/8.10.6/versions.json +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// bodies for vips operations
|
|
2
|
-
//
|
|
2
|
+
// Wed May 12 11:30:00 AM CEST 2021
|
|
3
3
|
// this file is generated automatically, do not edit!
|
|
4
4
|
|
|
5
5
|
VImage VImage::CMC2LCh( VOption *options ) const
|
|
@@ -1065,6 +1065,18 @@ VImage VImage::fitsload( const char *filename, VOption *options )
|
|
|
1065
1065
|
return( out );
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
|
+
VImage VImage::fitsload_source( VSource source, VOption *options )
|
|
1069
|
+
{
|
|
1070
|
+
VImage out;
|
|
1071
|
+
|
|
1072
|
+
call( "fitsload_source",
|
|
1073
|
+
(options ? options : VImage::option())->
|
|
1074
|
+
set( "out", &out )->
|
|
1075
|
+
set( "source", source ) );
|
|
1076
|
+
|
|
1077
|
+
return( out );
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1068
1080
|
void VImage::fitssave( const char *filename, VOption *options ) const
|
|
1069
1081
|
{
|
|
1070
1082
|
call( "fitssave",
|
|
@@ -1656,6 +1668,70 @@ VImage VImage::join( VImage in2, VipsDirection direction, VOption *options ) con
|
|
|
1656
1668
|
return( out );
|
|
1657
1669
|
}
|
|
1658
1670
|
|
|
1671
|
+
VImage VImage::jp2kload( const char *filename, VOption *options )
|
|
1672
|
+
{
|
|
1673
|
+
VImage out;
|
|
1674
|
+
|
|
1675
|
+
call( "jp2kload",
|
|
1676
|
+
(options ? options : VImage::option())->
|
|
1677
|
+
set( "out", &out )->
|
|
1678
|
+
set( "filename", filename ) );
|
|
1679
|
+
|
|
1680
|
+
return( out );
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
VImage VImage::jp2kload_buffer( VipsBlob *buffer, VOption *options )
|
|
1684
|
+
{
|
|
1685
|
+
VImage out;
|
|
1686
|
+
|
|
1687
|
+
call( "jp2kload_buffer",
|
|
1688
|
+
(options ? options : VImage::option())->
|
|
1689
|
+
set( "out", &out )->
|
|
1690
|
+
set( "buffer", buffer ) );
|
|
1691
|
+
|
|
1692
|
+
return( out );
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
VImage VImage::jp2kload_source( VSource source, VOption *options )
|
|
1696
|
+
{
|
|
1697
|
+
VImage out;
|
|
1698
|
+
|
|
1699
|
+
call( "jp2kload_source",
|
|
1700
|
+
(options ? options : VImage::option())->
|
|
1701
|
+
set( "out", &out )->
|
|
1702
|
+
set( "source", source ) );
|
|
1703
|
+
|
|
1704
|
+
return( out );
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
void VImage::jp2ksave( const char *filename, VOption *options ) const
|
|
1708
|
+
{
|
|
1709
|
+
call( "jp2ksave",
|
|
1710
|
+
(options ? options : VImage::option())->
|
|
1711
|
+
set( "in", *this )->
|
|
1712
|
+
set( "filename", filename ) );
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
VipsBlob *VImage::jp2ksave_buffer( VOption *options ) const
|
|
1716
|
+
{
|
|
1717
|
+
VipsBlob *buffer;
|
|
1718
|
+
|
|
1719
|
+
call( "jp2ksave_buffer",
|
|
1720
|
+
(options ? options : VImage::option())->
|
|
1721
|
+
set( "in", *this )->
|
|
1722
|
+
set( "buffer", &buffer ) );
|
|
1723
|
+
|
|
1724
|
+
return( buffer );
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
void VImage::jp2ksave_target( VTarget target, VOption *options ) const
|
|
1728
|
+
{
|
|
1729
|
+
call( "jp2ksave_target",
|
|
1730
|
+
(options ? options : VImage::option())->
|
|
1731
|
+
set( "in", *this )->
|
|
1732
|
+
set( "target", target ) );
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1659
1735
|
VImage VImage::jpegload( const char *filename, VOption *options )
|
|
1660
1736
|
{
|
|
1661
1737
|
VImage out;
|
|
@@ -1727,6 +1803,70 @@ void VImage::jpegsave_target( VTarget target, VOption *options ) const
|
|
|
1727
1803
|
set( "target", target ) );
|
|
1728
1804
|
}
|
|
1729
1805
|
|
|
1806
|
+
VImage VImage::jxlload( const char *filename, VOption *options )
|
|
1807
|
+
{
|
|
1808
|
+
VImage out;
|
|
1809
|
+
|
|
1810
|
+
call( "jxlload",
|
|
1811
|
+
(options ? options : VImage::option())->
|
|
1812
|
+
set( "out", &out )->
|
|
1813
|
+
set( "filename", filename ) );
|
|
1814
|
+
|
|
1815
|
+
return( out );
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
VImage VImage::jxlload_buffer( VipsBlob *buffer, VOption *options )
|
|
1819
|
+
{
|
|
1820
|
+
VImage out;
|
|
1821
|
+
|
|
1822
|
+
call( "jxlload_buffer",
|
|
1823
|
+
(options ? options : VImage::option())->
|
|
1824
|
+
set( "out", &out )->
|
|
1825
|
+
set( "buffer", buffer ) );
|
|
1826
|
+
|
|
1827
|
+
return( out );
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
VImage VImage::jxlload_source( VSource source, VOption *options )
|
|
1831
|
+
{
|
|
1832
|
+
VImage out;
|
|
1833
|
+
|
|
1834
|
+
call( "jxlload_source",
|
|
1835
|
+
(options ? options : VImage::option())->
|
|
1836
|
+
set( "out", &out )->
|
|
1837
|
+
set( "source", source ) );
|
|
1838
|
+
|
|
1839
|
+
return( out );
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
void VImage::jxlsave( const char *filename, VOption *options ) const
|
|
1843
|
+
{
|
|
1844
|
+
call( "jxlsave",
|
|
1845
|
+
(options ? options : VImage::option())->
|
|
1846
|
+
set( "in", *this )->
|
|
1847
|
+
set( "filename", filename ) );
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
VipsBlob *VImage::jxlsave_buffer( VOption *options ) const
|
|
1851
|
+
{
|
|
1852
|
+
VipsBlob *buffer;
|
|
1853
|
+
|
|
1854
|
+
call( "jxlsave_buffer",
|
|
1855
|
+
(options ? options : VImage::option())->
|
|
1856
|
+
set( "in", *this )->
|
|
1857
|
+
set( "buffer", &buffer ) );
|
|
1858
|
+
|
|
1859
|
+
return( buffer );
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
void VImage::jxlsave_target( VTarget target, VOption *options ) const
|
|
1863
|
+
{
|
|
1864
|
+
call( "jxlsave_target",
|
|
1865
|
+
(options ? options : VImage::option())->
|
|
1866
|
+
set( "in", *this )->
|
|
1867
|
+
set( "target", target ) );
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1730
1870
|
VImage VImage::labelregions( VOption *options ) const
|
|
1731
1871
|
{
|
|
1732
1872
|
VImage mask;
|
|
@@ -2284,6 +2424,18 @@ VImage VImage::niftiload( const char *filename, VOption *options )
|
|
|
2284
2424
|
return( out );
|
|
2285
2425
|
}
|
|
2286
2426
|
|
|
2427
|
+
VImage VImage::niftiload_source( VSource source, VOption *options )
|
|
2428
|
+
{
|
|
2429
|
+
VImage out;
|
|
2430
|
+
|
|
2431
|
+
call( "niftiload_source",
|
|
2432
|
+
(options ? options : VImage::option())->
|
|
2433
|
+
set( "out", &out )->
|
|
2434
|
+
set( "source", source ) );
|
|
2435
|
+
|
|
2436
|
+
return( out );
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2287
2439
|
void VImage::niftisave( const char *filename, VOption *options ) const
|
|
2288
2440
|
{
|
|
2289
2441
|
call( "niftisave",
|
|
@@ -2316,6 +2468,18 @@ VImage VImage::openslideload( const char *filename, VOption *options )
|
|
|
2316
2468
|
return( out );
|
|
2317
2469
|
}
|
|
2318
2470
|
|
|
2471
|
+
VImage VImage::openslideload_source( VSource source, VOption *options )
|
|
2472
|
+
{
|
|
2473
|
+
VImage out;
|
|
2474
|
+
|
|
2475
|
+
call( "openslideload_source",
|
|
2476
|
+
(options ? options : VImage::option())->
|
|
2477
|
+
set( "out", &out )->
|
|
2478
|
+
set( "source", source ) );
|
|
2479
|
+
|
|
2480
|
+
return( out );
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2319
2483
|
VImage VImage::pdfload( const char *filename, VOption *options )
|
|
2320
2484
|
{
|
|
2321
2485
|
VImage out;
|
|
@@ -3388,6 +3552,18 @@ VImage VImage::vipsload( const char *filename, VOption *options )
|
|
|
3388
3552
|
return( out );
|
|
3389
3553
|
}
|
|
3390
3554
|
|
|
3555
|
+
VImage VImage::vipsload_source( VSource source, VOption *options )
|
|
3556
|
+
{
|
|
3557
|
+
VImage out;
|
|
3558
|
+
|
|
3559
|
+
call( "vipsload_source",
|
|
3560
|
+
(options ? options : VImage::option())->
|
|
3561
|
+
set( "out", &out )->
|
|
3562
|
+
set( "source", source ) );
|
|
3563
|
+
|
|
3564
|
+
return( out );
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3391
3567
|
void VImage::vipssave( const char *filename, VOption *options ) const
|
|
3392
3568
|
{
|
|
3393
3569
|
call( "vipssave",
|
|
@@ -3396,6 +3572,14 @@ void VImage::vipssave( const char *filename, VOption *options ) const
|
|
|
3396
3572
|
set( "filename", filename ) );
|
|
3397
3573
|
}
|
|
3398
3574
|
|
|
3575
|
+
void VImage::vipssave_target( VTarget target, VOption *options ) const
|
|
3576
|
+
{
|
|
3577
|
+
call( "vipssave_target",
|
|
3578
|
+
(options ? options : VImage::option())->
|
|
3579
|
+
set( "in", *this )->
|
|
3580
|
+
set( "target", target ) );
|
|
3581
|
+
}
|
|
3582
|
+
|
|
3399
3583
|
VImage VImage::webpload( const char *filename, VOption *options )
|
|
3400
3584
|
{
|
|
3401
3585
|
VImage out;
|
|
@@ -90,6 +90,9 @@ class MetadataWorker : public Napi::AsyncWorker {
|
|
|
90
90
|
baton->subifds = image.get_int(VIPS_META_N_SUBIFDS);
|
|
91
91
|
}
|
|
92
92
|
baton->hasProfile = sharp::HasProfile(image);
|
|
93
|
+
if (image.get_typeof("background") == VIPS_TYPE_ARRAY_DOUBLE) {
|
|
94
|
+
baton->background = image.get_array_double("background");
|
|
95
|
+
}
|
|
93
96
|
// Derived attributes
|
|
94
97
|
baton->hasAlpha = sharp::HasAlpha(image);
|
|
95
98
|
baton->orientation = sharp::ExifOrientation(image);
|
|
@@ -209,6 +212,17 @@ class MetadataWorker : public Napi::AsyncWorker {
|
|
|
209
212
|
if (baton->subifds > 0) {
|
|
210
213
|
info.Set("subifds", baton->subifds);
|
|
211
214
|
}
|
|
215
|
+
if (!baton->background.empty()) {
|
|
216
|
+
if (baton->background.size() == 3) {
|
|
217
|
+
Napi::Object background = Napi::Object::New(env);
|
|
218
|
+
background.Set("r", baton->background[0]);
|
|
219
|
+
background.Set("g", baton->background[1]);
|
|
220
|
+
background.Set("b", baton->background[2]);
|
|
221
|
+
info.Set("background", background);
|
|
222
|
+
} else {
|
|
223
|
+
info.Set("background", baton->background[0]);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
212
226
|
info.Set("hasProfile", baton->hasProfile);
|
|
213
227
|
info.Set("hasAlpha", baton->hasAlpha);
|
|
214
228
|
if (baton->orientation > 0) {
|
|
@@ -112,6 +112,19 @@ namespace sharp {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Produce the "negative" of the image.
|
|
117
|
+
*/
|
|
118
|
+
VImage Negate(VImage image, bool const negateAlpha) {
|
|
119
|
+
if (HasAlpha(image) && !negateAlpha) {
|
|
120
|
+
// Separate alpha channel
|
|
121
|
+
VImage alpha = image[image.bands() - 1];
|
|
122
|
+
return RemoveAlpha(image).invert().bandjoin(alpha);
|
|
123
|
+
} else {
|
|
124
|
+
return image.invert();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
115
128
|
/*
|
|
116
129
|
* Gaussian blur. Use sigma of -1.0 for fast blur.
|
|
117
130
|
*/
|
|
@@ -169,7 +182,8 @@ namespace sharp {
|
|
|
169
182
|
0.0, 0.0, 0.0, 1.0));
|
|
170
183
|
}
|
|
171
184
|
|
|
172
|
-
VImage Modulate(VImage image, double const brightness, double const saturation,
|
|
185
|
+
VImage Modulate(VImage image, double const brightness, double const saturation,
|
|
186
|
+
int const hue, double const lightness) {
|
|
173
187
|
if (HasAlpha(image)) {
|
|
174
188
|
// Separate alpha channel
|
|
175
189
|
VImage alpha = image[image.bands() - 1];
|
|
@@ -177,7 +191,7 @@ namespace sharp {
|
|
|
177
191
|
.colourspace(VIPS_INTERPRETATION_LCH)
|
|
178
192
|
.linear(
|
|
179
193
|
{ brightness, saturation, 1},
|
|
180
|
-
{
|
|
194
|
+
{ lightness, 0.0, static_cast<double>(hue) }
|
|
181
195
|
)
|
|
182
196
|
.colourspace(VIPS_INTERPRETATION_sRGB)
|
|
183
197
|
.bandjoin(alpha);
|
|
@@ -186,7 +200,7 @@ namespace sharp {
|
|
|
186
200
|
.colourspace(VIPS_INTERPRETATION_LCH)
|
|
187
201
|
.linear(
|
|
188
202
|
{ brightness, saturation, 1 },
|
|
189
|
-
{
|
|
203
|
+
{ lightness, 0.0, static_cast<double>(hue) }
|
|
190
204
|
)
|
|
191
205
|
.colourspace(VIPS_INTERPRETATION_sRGB);
|
|
192
206
|
}
|
|
@@ -282,4 +296,16 @@ namespace sharp {
|
|
|
282
296
|
return image.linear(a, b);
|
|
283
297
|
}
|
|
284
298
|
}
|
|
299
|
+
|
|
300
|
+
/*
|
|
301
|
+
* Ensure the image is in a given colourspace
|
|
302
|
+
*/
|
|
303
|
+
VImage EnsureColourspace(VImage image, VipsInterpretation colourspace) {
|
|
304
|
+
if (colourspace != VIPS_INTERPRETATION_LAST && image.interpretation() != colourspace) {
|
|
305
|
+
image = image.colourspace(colourspace,
|
|
306
|
+
VImage::option()->set("source_space", image.interpretation()));
|
|
307
|
+
}
|
|
308
|
+
return image;
|
|
309
|
+
}
|
|
310
|
+
|
|
285
311
|
} // namespace sharp
|
|
@@ -45,6 +45,11 @@ namespace sharp {
|
|
|
45
45
|
*/
|
|
46
46
|
VImage Gamma(VImage image, double const exponent);
|
|
47
47
|
|
|
48
|
+
/*
|
|
49
|
+
* Produce the "negative" of the image.
|
|
50
|
+
*/
|
|
51
|
+
VImage Negate(VImage image, bool const negateAlpha);
|
|
52
|
+
|
|
48
53
|
/*
|
|
49
54
|
* Gaussian blur. Use sigma of -1.0 for fast blur.
|
|
50
55
|
*/
|
|
@@ -93,9 +98,15 @@ namespace sharp {
|
|
|
93
98
|
VImage Recomb(VImage image, std::unique_ptr<double[]> const &matrix);
|
|
94
99
|
|
|
95
100
|
/*
|
|
96
|
-
* Modulate brightness, saturation and
|
|
101
|
+
* Modulate brightness, saturation, hue and lightness
|
|
102
|
+
*/
|
|
103
|
+
VImage Modulate(VImage image, double const brightness, double const saturation,
|
|
104
|
+
int const hue, double const lightness);
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
* Ensure the image is in a given colourspace
|
|
97
108
|
*/
|
|
98
|
-
VImage
|
|
109
|
+
VImage EnsureColourspace(VImage image, VipsInterpretation colourspace);
|
|
99
110
|
|
|
100
111
|
} // namespace sharp
|
|
101
112
|
|