peachsim 0.1.1692 → 0.1.1700
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/cli/bridge-flow-runner.ts +61 -39
- package/cli/commands/agent-wrapper.ts +21 -10
- package/cli/commands/control.ts +27 -7
- package/cli/commands/coverage.ts +1 -1
- package/cli/commands/detect.ts +17 -4
- package/cli/commands/maestro-compare.ts +25 -99
- package/cli/help-core.ts +3 -4
- package/cli/maestro-compare.ts +172 -4
- package/cli/outbound-endpoints.ts +2 -10
- package/detox/index.ts +15 -0
- package/detox/launch-permissions.ts +169 -0
- package/dist-lib/agent-daemon-client.cjs +2 -2
- package/dist-lib/agent-events.cjs +2 -2
- package/dist-lib/attached-projects.cjs +2 -2
- package/dist-lib/auth/shared-session.cjs +2 -2
- package/dist-lib/backend-origin.cjs +2 -2
- package/dist-lib/beta.cjs +2 -2
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +2 -2
- package/dist-lib/bridge-contract-input.cjs +2 -2
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +2 -2
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +18273 -15925
- package/dist-lib/capture-contract.cjs +2 -2
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +2 -2
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +2 -2
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +2 -2
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +2 -2
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +104 -3
- package/dist-lib/dev-bundle-resolution.cjs +208 -44
- package/dist-lib/expo-swift-bundle.cjs +2349 -1778
- package/dist-lib/expo-swift-metadata.cjs +2 -2
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +2 -2
- package/dist-lib/host/bridge-host.cjs +7885 -3334
- package/dist-lib/host/fetch-proxy-handler.cjs +331 -39
- package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +2 -2
- package/dist-lib/host/websocket-proxy.cjs +2 -2
- package/dist-lib/index.cjs +297 -77
- package/dist-lib/jump-to-source-babel.cjs +2 -2
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +2 -2
- package/dist-lib/menu.cjs +2 -2
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +2 -2
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +2 -2
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +294 -74
- package/dist-lib/native-app-identity-project.cjs +48 -37
- package/dist-lib/native-app-identity-project.mjs +47 -36
- package/dist-lib/native-app-identity.cjs +2 -2
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +2 -2
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +2 -2
- package/dist-lib/public-brand.cjs +2 -2
- package/dist-lib/public-origins-lib-esm.json +24 -23
- package/dist-lib/public-origins-lib.json +199 -79
- package/dist-lib/react-native-host-modules.cjs +2 -2
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +206 -31
- package/dist-lib/sdk.cjs +2 -2
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +19600 -15992
- package/dist-lib/swift-compile.cjs +640 -402
- package/dist-lib/swift-compile.mjs +595 -357
- package/dist-lib/swift-package.cjs +24 -20
- package/dist-lib/swift-package.mjs +23 -19
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +31 -4
- package/dist-lib/swift.cjs +2 -2
- package/dist-lib/vite-swift.cjs +1559 -1208
- package/dist-lib/vite.cjs +251 -42
- package/dist-lib/worklet-executable.cjs +2 -2
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
- package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
- package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +3 -0
- package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +4 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +11 -229
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2 -1
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +4 -0
- package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
- package/sdk/ios/usr/include/copyfile.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
- package/sdk/ios/usr/include/malloc/_platform.h +80 -0
- package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
- package/sdk/ios/usr/include/malloc/malloc.h +768 -0
- package/sdk/ios/usr/include/os/availability.h +168 -6
- package/sdk/ios/usr/include/os/base.h +351 -0
- package/sdk/ios/usr/include/os/clock.h +18 -0
- package/sdk/ios/usr/include/os/lock.h +232 -10
- package/sdk/ios/usr/include/os/log.h +521 -38
- package/sdk/ios/usr/include/os/object.h +320 -3
- package/sdk/ios/usr/include/os/trace.h +492 -0
- package/sdk/ios/usr/include/os/trace_base.h +167 -0
- package/sdk/ios/usr/include/os/workgroup.h +37 -0
- package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
- package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
- package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
- package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
- package/sdk/ios/usr/include/sys/cdefs.h +38 -0
- package/sdk/ios/wasm/include/unistd.h +3 -0
- package/skills/contrast/SKILL.md +3 -0
- package/src/codex-client.ts +11 -6
- package/src/dev-bundle-resolution.ts +124 -48
- package/src/expo-native-workspace.ts +176 -0
- package/src/expo-swift-host.ts +161 -26
- package/src/expo-swift-ready.ts +14 -28
- package/src/expoSwiftContract.ts +4 -1
- package/src/generated/swift-c-predefines.json +68 -12
- package/src/host/bridge-host.ts +5 -0
- package/src/installed-package-versions.ts +14 -1
- package/src/metro-project-root.ts +44 -33
- package/src/native-app-identity-project.ts +1 -0
- package/src/nitro-adapter.lock.json +916 -10
- package/src/nitro-adapter.ts +33 -24
- package/src/nitro-bundle.ts +108 -22
- package/src/nitro-compile.ts +32 -5
- package/src/nitro-source.ts +13 -3
- package/src/nitroAdapterContract.ts +100 -20
- package/src/node-http-fetch.ts +116 -0
- package/src/packageVersionsContract.ts +46 -0
- package/src/serverDiscoveryContract.ts +1 -0
- package/src/settingsContract.ts +0 -30
- package/src/swift-binary-modules.ts +20 -5
- package/src/swift-compile.ts +168 -48
- package/src/swift-coverage/xcode-assets.ts +4 -3
- package/src/swift-host.ts +14 -3
- package/src/swift-objc-compile.ts +32 -5
- package/src/swift-objc-metadata.ts +2 -2
- package/src/swift-objc-platform.ts +2 -2
- package/src/swift-objc-standin.ts +43 -13
- package/src/swift-package.ts +33 -26
- package/src/swift-source-pods.ts +126 -41
- package/src/swift-standin-digest.ts +77 -0
- package/src/swift-standin-emit.ts +40 -4
- package/src/swift-standins.ts +68 -19
- package/src/swift-toolchain.ts +38 -0
- package/src/swiftContract.ts +8 -0
- package/src/vite-plugin.ts +0 -10
- package/src/xcode-project.ts +62 -42
- package/src/settings-flags.ts +0 -107
|
@@ -1,17 +1,836 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Geometry.h
|
|
3
|
+
* vImage_Framework
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2002-2022 by Apple Inc. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
*
|
|
12
|
+
* This suite of functions allows the caller to rotate, resize and distort images. Resampling
|
|
13
|
+
* is currently done with a Lanczos kernel.
|
|
14
|
+
*
|
|
15
|
+
* The 90 degree rotate function requires that the corresponding destination axes share the
|
|
16
|
+
* same even/odd parity for size as the source buffer. Otherwise, the image may become uncentered
|
|
17
|
+
* by a half a pixel. For example if the input buffer has a width of 3 and a height of 4, and you rotate
|
|
18
|
+
* 90 degrees, the destination buffer should have a even width (4 is even) and a odd height (3 is odd).
|
|
19
|
+
* For a 180 degree rotate, the width would have to be odd and the height even.
|
|
20
|
+
*
|
|
21
|
+
* Set the vImageEdgeExtend flag if you wish to use the edge pixels of the image as the color of regions
|
|
22
|
+
* outside the input vImage_Buffer. In general, this is not a good idea, however if you are just resizing,
|
|
23
|
+
* it will prevent the background color from bleeding into the edges of the image.
|
|
24
|
+
*
|
|
25
|
+
* The kvImageLeaveAlphaUnchanged flag is ignored for this set of functions, since most of these
|
|
26
|
+
* functions involve a high degree of resampling. It is not clear in most cases what the
|
|
27
|
+
* appropriate "unchanged" value would be to use.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
#ifndef VIMAGE_GEOMETRY_H
|
|
33
|
+
#define VIMAGE_GEOMETRY_H
|
|
34
|
+
|
|
3
35
|
#include <vImage/vImage_Types.h>
|
|
4
|
-
|
|
36
|
+
|
|
5
37
|
#ifdef __cplusplus
|
|
6
38
|
extern "C" {
|
|
7
39
|
#endif
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
40
|
+
|
|
41
|
+
//Rotation constants for use with Rotate_90_*
|
|
42
|
+
enum
|
|
43
|
+
{
|
|
44
|
+
kRotate0DegreesClockwise VIMAGE_ENUM_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_5_0 ) = 0,
|
|
45
|
+
kRotate90DegreesClockwise VIMAGE_ENUM_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_5_0 ) = 3,
|
|
46
|
+
kRotate180DegreesClockwise VIMAGE_ENUM_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_5_0 ) = 2,
|
|
47
|
+
kRotate270DegreesClockwise VIMAGE_ENUM_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_5_0 ) = 1,
|
|
48
|
+
|
|
49
|
+
kRotate0DegreesCounterClockwise VIMAGE_ENUM_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_5_0 ) = 0,
|
|
50
|
+
kRotate90DegreesCounterClockwise VIMAGE_ENUM_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_5_0 ) = 1,
|
|
51
|
+
kRotate180DegreesCounterClockwise VIMAGE_ENUM_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_5_0 ) = 2,
|
|
52
|
+
kRotate270DegreesCounterClockwise VIMAGE_ENUM_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_5_0 ) = 3
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
#include <TargetConditionals.h>
|
|
56
|
+
#if !0 && !0
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* High Level Geometry Functions
|
|
60
|
+
* ----------------------------
|
|
61
|
+
* vImage provides a set of high level geometry functions to do simple geometric transforms on an image.
|
|
62
|
+
* These are:
|
|
63
|
+
*
|
|
64
|
+
* Rotate -- rotate the input image around a center point by any amount and write to a destination buffer.
|
|
65
|
+
* Scale -- resize the input image to the size of the destination buffer
|
|
66
|
+
* Affine Transform -- Apply an affine transform to an image
|
|
67
|
+
* Perspective Transform -- Apply a perspective (projective) transform to an image
|
|
68
|
+
*
|
|
69
|
+
* When calling the Rotate, Affine, and Perspective Transform functions, it is possible that some part of the output
|
|
70
|
+
* image may come from regions of the input image that are outside the original input image. In these cases,
|
|
71
|
+
* the "revealed" pixels will be of the color provided in the backgroundColor parameter passed to the function,
|
|
72
|
+
* unless kvImageEdgeExtend is passed, in which case it will be taken from the nearest edge pixel.
|
|
73
|
+
*
|
|
74
|
+
* The Scaling function may need to read outside the edges of the input buffer to service the resampling kernel.
|
|
75
|
+
* In this case the values of the edge pixels a replicated outward infinitely. This allows us to avoid having
|
|
76
|
+
* the background color bleed into the edges of the image. If you wish to rescale part of an image and have the rest
|
|
77
|
+
* of the image considered for this operation, use the Affine Transform for scaling.
|
|
78
|
+
*
|
|
79
|
+
* Temporary Buffers
|
|
80
|
+
* -----------------
|
|
81
|
+
* The high level geometry functions cannot operate in place and cannot operate simply within the confines of the
|
|
82
|
+
* source and destination buffers. This is because they employ multipass algorithms that need to save
|
|
83
|
+
* intermediate pixel values between passes. The destination buffer may not be large enough to hold that
|
|
84
|
+
* information or later passes may not operate correctly in place, meaning that additional storage is
|
|
85
|
+
* required. Temporary storage is required by the higher level Geometry operations: Rotate, Scale,
|
|
86
|
+
* and Affine Transform.
|
|
87
|
+
*
|
|
88
|
+
* Even though temporary storage is required by these functions, you may pass NULL for the pointer to
|
|
89
|
+
* a temporary buffer. This may cause vImage to call malloc to allocate a buffer for you. It will
|
|
90
|
+
* be destroyed before the function returns to prevent a memory leak. This is a perfectly sensible thing
|
|
91
|
+
* to do when the function is not called often and possibly blocking on a lock for a short period of time
|
|
92
|
+
* is not a problem. (Malloc may block on a lock.)
|
|
93
|
+
*
|
|
94
|
+
* If you plan to call the function frequently over a relatively short period of time, or you need real time
|
|
95
|
+
* performance guarantees (which make locks a problem) then you should preallocate your own temporary
|
|
96
|
+
* working buffer for vImage to use and reuse that. This will avoid the per-call malloc overhead, helping
|
|
97
|
+
* to guarantee top performance. In addition, it avoids a problem caused by the fact that large
|
|
98
|
+
* (i.e. image sized) buffers allocated by malloc are usually allocated by the OS in a paged-out state.
|
|
99
|
+
* (They are not on disk. They do not physically exist until you touch the page, at which point they are
|
|
100
|
+
* allocated and zero filled on demand.) This means that as we touch each new 4k page we take an interrupt to zero fill
|
|
101
|
+
* the page, which would be nice to avoid. If you call the vImage function rarely, this is not worth worrying
|
|
102
|
+
* about, since whatever buffer you preallocate is likely to be paged out to disk by the VM system anyway.
|
|
103
|
+
* It is just on the 2nd and later calls in quick succession that this is a performance win, since we can
|
|
104
|
+
* avoid the paging activity.
|
|
105
|
+
*
|
|
106
|
+
* You may allocate the temporary buffer anywhere you like -- heap, global, stack, etc.
|
|
107
|
+
* Be aware that the stack size limit is user configurable and in many cases may not be large enough.
|
|
108
|
+
* The buffer should not be shared reentrantly between different threads in a multithreaded app, unless you
|
|
109
|
+
* protect it with a mutual exclusion device such as a lock/mutex/etc. Otherwise two vImage functions may
|
|
110
|
+
* overwrite each other and produce garbled image data. No information is kept in the temporary buffer
|
|
111
|
+
* between function calls.
|
|
112
|
+
*
|
|
113
|
+
* All four channel geometry functions (i.e. those that support ARGB8888, ARGB16U, ARGB16S or ARGBFFFF images) work equally
|
|
114
|
+
* well on four channel images with other channel orderings such as RGBA or BGRA.
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
* vImageRotate_<fmt>
|
|
119
|
+
* =================
|
|
120
|
+
* vImageRotate_<fmt> is a convenience function to provide facile rotation of images about their center point. The operation can also be done with vImageWarp_<fmt>, or
|
|
121
|
+
* by using appropriate low level vImageHorizontal/VerticalShear_<fmt> interfaces. vImageWarp_<fmt> may be appropriate if you wish to rotate around a non-center point in
|
|
122
|
+
* the image. vImageHorizontal/VerticalShear_<fmt> will provide the greatest detail in control, since it allows for alternative sampling methods, and also the opportunity to
|
|
123
|
+
* control how tiling is done. This might allow for better cache utilization in cases where a format conversion (or other fast filter) is required either before or after
|
|
124
|
+
* the scaling operation and you wish to incorporate it into your tiling design.
|
|
125
|
+
*
|
|
126
|
+
* To avoid artifacts in high frequency regions of the image, the data should be non-premultiplied, or at minimum have the same alpha over the entire image. For integer
|
|
127
|
+
* formats with constant alpha < PIXEL_MAX, it is possible for result color values to be greater than alpha. vImageClipToAlpha_<fmt> can be used to correct that problem.
|
|
128
|
+
* Some other functions like vImageUnpremultiplyData_<fmt> will correct the problem as part of their operation, if they appear later in your image pipeline.
|
|
129
|
+
* Otherwise, integer formats are clamped in the range [0,255] and can not experience modulo overflow problems. For floating-point formats, it is always possible to
|
|
130
|
+
* produce out-of-gamut or greater than alpha results, most often in high-frequency regions of the image. Out-of-gamut results are often resolved when the floating-point
|
|
131
|
+
* format is converted to an integer format in a later vImage call -- all conversions to integer format are clamped to the representable range. However, color values
|
|
132
|
+
* greater than alpha will persist if the alpha is less than fully opaque, and can be fixed by vImageClipToAlpha_<fmt> as with the integer formats.
|
|
133
|
+
* vImageUnpremultiplyData_<fmt> and vImagePremultiplyData_<fmt> are much, much faster than vImageRotate_<fmt> and typically only add a few percent to the overall cost
|
|
134
|
+
* of the filter.
|
|
135
|
+
*
|
|
136
|
+
* vImageRotate_<fmt>() does not work in place
|
|
137
|
+
* The ARGB8888, ARGB16U, ARGB16S and ARGBFFFF functions work equally well on other channel orderings of 4-channel images, such as RGBA or BGRA.
|
|
138
|
+
*
|
|
139
|
+
* Acceptable flags are kvImageEdgeExtend, kvImageBackgroundColorFill, kvImageDoNotTile, kvImageHighQualityResampling, kvImageNoFlags. If no edging mode is passed,
|
|
140
|
+
* the edging mode is undefined. You may not pass both kvImageEdgeExtend and kvImageBackgroundColorFill. kvImageEdgeExtend will leave odd stripes in areas for which
|
|
141
|
+
* no corresponding source image pixel exists, corresponding to the value of the nearest edge pixel, for some value of "nearest". kvImageBackgroundColorFill is most
|
|
142
|
+
* commonly used.
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
VIMAGE_PF vImage_Error vImageRotate_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
146
|
+
VIMAGE_PF vImage_Error vImageRotate_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
147
|
+
VIMAGE_PF vImage_Error vImageRotate_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
148
|
+
VIMAGE_PF vImage_Error vImageRotate_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
149
|
+
VIMAGE_PF vImage_Error vImageRotate_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
150
|
+
VIMAGE_PF vImage_Error vImageRotate_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
151
|
+
VIMAGE_PF vImage_Error vImageRotate_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, const Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
152
|
+
VIMAGE_PF vImage_Error vImageRotate_CbCr16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, const Pixel_16F16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
153
|
+
VIMAGE_PF vImage_Error vImageRotate_ARGB16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, const Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
154
|
+
|
|
155
|
+
/*
|
|
156
|
+
* vImageScale_<fmt>
|
|
157
|
+
* =================
|
|
158
|
+
* vImageScale_<fmt> is a convenience function to provide facile resizing of images.
|
|
159
|
+
* The operation can also be done with vImageWarp_<fmt>, or by using appropriate
|
|
160
|
+
* low level vImageHorizontal/VerticalShear_<fmt> interfaces. vImageWarp_<fmt>
|
|
161
|
+
* may be appropriate if you wish to use an edging mode other than kvImageEdgeExtend.
|
|
162
|
+
* vImageHorizontal/VerticalShear_<fmt> will provide the greatest detail in control,
|
|
163
|
+
* since it allows for alternative sampling methods, and also the opportunity to
|
|
164
|
+
* control how tiling is done. This might allow for better cache utilization in
|
|
165
|
+
* cases where a format conversion (or other fast filter) is required either before
|
|
166
|
+
* or after the scaling operation and you wish to incorporate it into your tiling design.
|
|
167
|
+
*
|
|
168
|
+
* To avoid artifacts in high frequency regions of the image, the data should be
|
|
169
|
+
* non-premultiplied, or at minimum have the same alpha over the entire image.
|
|
170
|
+
* For integer formats with constant alpha < PIXEL_MAX, it is possible for result
|
|
171
|
+
* color values to be greater than alpha.
|
|
172
|
+
* vImageClipToAlpha_<fmt> can be used to correct that problem.
|
|
173
|
+
* Some other functions like vImageUnpremultiplyData_<fmt> will correct the problem
|
|
174
|
+
* as part of their operation, if they appear later in your image pipeline.
|
|
175
|
+
* Otherwise, integer formats are clamped in the range [PIXEL_MIN,PIXEL_MAX] and can not
|
|
176
|
+
* experience modulo overflow problems. For floating-point formats, it is always
|
|
177
|
+
* possible to produce out-of-gamut or greater than alpha results, most often in
|
|
178
|
+
* high-frequency regions of the image. Out-of-gamut results are often resolved
|
|
179
|
+
* when the floating-point format is converted to an integer format in a later vImage
|
|
180
|
+
* call -- all conversions to integer format are clamped to the representable range.
|
|
181
|
+
* However, color values greater than alpha will persist if the alpha is less than
|
|
182
|
+
* fully opaque, and can be fixed by vImageClipToAlpha_<fmt> as with the integer formats.
|
|
183
|
+
* vImageUnpremultiplyData_<fmt> and vImagePremultiplyData_<fmt> are much, much faster
|
|
184
|
+
* than vImageScale_<fmt> and typically only add a few percent to the overall cost
|
|
185
|
+
* of the filter.
|
|
186
|
+
*
|
|
187
|
+
* vImageScale_<fmt>() does not work in place
|
|
188
|
+
* The ARGB8888, ARGB16U, ARGB16S, ARGB16F and ARGBFFFF functions work equally well on
|
|
189
|
+
* other channel orderings of 4-channel images, such as RGBA or BGRA.
|
|
190
|
+
*
|
|
191
|
+
* Acceptable flags are kvImageEdgeExtend, kvImageDoNotTile,
|
|
192
|
+
* kvImageHighQualityResampling, kvImageNoFlags and, for 16F images,
|
|
193
|
+
* kvImageUseFP16Accumulator (see further details below).
|
|
194
|
+
* If no edging mode is passed, kvImageEdgeExtend is used.
|
|
195
|
+
*
|
|
196
|
+
* For the scaling functions operating on Planar16F, CbCr16F, and ARGB16F images,
|
|
197
|
+
* the flag kvImageUseFP16Accumulator is also allowed. This will enforce all
|
|
198
|
+
* internal filtering operations to use 16-bit half-precision floating-point
|
|
199
|
+
* arithmetic rather than the default 32-bit single-precision arithmetic when
|
|
200
|
+
* the architecture of the CPU supports it. This results in up to 2x performance
|
|
201
|
+
* improvements but at the expense of a less precise result; typically 2-3 bits
|
|
202
|
+
* of precision is lost.
|
|
203
|
+
|
|
204
|
+
*/
|
|
13
205
|
VIMAGE_PF vImage_Error vImageScale_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
206
|
+
VIMAGE_PF vImage_Error vImageScale_Planar16S( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.10), ios(8.0), watchos(1.0), tvos(8.0));
|
|
207
|
+
VIMAGE_PF vImage_Error vImageScale_Planar16U( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.10), ios(8.0), watchos(1.0), tvos(8.0));
|
|
208
|
+
VIMAGE_PF vImage_Error vImageScale_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
209
|
+
VIMAGE_PF vImage_Error vImageScale_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
210
|
+
VIMAGE_PF vImage_Error vImageScale_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
211
|
+
VIMAGE_PF vImage_Error vImageScale_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
212
|
+
VIMAGE_PF vImage_Error vImageScale_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
213
|
+
VIMAGE_PF vImage_Error vImageScale_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
214
|
+
VIMAGE_PF vImage_Error vImageScale_CbCr16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
215
|
+
VIMAGE_PF vImage_Error vImageScale_ARGB16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
216
|
+
|
|
217
|
+
VIMAGE_PF vImage_Error
|
|
218
|
+
vImageScale_CbCr8(
|
|
219
|
+
const vImage_Buffer *src,
|
|
220
|
+
const vImage_Buffer *dest,
|
|
221
|
+
void *tempBuffer,
|
|
222
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
223
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
224
|
+
|
|
225
|
+
VIMAGE_PF vImage_Error
|
|
226
|
+
vImageScale_CbCr16U(
|
|
227
|
+
const vImage_Buffer *src,
|
|
228
|
+
const vImage_Buffer *dest,
|
|
229
|
+
void *tempBuffer,
|
|
230
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
231
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
232
|
+
|
|
233
|
+
VIMAGE_PF vImage_Error
|
|
234
|
+
vImageScale_XRGB2101010W(
|
|
235
|
+
const vImage_Buffer *src,
|
|
236
|
+
const vImage_Buffer *dest,
|
|
237
|
+
void *tempBuffer,
|
|
238
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
239
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
240
|
+
|
|
241
|
+
/*
|
|
242
|
+
* vImageAffineWarp_<fmt>
|
|
243
|
+
* ======================
|
|
244
|
+
* vImageAffineWarp_<fmt> is a convenience function to provide facile affine transformation of images. The operation can also be done by using appropriate low level
|
|
245
|
+
* vImageHorizontal/VerticalShear_<fmt> interfaces. vImageHorizontal/VerticalShear_<fmt> will provide the greatest detail in control, since it allows for alternative
|
|
246
|
+
* sampling methods, and also the opportunity to control how tiling is done, possibly allowing for better cache utilization in cases where a format conversion (or
|
|
247
|
+
* other fast filter) is required either before or after the scaling operation and you wish to incorporate it into your tiling design.
|
|
248
|
+
*
|
|
249
|
+
* To avoid artifacts in high frequency regions of the image, the data should be non-premultiplied, or at minimum have the same alpha over the entire image. For integer
|
|
250
|
+
* formats with constant alpha < 255, it is possible for result color values to be greater than alpha. vImageClipToAlpha_<fmt> can be used to correct that problem.
|
|
251
|
+
* Some other functions like vImageUnpremultiplyData_<fmt> will correct the problem as part of their operation, if they appear later in your image pipeline.
|
|
252
|
+
* Otherwise, integer formats are clamped in the range [PIXEL_MIN, PIXEL_MAX] and can not experience modulo overflow problems. For floating-point formats, it is always possible to
|
|
253
|
+
* produce out-of-gamut or greater than alpha results, most often in high-frequency regions of the image. Out-of-gamut results are often resolved when the floating-point
|
|
254
|
+
* format is converted to an integer format in a later vImage call -- all conversions to integer format are clamped to the representable range. However, color values
|
|
255
|
+
* greater than alpha will persist if the alpha is less than fully opaque, and can be fixed by vImageClipToAlpha_<fmt> as with the integer formats.
|
|
256
|
+
* vImageUnpremultiplyData_<fmt> and vImagePremultiplyData_<fmt> are much, much faster than vImageAffineWarp_<fmt> and typically only add a few percent to the overall cost
|
|
257
|
+
* of the filter.
|
|
258
|
+
*
|
|
259
|
+
* For the Affine Transform function, the coordinate space places the origin at the bottom left corner of the image. Positive movement in the X and Y direction moves you
|
|
260
|
+
* right and up. Both source and destination images are assumed to place their bottom left hand corner at the origin.
|
|
261
|
+
*
|
|
262
|
+
* The elements in the vImage_AffineTransform struct specifies the source to destination coordinate mapping:
|
|
263
|
+
*
|
|
264
|
+
* | a b |
|
|
265
|
+
* (x', y') = (x, y) | | + (tx, ty)
|
|
266
|
+
* | c d |
|
|
267
|
+
*
|
|
268
|
+
* where (x, y) are the source and (x', y') the destination pixel coordinates, respectively.
|
|
269
|
+
* The left multiplication of the vector (x, y) with the 2x2 matrix is consistent with CoreGraphics.
|
|
270
|
+
*
|
|
271
|
+
* vImageAffineWarp_<fmt>() does not work in place
|
|
272
|
+
* The ARGB8888, ARGB16U, ARGB16S and ARGBFFFF functions work equally well on other channel orderings of 4-channel images, such as RGBA or BGRA.
|
|
273
|
+
*
|
|
274
|
+
* Acceptable flags are kvImageEdgeExtend, kvImageBackgroundColorFill, kvImageDoNotTile, kvImageHighQualityResampling, kvImageNoFlags. If no edging mode is passed, the edging
|
|
275
|
+
* mode is undefined. You may not pass both kvImageEdgeExtend and kvImageBackgroundColorFill. kvImageEdgeExtend will leave odd stripes in areas for which no corresponding source
|
|
276
|
+
* image pixel exists, corresponding to the value of the nearest edge pixel, for some value of "nearest". kvImageBackgroundColorFill is most commonly used, except when the result
|
|
277
|
+
* will be cropped to cover only regions present in the original image and no background color leakage into the edges of the result image are desired.
|
|
278
|
+
*
|
|
279
|
+
* Versions of the API that use alternative formulations of the affine transform matrix follow immediately afterward.
|
|
280
|
+
*/
|
|
281
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
282
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
283
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
284
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
285
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
286
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
287
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, const Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
288
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_CbCr16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, const Pixel_16F16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
289
|
+
VIMAGE_PF vImage_Error vImageAffineWarp_ARGB16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, const Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
290
|
+
|
|
291
|
+
#if VIMAGE_AFFINETRANSFORM_DOUBLE_IS_AVAILABLE
|
|
292
|
+
/* A single precision transformation matrix is often not enough. This one uses double precision. */
|
|
293
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
294
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
295
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
296
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
297
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
298
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
299
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, const Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
300
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_CbCr16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, const Pixel_16F16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
301
|
+
VIMAGE_PF vImage_Error vImageAffineWarpD_ARGB16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, const Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
302
|
+
#endif
|
|
303
|
+
|
|
304
|
+
#if VIMAGE_CGAFFINETRANSFORM_IS_AVAILABLE
|
|
305
|
+
/* Convenience Interfaces for working directly with CGAffineTransform, which changes size depending on whether we are LP64 or not. */
|
|
306
|
+
VIMAGE_PF vImage_Error vImageAffineWarpCG_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
307
|
+
VIMAGE_PF vImage_Error vImageAffineWarpCG_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
308
|
+
VIMAGE_PF vImage_Error vImageAffineWarpCG_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
309
|
+
VIMAGE_PF vImage_Error vImageAffineWarpCG_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
310
|
+
VIMAGE_PF vImage_Error vImageAffineWarpCG_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
311
|
+
VIMAGE_PF vImage_Error vImageAffineWarpCG_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
312
|
+
#endif
|
|
313
|
+
|
|
314
|
+
/*
|
|
315
|
+
* vImagePerspectiveWarp_<fmt>
|
|
316
|
+
* ===========================
|
|
317
|
+
* vImagePerspectiveWarp_<fmt> is a convenience function to provide perpsective (projective) transformation of images.
|
|
318
|
+
* The perspective warp cannot be decomposed int lower-level shear functions as for the affine warp.
|
|
319
|
+
*
|
|
320
|
+
* For the Perspective Transform function, the coordinate space places the origin at the bottom left corner of the image.
|
|
321
|
+
* Positive movement in the X and Y direction moves you right and up. Both source and destination images are assumed to
|
|
322
|
+
* place their bottom left hand corner at the origin.
|
|
323
|
+
*
|
|
324
|
+
* The elements in the vImage_PerspectiveTransform struct specify the source to destination coordinate mapping:
|
|
325
|
+
*
|
|
326
|
+
* | a b vx |
|
|
327
|
+
* (x', y', w') = (x, y, w) | c d vy |
|
|
328
|
+
* | tx ty v |
|
|
329
|
+
*
|
|
330
|
+
* where (x, y, w) are the source and (x', y', w') the destination pixel homogeneous coordinates, respectively.
|
|
331
|
+
* The Affine Transform is a special case of the Perspective Transform and can also be expressed in homogeneous coordinates
|
|
332
|
+
* where vx = vy = 0 and v = w = w' = 1.
|
|
333
|
+
*
|
|
334
|
+
* Note: in computer vision the normal (planar projective) homogeneous 3x3 matrix is often defined as the transpose of
|
|
335
|
+
* the 3x3 matrix above and the homogeneous coordinate vector is right multiplied with it:
|
|
336
|
+
*
|
|
337
|
+
* | x' | | a c tx | | x |
|
|
338
|
+
* | y' | = | b d ty | * | y |
|
|
339
|
+
* | w' | | vx vy v | | w |
|
|
340
|
+
*
|
|
341
|
+
* The utility function vImageGetPerspectiveWarp is used to compute the elements of vImage_PerpsectiveTransform given
|
|
342
|
+
* a correspondance map of 4 pairs of source and destination points defining how a source quadrilateral is mapped to a
|
|
343
|
+
* destination quadrilateral.
|
|
344
|
+
*
|
|
345
|
+
* vImagePerspectiveWarp_<fmt>() does not work in place
|
|
346
|
+
* The ARGB8888, ARGB16U, and ARGB16F functions work equally well on other channel orderings of 4-channel images, such as RGBA or BGRA.
|
|
347
|
+
*
|
|
348
|
+
* Acceptable flags are kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageDoNotTile, kvImageNoFlags.
|
|
349
|
+
* One and only one of the edging modes kvImageBackgroundColorFill or kvImageEdgeExtend must be passed where
|
|
350
|
+
* kvImageBackgroundColorFill is most commonly used.
|
|
351
|
+
*
|
|
352
|
+
*/
|
|
353
|
+
VIMAGE_PF vImage_Error vImageGetPerspectiveWarp( const float srcPoints[4][2], const float destPoints[4][2], vImage_PerpsectiveTransform *transform, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,3) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
354
|
+
VIMAGE_PF vImage_Error vImagePerspectiveWarp_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_PerpsectiveTransform *transform, vImage_WarpInterpolation interpolation, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
355
|
+
VIMAGE_PF vImage_Error vImagePerspectiveWarp_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_PerpsectiveTransform *transform, vImage_WarpInterpolation interpolation, Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
356
|
+
VIMAGE_PF vImage_Error vImagePerspectiveWarp_Planar16U( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_PerpsectiveTransform *transform, vImage_WarpInterpolation interpolation, Pixel_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
357
|
+
VIMAGE_PF vImage_Error vImagePerspectiveWarp_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_PerpsectiveTransform *transform, vImage_WarpInterpolation interpolation, Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
358
|
+
VIMAGE_PF vImage_Error vImagePerspectiveWarp_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_PerpsectiveTransform *transform, vImage_WarpInterpolation interpolation, Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
359
|
+
VIMAGE_PF vImage_Error vImagePerspectiveWarp_ARGB16F( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_PerpsectiveTransform *transform, vImage_WarpInterpolation interpolation, Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
/*
|
|
364
|
+
* Low Level Geometry Functions
|
|
365
|
+
* ----------------------------
|
|
366
|
+
*
|
|
367
|
+
* vImage also provides a series of low level geometry functions that do simple, often 1-D transforms on images.
|
|
368
|
+
* They are:
|
|
369
|
+
*
|
|
370
|
+
* Reflect -- reflect an image across a mirror plane at the center of the image in the x or y direction
|
|
371
|
+
* Shear -- shear and rescale an image in the x or y direction
|
|
372
|
+
* Rotate90 -- rotate an image by 0, 90, 180 or 270 degrees
|
|
373
|
+
*
|
|
374
|
+
* The Reflect functions simply reflect images horizontally or vertically. Horizontal reflection inverts the image
|
|
375
|
+
* left to right as if seen from behind. Vertical reflection causes the image to appear upside down.
|
|
376
|
+
*
|
|
377
|
+
* Acceptable flags are kvImageDoNotTile, kvImageNoFlags.
|
|
378
|
+
*
|
|
379
|
+
* These functions do not work in place.
|
|
380
|
+
*
|
|
381
|
+
* All four channel geometry functions (i.e. those that support ARGB8888, ARGB16U, ARGB16S or ARGBFFFF images) work equally well on four channel images
|
|
382
|
+
* with other channel orderings such as RGBA or BGRA.
|
|
383
|
+
*/
|
|
384
|
+
|
|
385
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
386
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_Planar16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(6.0), watchos(1.0), tvos(6.0));
|
|
387
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
388
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
389
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
390
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
391
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
392
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
393
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_CbCr16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
394
|
+
VIMAGE_PF vImage_Error vImageHorizontalReflect_ARGB16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
395
|
+
|
|
396
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
397
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_Planar16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(6.0), watchos(1.0), tvos(6.0));
|
|
398
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
399
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
400
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
401
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
402
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
403
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
404
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_CbCr16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
405
|
+
VIMAGE_PF vImage_Error vImageVerticalReflect_ARGB16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
|
|
406
|
+
|
|
407
|
+
/*
|
|
408
|
+
* The Rotate90 function does simple 0, 90, 180 or 270 degree rotation according to the value of a rotation constant
|
|
409
|
+
* passed to it. The images are rotated about their center. If the source and destination sizes do not match, parts
|
|
410
|
+
* of the image may be cut off. Other parts may have no image, in which case the background color will be drawn there.
|
|
411
|
+
*
|
|
412
|
+
* CAUTION: 90 and 270 degree rotation does not rotate about the true center of the image if the height of the source image
|
|
413
|
+
* is an odd number of pixels and the width of the destination image an even number of pixels, or vice versa. This is also
|
|
414
|
+
* true of the source width and destination height. In this case, you should use the High level rotate function for 90 or
|
|
415
|
+
* 270 rotates so that the resampling can be done to shift the image a half pixel for proper centering. It may be somewhat
|
|
416
|
+
* faster to widen the destination image by 1 and use the low level shearing functions to resample the image at a a half pixel offset.
|
|
417
|
+
* For 0 and 180 degree rotates, if the source and destination buffers are a different size, the two heights must have matching
|
|
418
|
+
* even/oddness and the two widths must have matching even/oddness. Otherwise the image will be rotated and shifted a half pixel
|
|
419
|
+
* away from the center.
|
|
420
|
+
*
|
|
421
|
+
* rotationConstant: 0 -- rotate 0 degrees (simply copy the data from src to dest)
|
|
422
|
+
* 1 -- rotate 90 degrees counterclockwise
|
|
423
|
+
* 2 -- rotate 180 degress
|
|
424
|
+
* 3 -- rotate 270 degrees counterclockwise
|
|
425
|
+
*
|
|
426
|
+
* backColor: The color of the background. This color will be copied to any place where pixels are revealed because
|
|
427
|
+
* the input image does not completely cover the output image.
|
|
428
|
+
*
|
|
429
|
+
* Acceptable flags are kvImageDoNotTile, kvImageNoFlags.
|
|
430
|
+
*
|
|
431
|
+
* These functions do not work in place.
|
|
432
|
+
*
|
|
433
|
+
* All four channel geometry functions (i.e. those that support ARGB8888, ARGB16U, ARGB16S or ARGBFFFF images) work equally well on
|
|
434
|
+
* four channel images with other channel orderings such as RGBA or BGRA.
|
|
435
|
+
*/
|
|
436
|
+
|
|
437
|
+
VIMAGE_PF vImage_Error vImageRotate90_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
438
|
+
VIMAGE_PF vImage_Error vImageRotate90_Planar16U( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, Pixel_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(6.0), watchos(1.0), tvos(6.0));
|
|
439
|
+
VIMAGE_PF vImage_Error vImageRotate90_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
440
|
+
VIMAGE_PF vImage_Error vImageRotate90_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
441
|
+
VIMAGE_PF vImage_Error vImageRotate90_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
442
|
+
VIMAGE_PF vImage_Error vImageRotate90_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
443
|
+
VIMAGE_PF vImage_Error vImageRotate90_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2,4) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
444
|
+
VIMAGE_PF vImage_Error vImageRotate90_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, const Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(11.1), ios(15.0), watchos(8.0), tvos(15.0));
|
|
445
|
+
VIMAGE_PF vImage_Error vImageRotate90_CbCr16F( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, const Pixel_16F16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(11.1), ios(15.0), watchos(8.0), tvos(15.0));
|
|
446
|
+
VIMAGE_PF vImage_Error vImageRotate90_ARGB16F( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, const Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(11.1), ios(15.0), watchos(8.0), tvos(15.0));
|
|
447
|
+
|
|
448
|
+
/*
|
|
449
|
+
* The Shearing functions use resampling to rescale a image and offset it to
|
|
450
|
+
* fractional pixel offsets. The functions actually shear, resize in one
|
|
451
|
+
* dimension and translate. All of it is done with fractional pixel precision.
|
|
452
|
+
* The shear slope is set using the shearSlope parameter. They are intended to
|
|
453
|
+
* be identical to the off diagonal components of the AffineWarp matrix for the
|
|
454
|
+
* same shear (i.e. at 1,0 or 0,1). The xTranslate or yTranslate variable may
|
|
455
|
+
* be used to adjust the position of the destination image in the x and y
|
|
456
|
+
* directions. Scaling (making the image larger or smaller in one dimension)
|
|
457
|
+
* is done by adjusting the resampling kernel.
|
|
458
|
+
*
|
|
459
|
+
* All four channel geometry functions (i.e. those that support ARGB8888,
|
|
460
|
+
* ARGB16U, ARGB16S, ARGB16F, or ARGBFFFF images) work equally well on four
|
|
461
|
+
* channel images with other channel orderings such as RGBA or BGRA.
|
|
462
|
+
*
|
|
463
|
+
* These functions do not work in place.
|
|
464
|
+
*
|
|
465
|
+
* Acceptable flags are kvImageEdgeExtend, kvImageBackgroundColor,
|
|
466
|
+
* kvImageDoNotTile, kvImageNoFlags and, for 16F images,
|
|
467
|
+
* kvImageUseFP16Accumulator (see further details below).
|
|
468
|
+
* Only one of kvImageEdgeExtend or kvImageBackgroundColor may be used.
|
|
469
|
+
* If none is used then the edging mode is undefined and the results may be
|
|
470
|
+
* unpredictable.
|
|
471
|
+
*
|
|
472
|
+
* For the geometry functions operating on Planar16F, CbCr16F, and ARGB16F images,
|
|
473
|
+
* the flag kvImageUseFP16Accumulator is also allowed. This will enforce all
|
|
474
|
+
* internal filtering operations to use 16-bit half-precision floating-point
|
|
475
|
+
* arithmetic rather than the default 32-bit single-precision arithmetic when
|
|
476
|
+
* the architecture of the CPU supports it. This results in up to 2x performance
|
|
477
|
+
* improvements but at the expense of a less precise result; typically 2-3 bits
|
|
478
|
+
* of precision is lost.
|
|
479
|
+
*
|
|
480
|
+
* The ResamplingFilter is created using vImageNewResamplingFilter or
|
|
481
|
+
* vImageNewResamplingFilterForFunctionUsingBuffer. The latter gives more
|
|
482
|
+
* precise control over where the memory is allocated and which filter function
|
|
483
|
+
* is used, at the expense of having to define / setup the same.
|
|
484
|
+
*/
|
|
485
|
+
|
|
486
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
487
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_Planar16S( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, Pixel_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.10), ios(8.0), watchos(1.0), tvos(8.0));
|
|
488
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_Planar16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, Pixel_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.10), ios(8.0), watchos(1.0), tvos(8.0));
|
|
489
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
490
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
491
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
492
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
493
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
494
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, const Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
495
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_CbCr16F(const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, const Pixel_16F16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
496
|
+
VIMAGE_PF vImage_Error vImageHorizontalShear_ARGB16F(const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, const Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
497
|
+
|
|
498
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
499
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_Planar16S( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, Pixel_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.10), ios(8.0), watchos(1.0), tvos(8.0));
|
|
500
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_Planar16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, Pixel_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.10), ios(8.0), watchos(1.0), tvos(8.0));
|
|
501
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
502
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
503
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
504
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
505
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
506
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, const Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
507
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_CbCr16F(const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, const Pixel_16F16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
508
|
+
VIMAGE_PF vImage_Error vImageVerticalShear_ARGB16F(const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, const Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
509
|
+
|
|
510
|
+
/* Versions of shear functions that take coordinates in double precision */
|
|
511
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
512
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
513
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
514
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
515
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
516
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
517
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, const Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
518
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_CbCr16F(const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, const Pixel_16F16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
519
|
+
VIMAGE_PF vImage_Error vImageHorizontalShearD_ARGB16F(const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, const Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
520
|
+
|
|
521
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_Planar8( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, Pixel_8 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
522
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_PlanarF( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, Pixel_F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
523
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_ARGB8888( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, const Pixel_8888 backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
524
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_ARGB16U( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, const Pixel_ARGB_16U backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
525
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_ARGB16S( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, const Pixel_ARGB_16S backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
526
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_ARGBFFFF( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, const Pixel_FFFF backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(10.8), ios(6.0), watchos(1.0), tvos(6.0));
|
|
527
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_Planar16F( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, const Pixel_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
528
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_CbCr16F(const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, const Pixel_16F16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
529
|
+
VIMAGE_PF vImage_Error vImageVerticalShearD_ARGB16F(const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, const Pixel_ARGB_16F backColor, vImage_Flags flags ) VIMAGE_NON_NULL(1,2) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
530
|
+
|
|
531
|
+
VIMAGE_PF vImage_Error
|
|
532
|
+
vImageHorizontalShear_CbCr8(
|
|
533
|
+
const vImage_Buffer *src,
|
|
534
|
+
const vImage_Buffer *dest,
|
|
535
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
536
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
537
|
+
float xTranslate,
|
|
538
|
+
float shearSlope,
|
|
539
|
+
ResamplingFilter filter,
|
|
540
|
+
const Pixel_88 backColor,
|
|
541
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
542
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
543
|
+
|
|
544
|
+
VIMAGE_PF vImage_Error
|
|
545
|
+
vImageHorizontalShear_CbCr16U(
|
|
546
|
+
const vImage_Buffer *src,
|
|
547
|
+
const vImage_Buffer *dest,
|
|
548
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
549
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
550
|
+
float xTranslate,
|
|
551
|
+
float shearSlope,
|
|
552
|
+
ResamplingFilter filter,
|
|
553
|
+
const Pixel_16U16U backColor,
|
|
554
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
555
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
556
|
+
|
|
557
|
+
VIMAGE_PF vImage_Error
|
|
558
|
+
vImageHorizontalShearD_CbCr16U(
|
|
559
|
+
const vImage_Buffer *src,
|
|
560
|
+
const vImage_Buffer *dest,
|
|
561
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
562
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
563
|
+
double xTranslate,
|
|
564
|
+
double shearSlope,
|
|
565
|
+
ResamplingFilter filter,
|
|
566
|
+
const Pixel_16U16U backColor,
|
|
567
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
568
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
569
|
+
|
|
570
|
+
VIMAGE_PF vImage_Error
|
|
571
|
+
vImageHorizontalShear_CbCr16S(
|
|
572
|
+
const vImage_Buffer *src,
|
|
573
|
+
const vImage_Buffer *dest,
|
|
574
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
575
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
576
|
+
float xTranslate,
|
|
577
|
+
float shearSlope,
|
|
578
|
+
ResamplingFilter filter,
|
|
579
|
+
const Pixel_16S16S backColor,
|
|
580
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
581
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
582
|
+
|
|
583
|
+
VIMAGE_PF vImage_Error
|
|
584
|
+
vImageHorizontalShearD_CbCr16S(
|
|
585
|
+
const vImage_Buffer *src,
|
|
586
|
+
const vImage_Buffer *dest,
|
|
587
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
588
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
589
|
+
double xTranslate,
|
|
590
|
+
double shearSlope,
|
|
591
|
+
ResamplingFilter filter,
|
|
592
|
+
const Pixel_16S16S backColor,
|
|
593
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
594
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
VIMAGE_PF vImage_Error
|
|
598
|
+
vImageVerticalShear_CbCr8(
|
|
599
|
+
const vImage_Buffer *src,
|
|
600
|
+
const vImage_Buffer *dest,
|
|
601
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
602
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
603
|
+
float yTranslate,
|
|
604
|
+
float shearSlope,
|
|
605
|
+
ResamplingFilter filter,
|
|
606
|
+
const Pixel_88 backColor,
|
|
607
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
608
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
609
|
+
|
|
610
|
+
VIMAGE_PF vImage_Error
|
|
611
|
+
vImageVerticalShear_CbCr16U(
|
|
612
|
+
const vImage_Buffer *src,
|
|
613
|
+
const vImage_Buffer *dest,
|
|
614
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
615
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
616
|
+
float yTranslate,
|
|
617
|
+
float shearSlope,
|
|
618
|
+
ResamplingFilter filter,
|
|
619
|
+
const Pixel_16U16U backColor,
|
|
620
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
621
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
622
|
+
|
|
623
|
+
VIMAGE_PF vImage_Error
|
|
624
|
+
vImageVerticalShearD_CbCr16U(
|
|
625
|
+
const vImage_Buffer *src,
|
|
626
|
+
const vImage_Buffer *dest,
|
|
627
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
628
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
629
|
+
double yTranslate,
|
|
630
|
+
double shearSlope,
|
|
631
|
+
ResamplingFilter filter,
|
|
632
|
+
const Pixel_16U16U backColor,
|
|
633
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
634
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
635
|
+
|
|
636
|
+
VIMAGE_PF vImage_Error
|
|
637
|
+
vImageVerticalShear_CbCr16S(
|
|
638
|
+
const vImage_Buffer *src,
|
|
639
|
+
const vImage_Buffer *dest,
|
|
640
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
641
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
642
|
+
float yTranslate,
|
|
643
|
+
float shearSlope,
|
|
644
|
+
ResamplingFilter filter,
|
|
645
|
+
const Pixel_16S16S backColor,
|
|
646
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
647
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
648
|
+
|
|
649
|
+
VIMAGE_PF vImage_Error
|
|
650
|
+
vImageVerticalShearD_CbCr16S(
|
|
651
|
+
const vImage_Buffer *src,
|
|
652
|
+
const vImage_Buffer *dest,
|
|
653
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
654
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
655
|
+
double yTranslate,
|
|
656
|
+
double shearSlope,
|
|
657
|
+
ResamplingFilter filter,
|
|
658
|
+
const Pixel_16S16S backColor,
|
|
659
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
660
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
|
|
661
|
+
|
|
662
|
+
VIMAGE_PF vImage_Error
|
|
663
|
+
vImageHorizontalShear_XRGB2101010W(
|
|
664
|
+
const vImage_Buffer *src,
|
|
665
|
+
const vImage_Buffer *dest,
|
|
666
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
667
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
668
|
+
float xTranslate,
|
|
669
|
+
float shearSlope,
|
|
670
|
+
ResamplingFilter filter,
|
|
671
|
+
const Pixel_32U backColor,
|
|
672
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
673
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
674
|
+
|
|
675
|
+
VIMAGE_PF vImage_Error
|
|
676
|
+
vImageVerticalShear_XRGB2101010W(
|
|
677
|
+
const vImage_Buffer *src,
|
|
678
|
+
const vImage_Buffer *dest,
|
|
679
|
+
vImagePixelCount srcOffsetToROI_X,
|
|
680
|
+
vImagePixelCount srcOffsetToROI_Y,
|
|
681
|
+
float yTranslate,
|
|
682
|
+
float shearSlope,
|
|
683
|
+
ResamplingFilter filter,
|
|
684
|
+
const Pixel_32U backColor,
|
|
685
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1,2)
|
|
686
|
+
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
/*
|
|
690
|
+
* The shearing functions use a resampling filter for their work. Before you call these functions you must
|
|
691
|
+
* create a new filter. The filter must be remade for different scaling factors, but may be reused in different
|
|
692
|
+
* function calls if the scaling factor is the same.
|
|
693
|
+
*
|
|
694
|
+
* For general purpose work, use NewResamplingFilter() to create a resampling filter. It currently uses
|
|
695
|
+
* either Lanczos3 or Lanczos5 filter, depending on whether the kvImageHighQualityResampling bit is set in the flags field.
|
|
696
|
+
* What filter is used is subject to change.
|
|
697
|
+
*
|
|
698
|
+
* ResamplingFilter kernel = NewResamplingFilter( theScale, kvImageHighQualityResampling );
|
|
699
|
+
*
|
|
700
|
+
* Use DestroyResamplingFilter() when you are done with the filter to return the memory it uses to the heap.
|
|
701
|
+
*
|
|
702
|
+
* The scale parameter sets the level of rescaling to be done. A value of 1.0f leaves the image at its
|
|
703
|
+
* original size. 2.0f will magnify in one direction to make the image twice as wide / tall. 0.5f will
|
|
704
|
+
* make it half as wide / tall. Any float is allowed, including negative values, which will have the effect
|
|
705
|
+
* of flipping the image along that axis. Scaling will happen relative to the left or bottom edge of the image.
|
|
706
|
+
*
|
|
707
|
+
* Set the kvImageEdgeExtend bit in the flags field if you would like the image buffer edges extended infinitely
|
|
708
|
+
* rather than use the backColor value. This is useful when you do not wish a background color to bleed into
|
|
709
|
+
* the edges of your image. This is generally only useful when the shear angle is 0.
|
|
710
|
+
*
|
|
711
|
+
*/
|
|
712
|
+
|
|
713
|
+
VIMAGE_PF ResamplingFilter vImageNewResamplingFilter( float scale, vImage_Flags flags ) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
714
|
+
VIMAGE_PF void vImageDestroyResamplingFilter( ResamplingFilter filter ) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
715
|
+
|
|
716
|
+
/*
|
|
717
|
+
* vImageNewResamplingFilter and vImageDestroyResamplingFilter are merely convenience functions to make
|
|
718
|
+
* the common case of the default resampling filter into a heap allocated buffer easier for you.
|
|
719
|
+
*
|
|
720
|
+
* If you would like to use your own special purpose resampling filter or need to restrict your use of malloc,
|
|
721
|
+
* you may instead call NewResamplingFilterForFunctionUsingBuffer(), which creates a filter for a specific
|
|
722
|
+
* resampling filter function that you provide in the form of a simple y = f(x) function, and writes it into a buffer
|
|
723
|
+
* that you provide. This function writes the kernel values into a preallocated kernel buffer that you provide. The
|
|
724
|
+
* kernel buffer should be at least the size of the kernel data, which is given by vImageGetResamplingKernelSize.
|
|
725
|
+
*
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
VIMAGE_PF vImage_Error vImageNewResamplingFilterForFunctionUsingBuffer( ResamplingFilter filter,
|
|
729
|
+
float scale,
|
|
730
|
+
void (*kernelFunc)( const float *xArray, float *yArray, unsigned long count, void *userData ),
|
|
731
|
+
float kernelWidth,
|
|
732
|
+
void *userData,
|
|
733
|
+
vImage_Flags flags ) VIMAGE_NON_NULL(1) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
734
|
+
|
|
735
|
+
VIMAGE_PF size_t vImageGetResamplingFilterSize( float scale,
|
|
736
|
+
void (*kernelFunc)( const float *xArray, float *yArray, unsigned long count, void *userData ),
|
|
737
|
+
float kernelWidth,
|
|
738
|
+
vImage_Flags flags ) API_AVAILABLE(macos(10.3), ios(5.0), watchos(1.0), tvos(5.0));
|
|
739
|
+
|
|
740
|
+
/*
|
|
741
|
+
* The scale parameter is the amount to enlarge or reduce the output image. It is the same meaning
|
|
742
|
+
* as for the generic resampling kernel.
|
|
743
|
+
*
|
|
744
|
+
* The kernelFunc defines the shape of the resampling kernel. Here is a sample kernelFunc that does
|
|
745
|
+
* linear interpolation:
|
|
746
|
+
*
|
|
747
|
+
* void MyLinearInterpolationFilterFunc( const float *xArray, float *yArray, int count, void *userData )
|
|
748
|
+
* {
|
|
749
|
+
* int i;
|
|
750
|
+
* float sum = 0.0f;
|
|
751
|
+
*
|
|
752
|
+
* //Calculate kernel values
|
|
753
|
+
* for( i = 0; i < count; i++ )
|
|
754
|
+
* {
|
|
755
|
+
* float unscaledResult = max(xArray) - fabs( xArray[i] ); //LERP
|
|
756
|
+
* yArray[i] = unscaledResult;
|
|
757
|
+
* sum += unscaledResult;
|
|
758
|
+
* }
|
|
759
|
+
*
|
|
760
|
+
* //Make sure the kernel values sum to 1.0. You can use some other value here.
|
|
761
|
+
* //Values other than 1.0 will cause the image to lighten or darken.
|
|
762
|
+
* sum = 1.0f / sum;
|
|
763
|
+
* for( i = 0; i < count; i++ )
|
|
764
|
+
* yArray[i] *= sum;
|
|
765
|
+
*
|
|
766
|
+
* }
|
|
767
|
+
*
|
|
768
|
+
* This specifies the tent line shape centered around 0.0f that defines a linear interpolation kernel.
|
|
769
|
+
* The array of values you will be asked to provide are the entire resampling window for a single pixel.
|
|
770
|
+
* The x values are pixel positions relative to the result, and the y values are where you should put
|
|
771
|
+
* the kernel values for those positions. The x values will range from -kernelWidth to kernelWidth.
|
|
772
|
+
*
|
|
773
|
+
* The array format is used for efficiency, and also to give you the opportunity to make sure the kernel
|
|
774
|
+
* adds up to 1.0 or some other desired value. Making sure that the kernel values add up to 1.0 will
|
|
775
|
+
* prevent interference patterns from emerging in the image. Since the sampling kernel function itself is
|
|
776
|
+
* sampled during the process of pairing kernel values against sampled pixel data, the sampled kernel data
|
|
777
|
+
* does not always integrate to the same value that the parent function does, so usually we must normalize
|
|
778
|
+
* it to prevent interference/moiree patterns from to emerging in the image as the pixels in the input buffer
|
|
779
|
+
* drift in and out of phase with those in the output buffer. Sums less than 1.0f will cause the image to
|
|
780
|
+
* darken. Gain values greater than 1.0 may cause significant clipping for integer pixel data. Kernel values
|
|
781
|
+
* are clipped at approximately +- 2.0 for all integer data. If your filter function values exceed +- 2.0, then
|
|
782
|
+
* you will need to use the floating point data format to avoid overflow.
|
|
783
|
+
*
|
|
784
|
+
* If you pass NULL for the kernelFunc, vImage will use its default resampling kernel. You can control
|
|
785
|
+
* whether the high quality resampling kernel is used or not by setting the kvImageHighQualityResampling
|
|
786
|
+
* bit in the flags field. This allows you to use the default resampling kernel in your own buffer. If you do
|
|
787
|
+
* not pass NULL for the kernelFunc, the kernelFunc and your userData parameter must be valid for the lifetime
|
|
788
|
+
* of the ResamplingKernel.
|
|
789
|
+
*
|
|
790
|
+
* The kernelWidth parameter controls the limiting values of x, when creating the new kernel. A kernelWidth
|
|
791
|
+
* of 1.0 would allow input samples between -1.0 and 1.0 pixels away from the destination pixel to influence
|
|
792
|
+
* the result. For Lanczos3, we would use a kernelWidth of 3.0f, because the Lanczos3 function is defined
|
|
793
|
+
* over the range -3.0f to 3.0f. If your function is only defined over part of the range -x...x, then have
|
|
794
|
+
* your function return zero for the rest of the function. The computational cost of the shearing functions
|
|
795
|
+
* is proportional to the kernelWidth.
|
|
796
|
+
*
|
|
797
|
+
* The userData field is passed back unchanged to your kernelFunc when it is called.
|
|
798
|
+
*
|
|
799
|
+
* The only flag honored by this function in this release is kvImageHighQualityResampling, which is only
|
|
800
|
+
* used if NULL is passed for the kernelFunc to decide whether to use the normal or high quality default
|
|
801
|
+
* resampling filter. Except in this case, you should in general pass kvImageNoFlags in the flags field
|
|
802
|
+
* to avoid conflicting with future implementations where flags may be used.
|
|
803
|
+
*
|
|
804
|
+
* Do not use DestroyResamplingKernel() to free the memory used by kernels created with NewResamplingKernelForFunction().
|
|
805
|
+
* Since you are responsible for allocating that buffer, you are also responsible for destroying it, using the matching
|
|
806
|
+
* free function.
|
|
807
|
+
*
|
|
808
|
+
* Do not call vImageNewResamplingKernelForFunctionUsingBuffer() on a buffer created with vImageNewResamplingKernel().
|
|
809
|
+
* The buffer sizes may be different. You must use vImageGetResamplingKernelSize() to find out the new buffer size,
|
|
810
|
+
* allocate a buffer yourself using something like malloc(), then call vImageNewResamplingKernelForFunctionUsingBuffer().
|
|
811
|
+
*/
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
/*
|
|
815
|
+
* vImageGetSamplingFilterExtent
|
|
816
|
+
*
|
|
817
|
+
* returns the maximum sampling radius for the resampling filter. This is the maximum distance from any pixel
|
|
818
|
+
* that the filter will look either horizontally or vertically, depending on whether vImageHorizontalShear or
|
|
819
|
+
* vImageVerticalShear is used. It is analogous to kernelWidth in vImageNewResamplingFilterForFunctionUsingBuffer,
|
|
820
|
+
* but might be slightly larger to allow for extra slop when dealing with sub-pixel coordinates during resampling.
|
|
821
|
+
*
|
|
822
|
+
* filter a valid ResamplingFilter
|
|
823
|
+
* flags the flags you intend to pass to vImage{Horizontal/Vertical}Shear_<fmt>.
|
|
824
|
+
*/
|
|
825
|
+
VIMAGE_PF vImagePixelCount vImageGetResamplingFilterExtent( ResamplingFilter filter, vImage_Flags flags ) VIMAGE_NON_NULL(1) API_AVAILABLE(macos(10.9), ios(7.0), watchos(1.0), tvos(7.0));
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
#endif
|
|
829
|
+
|
|
14
830
|
#ifdef __cplusplus
|
|
15
831
|
}
|
|
16
832
|
#endif
|
|
833
|
+
|
|
17
834
|
#endif
|
|
835
|
+
|
|
836
|
+
|