├── .circleci
└── config.yml
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .husky
├── .npmignore
├── commit-msg
└── pre-commit
├── .yarnrc
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── babel.config.js
├── example
├── android
│ ├── app
│ │ ├── build.gradle
│ │ ├── debug.keystore
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── debug
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── reactnativeperspectivecorrectionimageview
│ │ │ │ └── ReactNativeFlipper.java
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── reactnativeperspectivecorrectionimageview
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── app.json
├── babel.config.js
├── index.tsx
├── ios
│ ├── File.swift
│ ├── PerspectiveCorrectionImageViewExample-Bridging-Header.h
│ ├── PerspectiveCorrectionImageViewExample.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── PerspectiveCorrectionImageViewExample.xcscheme
│ ├── PerspectiveCorrectionImageViewExample.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── PerspectiveCorrectionImageViewExample
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── main.m
│ └── Podfile
├── metro.config.js
├── package.json
└── src
│ ├── App.tsx
│ └── sample.png
├── package.json
├── scripts
└── bootstrap.js
├── src
├── __tests__
│ └── index.test.tsx
├── getTransformMatrix.ts
└── index.tsx
├── tsconfig.build.json
└── tsconfig.json
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2.1
2 |
3 | executors:
4 | default:
5 | docker:
6 | - image: circleci/node:10
7 | working_directory: ~/project
8 |
9 | commands:
10 | attach_project:
11 | steps:
12 | - attach_workspace:
13 | at: ~/project
14 |
15 | jobs:
16 | install-dependencies:
17 | executor: default
18 | steps:
19 | - checkout
20 | - attach_project
21 | - restore_cache:
22 | keys:
23 | - dependencies-{{ checksum "package.json" }}
24 | - dependencies-
25 | - restore_cache:
26 | keys:
27 | - dependencies-example-{{ checksum "example/package.json" }}
28 | - dependencies-example-
29 | - run:
30 | name: Install dependencies
31 | command: |
32 | yarn install --cwd example --frozen-lockfile
33 | yarn install --frozen-lockfile
34 | - save_cache:
35 | key: dependencies-{{ checksum "package.json" }}
36 | paths: node_modules
37 | - save_cache:
38 | key: dependencies-example-{{ checksum "example/package.json" }}
39 | paths: example/node_modules
40 | - persist_to_workspace:
41 | root: .
42 | paths: .
43 |
44 | lint:
45 | executor: default
46 | steps:
47 | - attach_project
48 | - run:
49 | name: Lint files
50 | command: |
51 | yarn lint
52 |
53 | typescript:
54 | executor: default
55 | steps:
56 | - attach_project
57 | - run:
58 | name: Typecheck files
59 | command: |
60 | yarn typescript
61 |
62 | unit-tests:
63 | executor: default
64 | steps:
65 | - attach_project
66 | - run:
67 | name: Run unit tests
68 | command: |
69 | yarn test --coverage
70 | - store_artifacts:
71 | path: coverage
72 | destination: coverage
73 |
74 | build-package:
75 | executor: default
76 | steps:
77 | - attach_project
78 | - run:
79 | name: Build package
80 | command: |
81 | yarn prepare
82 |
83 | workflows:
84 | build-and-test:
85 | jobs:
86 | - install-dependencies
87 | - lint:
88 | requires:
89 | - install-dependencies
90 | - typescript:
91 | requires:
92 | - install-dependencies
93 | - unit-tests:
94 | requires:
95 | - install-dependencies
96 | - build-package:
97 | requires:
98 | - install-dependencies
99 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 |
9 | indent_style = space
10 | indent_size = 2
11 |
12 | end_of_line = lf
13 | charset = utf-8
14 | trim_trailing_whitespace = true
15 | insert_final_newline = true
16 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 | # specific for windows script files
3 | *.bat text eol=crlf
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # XDE
6 | .expo/
7 |
8 | # VSCode
9 | .vscode/
10 | jsconfig.json
11 |
12 | # Xcode
13 | #
14 | build/
15 | *.pbxuser
16 | !default.pbxuser
17 | *.mode1v3
18 | !default.mode1v3
19 | *.mode2v3
20 | !default.mode2v3
21 | *.perspectivev3
22 | !default.perspectivev3
23 | xcuserdata
24 | *.xccheckout
25 | *.moved-aside
26 | DerivedData
27 | *.hmap
28 | *.ipa
29 | *.xcuserstate
30 | project.xcworkspace
31 |
32 | # Android/IJ
33 | #
34 | .classpath
35 | .cxx
36 | .gradle
37 | .idea
38 | .project
39 | .settings
40 | local.properties
41 | android.iml
42 |
43 | # Cocoapods
44 | #
45 | example/ios/Pods
46 |
47 | # node.js
48 | #
49 | node_modules/
50 | npm-debug.log
51 | yarn-debug.log
52 | yarn-error.log
53 |
54 | # BUCK
55 | buck-out/
56 | \.buckd/
57 | android/app/libs
58 | android/keystores/debug.keystore
59 |
60 | # Expo
61 | .expo/*
62 |
63 | # generated by bob
64 | lib/
65 |
--------------------------------------------------------------------------------
/.husky/.npmignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | yarn commitlint -E HUSKY_GIT_PARAMS
5 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | yarn lint && yarn typescript
5 |
--------------------------------------------------------------------------------
/.yarnrc:
--------------------------------------------------------------------------------
1 | # Override Yarn command so we can automatically setup the repo on running `yarn`
2 |
3 | yarn-path "scripts/bootstrap.js"
4 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
4 |
5 | ## Development workflow
6 |
7 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
8 |
9 | ```sh
10 | yarn
11 | ```
12 |
13 | > While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
14 |
15 | While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
16 |
17 | To start the packager:
18 |
19 | ```sh
20 | yarn example start
21 | ```
22 |
23 | To run the example app on Android:
24 |
25 | ```sh
26 | yarn example android
27 | ```
28 |
29 | To run the example app on iOS:
30 |
31 | ```sh
32 | yarn example ios
33 | ```
34 |
35 | To run the example app on Web:
36 |
37 | ```sh
38 | yarn example web
39 | ```
40 |
41 | Make sure your code passes TypeScript and ESLint. Run the following to verify:
42 |
43 | ```sh
44 | yarn typescript
45 | yarn lint
46 | ```
47 |
48 | To fix formatting errors, run the following:
49 |
50 | ```sh
51 | yarn lint --fix
52 | ```
53 |
54 | Remember to add tests for your change if possible. Run the unit tests by:
55 |
56 | ```sh
57 | yarn test
58 | ```
59 |
60 | ### Commit message convention
61 |
62 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
63 |
64 | - `fix`: bug fixes, e.g. fix crash due to deprecated method.
65 | - `feat`: new features, e.g. add new method to the module.
66 | - `refactor`: code refactor, e.g. migrate from class components to hooks.
67 | - `docs`: changes into documentation, e.g. add usage example for the module..
68 | - `test`: adding or updating tests, e.g. add integration tests using detox.
69 | - `chore`: tooling changes, e.g. change CI config.
70 |
71 | Our pre-commit hooks verify that your commit message matches this format when committing.
72 |
73 | ### Linting and tests
74 |
75 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
76 |
77 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
78 |
79 | Our pre-commit hooks verify that the linter and tests pass when committing.
80 |
81 | ### Publishing to npm
82 |
83 | We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
84 |
85 | To publish new versions, run the following:
86 |
87 | ```sh
88 | yarn release
89 | ```
90 |
91 | ### Scripts
92 |
93 | The `package.json` file contains various scripts for common tasks:
94 |
95 | - `yarn bootstrap`: setup project by installing all dependencies and pods.
96 | - `yarn typescript`: type-check files with TypeScript.
97 | - `yarn lint`: lint files with ESLint.
98 | - `yarn test`: run unit tests with Jest.
99 | - `yarn example start`: start the Metro server for the example app.
100 | - `yarn example android`: run the example app on Android.
101 | - `yarn example ios`: run the example app on iOS.
102 |
103 | ### Sending a pull request
104 |
105 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
106 |
107 | When you're sending a pull request:
108 |
109 | - Prefer small pull requests focused on one change.
110 | - Verify that linters and tests are passing.
111 | - Review the documentation to make sure it looks good.
112 | - Follow the pull request template when opening a pull request.
113 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
114 |
115 | ## Code of Conduct
116 |
117 | ### Our Pledge
118 |
119 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
120 |
121 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
122 |
123 | ### Our Standards
124 |
125 | Examples of behavior that contributes to a positive environment for our community include:
126 |
127 | - Demonstrating empathy and kindness toward other people
128 | - Being respectful of differing opinions, viewpoints, and experiences
129 | - Giving and gracefully accepting constructive feedback
130 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
131 | - Focusing on what is best not just for us as individuals, but for the overall community
132 |
133 | Examples of unacceptable behavior include:
134 |
135 | - The use of sexualized language or imagery, and sexual attention or
136 | advances of any kind
137 | - Trolling, insulting or derogatory comments, and personal or political attacks
138 | - Public or private harassment
139 | - Publishing others' private information, such as a physical or email
140 | address, without their explicit permission
141 | - Other conduct which could reasonably be considered inappropriate in a
142 | professional setting
143 |
144 | ### Enforcement Responsibilities
145 |
146 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
147 |
148 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
149 |
150 | ### Scope
151 |
152 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
153 |
154 | ### Enforcement
155 |
156 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
157 |
158 | All community leaders are obligated to respect the privacy and security of the reporter of any incident.
159 |
160 | ### Enforcement Guidelines
161 |
162 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
163 |
164 | #### 1. Correction
165 |
166 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
167 |
168 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
169 |
170 | #### 2. Warning
171 |
172 | **Community Impact**: A violation through a single incident or series of actions.
173 |
174 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
175 |
176 | #### 3. Temporary Ban
177 |
178 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
179 |
180 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
181 |
182 | #### 4. Permanent Ban
183 |
184 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
185 |
186 | **Consequence**: A permanent ban from any sort of public interaction within the community.
187 |
188 | ### Attribution
189 |
190 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
191 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
192 |
193 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
194 |
195 | [homepage]: https://www.contributor-covenant.org
196 |
197 | For answers to common questions about this code of conduct, see the FAQ at
198 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
199 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Leon Kim
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-perspective-correction-image-view
2 |
3 | An image view component that corrects the distorted image with its corner points.
4 |
5 |
6 |
7 | ## Installation
8 |
9 | ```sh
10 | yarn add react-native-perspective-correction-image-view
11 | ```
12 | or
13 | ```sh
14 | npm install react-native-perspective-correction-image-view
15 | ```
16 |
17 | ## Usage
18 |
19 | Please take a look at the example app.
20 |
21 | ```typescript
22 |
32 | ```
33 |
34 | ## Parameters
35 | The source corners are X,Y points from top left going clockwise.
36 | 
37 |
38 | ## Contributing
39 |
40 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
41 |
42 | ## License
43 |
44 | MIT
45 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // https://reactnative.dev/docs/performance#enable-the-ram-format
22 | * bundleCommand: "ram-bundle",
23 | *
24 | * // whether to bundle JS and assets in debug mode
25 | * bundleInDebug: false,
26 | *
27 | * // whether to bundle JS and assets in release mode
28 | * bundleInRelease: true,
29 | *
30 | * // whether to bundle JS and assets in another build variant (if configured).
31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
32 | * // The configuration property can be in the following formats
33 | * // 'bundleIn${productFlavor}${buildType}'
34 | * // 'bundleIn${buildType}'
35 | * // bundleInFreeDebug: true,
36 | * // bundleInPaidRelease: true,
37 | * // bundleInBeta: true,
38 | *
39 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
40 | * // for PerspectiveCorrectionImageViewExample: to disable dev mode in the staging build type (if configured)
41 | * devDisabledInStaging: true,
42 | * // The configuration property can be in the following formats
43 | * // 'devDisabledIn${productFlavor}${buildType}'
44 | * // 'devDisabledIn${buildType}'
45 | *
46 | * // the root of your project, i.e. where "package.json" lives
47 | * root: "../../",
48 | *
49 | * // where to put the JS bundle asset in debug mode
50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
51 | *
52 | * // where to put the JS bundle asset in release mode
53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
54 | *
55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
56 | * // require('./image.png')), in debug mode
57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
58 | *
59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
60 | * // require('./image.png')), in release mode
61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
62 | *
63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
67 | * // for PerspectiveCorrectionImageViewExample, you might want to remove it from here.
68 | * inputExcludes: ["android/**", "ios/**"],
69 | *
70 | * // override which node gets called and with what additional arguments
71 | * nodeExecutableAndArgs: ["node"],
72 | *
73 | * // supply additional arguments to the packager
74 | * extraPackagerArgs: []
75 | * ]
76 | */
77 |
78 | project.ext.react = [
79 | enableHermes: false, // clean and rebuild if changing
80 | entryFile: "index.tsx",
81 | ]
82 |
83 | apply from: "../../node_modules/react-native/react.gradle"
84 |
85 | /**
86 | * Set this to true to create two separate APKs instead of one:
87 | * - An APK that only works on ARM devices
88 | * - An APK that only works on x86 devices
89 | * The advantage is the size of the APK is reduced by about 4MB.
90 | * Upload all the APKs to the Play Store and people will download
91 | * the correct one based on the CPU architecture of their device.
92 | */
93 | def enableSeparateBuildPerCPUArchitecture = false
94 |
95 | /**
96 | * Run Proguard to shrink the Java bytecode in release builds.
97 | */
98 | def enableProguardInReleaseBuilds = false
99 |
100 | /**
101 | * The preferred build flavor of JavaScriptCore.
102 | *
103 | * For PerspectiveCorrectionImageViewExample, to use the international variant, you can use:
104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
105 | *
106 | * The international variant includes ICU i18n library and necessary data
107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
108 | * give correct results when using with locales other than en-US. Note that
109 | * this variant is about 6MiB larger per architecture than default.
110 | */
111 | def jscFlavor = 'org.webkit:android-jsc:+'
112 |
113 | /**
114 | * Whether to enable the Hermes VM.
115 | *
116 | * This should be set on project.ext.react and mirrored here. If it is not set
117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
118 | * and the benefits of using Hermes will therefore be sharply reduced.
119 | */
120 | def enableHermes = project.ext.react.get("enableHermes", false);
121 |
122 | android {
123 | compileSdkVersion rootProject.ext.compileSdkVersion
124 |
125 | compileOptions {
126 | sourceCompatibility JavaVersion.VERSION_1_8
127 | targetCompatibility JavaVersion.VERSION_1_8
128 | }
129 |
130 | defaultConfig {
131 | applicationId "com.example.reactnativeperspectivecorrectionimageview"
132 | minSdkVersion rootProject.ext.minSdkVersion
133 | targetSdkVersion rootProject.ext.targetSdkVersion
134 | versionCode 1
135 | versionName "1.0"
136 | }
137 | splits {
138 | abi {
139 | reset()
140 | enable enableSeparateBuildPerCPUArchitecture
141 | universalApk false // If true, also generate a universal APK
142 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
143 | }
144 | }
145 | signingConfigs {
146 | debug {
147 | storeFile file('debug.keystore')
148 | storePassword 'android'
149 | keyAlias 'androiddebugkey'
150 | keyPassword 'android'
151 | }
152 | }
153 | buildTypes {
154 | debug {
155 | signingConfig signingConfigs.debug
156 | }
157 | release {
158 | // Caution! In production, you need to generate your own keystore file.
159 | // see https://reactnative.dev/docs/signed-apk-android.
160 | signingConfig signingConfigs.debug
161 | minifyEnabled enableProguardInReleaseBuilds
162 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
163 | }
164 | }
165 | // applicationVariants are e.g. debug, release
166 | applicationVariants.all { variant ->
167 | variant.outputs.each { output ->
168 | // For each separate APK per architecture, set a unique version code as described here:
169 | // https://developer.android.com/studio/build/configure-apk-splits.html
170 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
171 | def abi = output.getFilter(OutputFile.ABI)
172 | if (abi != null) { // null for the universal-debug, universal-release variants
173 | output.versionCodeOverride =
174 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
175 | }
176 |
177 | }
178 | }
179 | }
180 |
181 | dependencies {
182 | implementation fileTree(dir: "libs", include: ["*.jar"])
183 | //noinspection GradleDynamicVersion
184 | implementation "com.facebook.react:react-native:+" // From node_modules
185 |
186 |
187 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
188 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
189 | exclude group:'com.facebook.fbjni'
190 | }
191 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
192 | exclude group:'com.facebook.flipper'
193 | exclude group:'com.squareup.okhttp3', module:'okhttp'
194 | }
195 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
196 | exclude group:'com.facebook.flipper'
197 | }
198 |
199 | if (enableHermes) {
200 | def hermesPath = "../../node_modules/hermes-engine/android/";
201 | debugImplementation files(hermesPath + "hermes-debug.aar")
202 | releaseImplementation files(hermesPath + "hermes-release.aar")
203 | } else {
204 | implementation jscFlavor
205 | }
206 |
207 | }
208 |
209 | // Run this once to be able to run the application with BUCK
210 | // puts all compile dependencies into folder libs for BUCK to use
211 | task copyDownloadableDepsToLibs(type: Copy) {
212 | from configurations.compile
213 | into 'libs'
214 | }
215 |
216 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
217 |
--------------------------------------------------------------------------------
/example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/debug.keystore
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/java/com/example/reactnativeperspectivecorrectionimageview/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | *
This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.example.reactnativeperspectivecorrectionimageview;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | public class ReactNativeFlipper {
28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29 | if (FlipperUtils.shouldEnableFlipper(context)) {
30 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
31 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
32 | client.addPlugin(new ReactFlipperPlugin());
33 | client.addPlugin(new DatabasesFlipperPlugin(context));
34 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
35 | client.addPlugin(CrashReporterPlugin.getInstance());
36 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
37 | NetworkingModule.setCustomClientBuilder(
38 | new NetworkingModule.CustomClientBuilder() {
39 | @Override
40 | public void apply(OkHttpClient.Builder builder) {
41 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
42 | }
43 | });
44 | client.addPlugin(networkFlipperPlugin);
45 | client.start();
46 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
47 | // Hence we run if after all native modules have been initialized
48 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
49 | if (reactContext == null) {
50 | reactInstanceManager.addReactInstanceEventListener(
51 | new ReactInstanceManager.ReactInstanceEventListener() {
52 | @Override
53 | public void onReactContextInitialized(ReactContext reactContext) {
54 | reactInstanceManager.removeReactInstanceEventListener(this);
55 | reactContext.runOnNativeModulesQueueThread(
56 | new Runnable() {
57 | @Override
58 | public void run() {
59 | client.addPlugin(new FrescoFlipperPlugin());
60 | }
61 | });
62 | }
63 | });
64 | } else {
65 | client.addPlugin(new FrescoFlipperPlugin());
66 | }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
13 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativeperspectivecorrectionimageview/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativeperspectivecorrectionimageview;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript. This is used to schedule
9 | * rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "PerspectiveCorrectionImageViewExample";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativeperspectivecorrectionimageview/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativeperspectivecorrectionimageview;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.react.ReactInstanceManager;
10 | import com.facebook.soloader.SoLoader;
11 | import java.lang.reflect.InvocationTargetException;
12 | import java.util.List;
13 |
14 | public class MainApplication extends Application implements ReactApplication {
15 |
16 | private final ReactNativeHost mReactNativeHost =
17 | new ReactNativeHost(this) {
18 | @Override
19 | public boolean getUseDeveloperSupport() {
20 | return BuildConfig.DEBUG;
21 | }
22 |
23 | @Override
24 | protected List getPackages() {
25 | @SuppressWarnings("UnnecessaryLocalVariable")
26 | List packages = new PackageList(this).getPackages();
27 | // Packages that cannot be autolinked yet can be added manually here, for PerspectiveCorrectionImageViewExample:
28 | // packages.add(new MyReactNativePackage());
29 |
30 | return packages;
31 | }
32 |
33 | @Override
34 | protected String getJSMainModuleName() {
35 | return "index";
36 | }
37 | };
38 |
39 | @Override
40 | public ReactNativeHost getReactNativeHost() {
41 | return mReactNativeHost;
42 | }
43 |
44 | @Override
45 | public void onCreate() {
46 | super.onCreate();
47 | SoLoader.init(this, /* native exopackage */ false);
48 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled
49 | }
50 |
51 | /**
52 | * Loads Flipper in React Native templates.
53 | *
54 | * @param context
55 | */
56 | private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
57 | if (BuildConfig.DEBUG) {
58 | try {
59 | /*
60 | We use reflection here to pick up the class that initializes Flipper,
61 | since Flipper library is not available in release mode
62 | */
63 | Class> aClass = Class.forName("com.example.reactnativeperspectivecorrectionimageview.ReactNativeFlipper");
64 | aClass
65 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
66 | .invoke(null, context, reactInstanceManager);
67 | } catch (ClassNotFoundException e) {
68 | e.printStackTrace();
69 | } catch (NoSuchMethodException e) {
70 | e.printStackTrace();
71 | } catch (IllegalAccessException e) {
72 | e.printStackTrace();
73 | } catch (InvocationTargetException e) {
74 | e.printStackTrace();
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | PerspectiveCorrectionImageView Example
3 |
4 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | minSdkVersion = 16
6 | compileSdkVersion = 29
7 | targetSdkVersion = 29
8 | }
9 | repositories {
10 | google()
11 | mavenCentral()
12 | jcenter()
13 | }
14 | dependencies {
15 | classpath("com.android.tools.build:gradle:3.5.3")
16 |
17 | // NOTE: Do not place your application dependencies here; they belong
18 | // in the individual module build.gradle files
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | mavenLocal()
25 | maven {
26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27 | url("$rootDir/../node_modules/react-native/android")
28 | }
29 | maven {
30 | // Android JSC is installed from npm
31 | url("$rootDir/../node_modules/jsc-android/dist")
32 | }
33 |
34 | google()
35 | mavenCentral()
36 | jcenter()
37 | maven { url 'https://www.jitpack.io' }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useAndroidX=true
21 | android.enableJetifier=true
22 | FLIPPER_VERSION=0.54.0
23 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin or MSYS, switch paths to Windows format before running java
129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=`expr $i + 1`
158 | done
159 | case $i in
160 | 0) set -- ;;
161 | 1) set -- "$args0" ;;
162 | 2) set -- "$args0" "$args1" ;;
163 | 3) set -- "$args0" "$args1" "$args2" ;;
164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=`save "$@"`
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | exec "$JAVACMD" "$@"
184 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto init
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto init
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :init
68 | @rem Get command-line arguments, handling Windows variants
69 |
70 | if not "%OS%" == "Windows_NT" goto win9xME_args
71 |
72 | :win9xME_args
73 | @rem Slurp the command line arguments.
74 | set CMD_LINE_ARGS=
75 | set _SKIP=2
76 |
77 | :win9xME_args_slurp
78 | if "x%~1" == "x" goto execute
79 |
80 | set CMD_LINE_ARGS=%*
81 |
82 | :execute
83 | @rem Setup the command line
84 |
85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
86 |
87 | @rem Execute Gradle
88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
89 |
90 | :end
91 | @rem End local scope for the variables with windows NT shell
92 | if "%ERRORLEVEL%"=="0" goto mainEnd
93 |
94 | :fail
95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
96 | rem the _cmd.exe /c_ return code!
97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
98 | exit /b 1
99 |
100 | :mainEnd
101 | if "%OS%"=="Windows_NT" endlocal
102 |
103 | :omega
104 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'PerspectiveCorrectionImageViewExample'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 |
5 |
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "PerspectiveCorrectionImageViewExample",
3 | "displayName": "PerspectiveCorrectionImageView Example"
4 | }
5 |
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const pak = require('../package.json');
3 |
4 | module.exports = {
5 | presets: ['module:metro-react-native-babel-preset'],
6 | plugins: [
7 | [
8 | 'module-resolver',
9 | {
10 | extensions: ['.tsx', '.ts', '.js', '.json'],
11 | alias: {
12 | [pak.name]: path.join(__dirname, '..', pak.source),
13 | },
14 | },
15 | ],
16 | ],
17 | };
18 |
--------------------------------------------------------------------------------
/example/index.tsx:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native';
2 | import App from './src/App';
3 | import { name as appName } from './app.json';
4 |
5 | AppRegistry.registerComponent(appName, () => App);
6 |
--------------------------------------------------------------------------------
/example/ios/File.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // PerspectiveCorrectionImageViewExample
4 | //
5 |
6 | import Foundation
7 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00E356F31AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.m */; };
11 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
15 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
16 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
17 | 2DCD954D1E0B4F2C00145EB5 /* PerspectiveCorrectionImageViewExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.m */; };
18 | 4C39C56BAD484C67AA576FFA /* libPods-PerspectiveCorrectionImageViewExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CA3E69C5B9553B26FBA2DF04 /* libPods-PerspectiveCorrectionImageViewExample.a */; };
19 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
26 | proxyType = 1;
27 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
28 | remoteInfo = PerspectiveCorrectionImageViewExample;
29 | };
30 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
33 | proxyType = 1;
34 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;
35 | remoteInfo = "PerspectiveCorrectionImageViewExample-tvOS";
36 | };
37 | /* End PBXContainerItemProxy section */
38 |
39 | /* Begin PBXFileReference section */
40 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
41 | 00E356EE1AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PerspectiveCorrectionImageViewExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
43 | 00E356F21AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PerspectiveCorrectionImageViewExampleTests.m; sourceTree = ""; };
44 | 13B07F961A680F5B00A75B9A /* PerspectiveCorrectionImageViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PerspectiveCorrectionImageViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
45 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = PerspectiveCorrectionImageViewExample/AppDelegate.h; sourceTree = ""; };
46 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = PerspectiveCorrectionImageViewExample/AppDelegate.m; sourceTree = ""; };
47 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = PerspectiveCorrectionImageViewExample/Images.xcassets; sourceTree = ""; };
48 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = PerspectiveCorrectionImageViewExample/Info.plist; sourceTree = ""; };
49 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = PerspectiveCorrectionImageViewExample/main.m; sourceTree = ""; };
50 | 2D02E47B1E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PerspectiveCorrectionImageViewExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
51 | 2D02E4901E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PerspectiveCorrectionImageViewExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
52 | 47F7ED3B7971BE374F7B8635 /* Pods-PerspectiveCorrectionImageViewExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PerspectiveCorrectionImageViewExample.debug.xcconfig"; path = "Target Support Files/Pods-PerspectiveCorrectionImageViewExample/Pods-PerspectiveCorrectionImageViewExample.debug.xcconfig"; sourceTree = ""; };
53 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = PerspectiveCorrectionImageViewExample/LaunchScreen.storyboard; sourceTree = ""; };
54 | CA3E69C5B9553B26FBA2DF04 /* libPods-PerspectiveCorrectionImageViewExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PerspectiveCorrectionImageViewExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
55 | E00ACF0FDA8BF921659E2F9A /* Pods-PerspectiveCorrectionImageViewExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PerspectiveCorrectionImageViewExample.release.xcconfig"; path = "Target Support Files/Pods-PerspectiveCorrectionImageViewExample/Pods-PerspectiveCorrectionImageViewExample.release.xcconfig"; sourceTree = ""; };
56 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
57 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
58 | /* End PBXFileReference section */
59 |
60 | /* Begin PBXFrameworksBuildPhase section */
61 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | );
66 | runOnlyForDeploymentPostprocessing = 0;
67 | };
68 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
69 | isa = PBXFrameworksBuildPhase;
70 | buildActionMask = 2147483647;
71 | files = (
72 | 4C39C56BAD484C67AA576FFA /* libPods-PerspectiveCorrectionImageViewExample.a in Frameworks */,
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | 2D02E4781E0B4A5D006451C7 /* Frameworks */ = {
77 | isa = PBXFrameworksBuildPhase;
78 | buildActionMask = 2147483647;
79 | files = (
80 | );
81 | runOnlyForDeploymentPostprocessing = 0;
82 | };
83 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = {
84 | isa = PBXFrameworksBuildPhase;
85 | buildActionMask = 2147483647;
86 | files = (
87 | );
88 | runOnlyForDeploymentPostprocessing = 0;
89 | };
90 | /* End PBXFrameworksBuildPhase section */
91 |
92 | /* Begin PBXGroup section */
93 | 00E356EF1AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 00E356F21AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.m */,
97 | 00E356F01AD99517003FC87E /* Supporting Files */,
98 | );
99 | path = PerspectiveCorrectionImageViewExampleTests;
100 | sourceTree = "";
101 | };
102 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | 00E356F11AD99517003FC87E /* Info.plist */,
106 | );
107 | name = "Supporting Files";
108 | sourceTree = "";
109 | };
110 | 13B07FAE1A68108700A75B9A /* PerspectiveCorrectionImageViewExample */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
114 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
115 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
116 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
117 | 13B07FB61A68108700A75B9A /* Info.plist */,
118 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
119 | 13B07FB71A68108700A75B9A /* main.m */,
120 | );
121 | name = PerspectiveCorrectionImageViewExample;
122 | sourceTree = "";
123 | };
124 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
125 | isa = PBXGroup;
126 | children = (
127 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
128 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
129 | CA3E69C5B9553B26FBA2DF04 /* libPods-PerspectiveCorrectionImageViewExample.a */,
130 | );
131 | name = Frameworks;
132 | sourceTree = "";
133 | };
134 | 6B9684456A2045ADE5A6E47E /* Pods */ = {
135 | isa = PBXGroup;
136 | children = (
137 | 47F7ED3B7971BE374F7B8635 /* Pods-PerspectiveCorrectionImageViewExample.debug.xcconfig */,
138 | E00ACF0FDA8BF921659E2F9A /* Pods-PerspectiveCorrectionImageViewExample.release.xcconfig */,
139 | );
140 | name = Pods;
141 | path = Pods;
142 | sourceTree = "";
143 | };
144 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
145 | isa = PBXGroup;
146 | children = (
147 | );
148 | name = Libraries;
149 | sourceTree = "";
150 | };
151 | 83CBB9F61A601CBA00E9B192 = {
152 | isa = PBXGroup;
153 | children = (
154 | 13B07FAE1A68108700A75B9A /* PerspectiveCorrectionImageViewExample */,
155 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
156 | 00E356EF1AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests */,
157 | 83CBBA001A601CBA00E9B192 /* Products */,
158 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
159 | 6B9684456A2045ADE5A6E47E /* Pods */,
160 | );
161 | indentWidth = 2;
162 | sourceTree = "";
163 | tabWidth = 2;
164 | usesTabs = 0;
165 | };
166 | 83CBBA001A601CBA00E9B192 /* Products */ = {
167 | isa = PBXGroup;
168 | children = (
169 | 13B07F961A680F5B00A75B9A /* PerspectiveCorrectionImageViewExample.app */,
170 | 00E356EE1AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.xctest */,
171 | 2D02E47B1E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOS.app */,
172 | 2D02E4901E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOSTests.xctest */,
173 | );
174 | name = Products;
175 | sourceTree = "";
176 | };
177 | /* End PBXGroup section */
178 |
179 | /* Begin PBXNativeTarget section */
180 | 00E356ED1AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests */ = {
181 | isa = PBXNativeTarget;
182 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "PerspectiveCorrectionImageViewExampleTests" */;
183 | buildPhases = (
184 | 00E356EA1AD99517003FC87E /* Sources */,
185 | 00E356EB1AD99517003FC87E /* Frameworks */,
186 | 00E356EC1AD99517003FC87E /* Resources */,
187 | );
188 | buildRules = (
189 | );
190 | dependencies = (
191 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
192 | );
193 | name = PerspectiveCorrectionImageViewExampleTests;
194 | productName = PerspectiveCorrectionImageViewExampleTests;
195 | productReference = 00E356EE1AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.xctest */;
196 | productType = "com.apple.product-type.bundle.unit-test";
197 | };
198 | 13B07F861A680F5B00A75B9A /* PerspectiveCorrectionImageViewExample */ = {
199 | isa = PBXNativeTarget;
200 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PerspectiveCorrectionImageViewExample" */;
201 | buildPhases = (
202 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */,
203 | FD10A7F022414F080027D42C /* Start Packager */,
204 | 13B07F871A680F5B00A75B9A /* Sources */,
205 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
206 | 13B07F8E1A680F5B00A75B9A /* Resources */,
207 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
208 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */,
209 | );
210 | buildRules = (
211 | );
212 | dependencies = (
213 | );
214 | name = PerspectiveCorrectionImageViewExample;
215 | productName = PerspectiveCorrectionImageViewExample;
216 | productReference = 13B07F961A680F5B00A75B9A /* PerspectiveCorrectionImageViewExample.app */;
217 | productType = "com.apple.product-type.application";
218 | };
219 | 2D02E47A1E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOS */ = {
220 | isa = PBXNativeTarget;
221 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PerspectiveCorrectionImageViewExample-tvOS" */;
222 | buildPhases = (
223 | FD10A7F122414F3F0027D42C /* Start Packager */,
224 | 2D02E4771E0B4A5D006451C7 /* Sources */,
225 | 2D02E4781E0B4A5D006451C7 /* Frameworks */,
226 | 2D02E4791E0B4A5D006451C7 /* Resources */,
227 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */,
228 | );
229 | buildRules = (
230 | );
231 | dependencies = (
232 | );
233 | name = "PerspectiveCorrectionImageViewExample-tvOS";
234 | productName = "PerspectiveCorrectionImageViewExample-tvOS";
235 | productReference = 2D02E47B1E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOS.app */;
236 | productType = "com.apple.product-type.application";
237 | };
238 | 2D02E48F1E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOSTests */ = {
239 | isa = PBXNativeTarget;
240 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PerspectiveCorrectionImageViewExample-tvOSTests" */;
241 | buildPhases = (
242 | 2D02E48C1E0B4A5D006451C7 /* Sources */,
243 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */,
244 | 2D02E48E1E0B4A5D006451C7 /* Resources */,
245 | );
246 | buildRules = (
247 | );
248 | dependencies = (
249 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */,
250 | );
251 | name = "PerspectiveCorrectionImageViewExample-tvOSTests";
252 | productName = "PerspectiveCorrectionImageViewExample-tvOSTests";
253 | productReference = 2D02E4901E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOSTests.xctest */;
254 | productType = "com.apple.product-type.bundle.unit-test";
255 | };
256 | /* End PBXNativeTarget section */
257 |
258 | /* Begin PBXProject section */
259 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
260 | isa = PBXProject;
261 | attributes = {
262 | LastUpgradeCheck = 1130;
263 | TargetAttributes = {
264 | 00E356ED1AD99517003FC87E = {
265 | CreatedOnToolsVersion = 6.2;
266 | TestTargetID = 13B07F861A680F5B00A75B9A;
267 | };
268 | 13B07F861A680F5B00A75B9A = {
269 | LastSwiftMigration = 1120;
270 | };
271 | 2D02E47A1E0B4A5D006451C7 = {
272 | CreatedOnToolsVersion = 8.2.1;
273 | ProvisioningStyle = Automatic;
274 | };
275 | 2D02E48F1E0B4A5D006451C7 = {
276 | CreatedOnToolsVersion = 8.2.1;
277 | ProvisioningStyle = Automatic;
278 | TestTargetID = 2D02E47A1E0B4A5D006451C7;
279 | };
280 | };
281 | };
282 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PerspectiveCorrectionImageViewExample" */;
283 | compatibilityVersion = "Xcode 3.2";
284 | developmentRegion = en;
285 | hasScannedForEncodings = 0;
286 | knownRegions = (
287 | en,
288 | Base,
289 | );
290 | mainGroup = 83CBB9F61A601CBA00E9B192;
291 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
292 | projectDirPath = "";
293 | projectRoot = "";
294 | targets = (
295 | 13B07F861A680F5B00A75B9A /* PerspectiveCorrectionImageViewExample */,
296 | 00E356ED1AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests */,
297 | 2D02E47A1E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOS */,
298 | 2D02E48F1E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOSTests */,
299 | );
300 | };
301 | /* End PBXProject section */
302 |
303 | /* Begin PBXResourcesBuildPhase section */
304 | 00E356EC1AD99517003FC87E /* Resources */ = {
305 | isa = PBXResourcesBuildPhase;
306 | buildActionMask = 2147483647;
307 | files = (
308 | );
309 | runOnlyForDeploymentPostprocessing = 0;
310 | };
311 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
312 | isa = PBXResourcesBuildPhase;
313 | buildActionMask = 2147483647;
314 | files = (
315 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
316 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
317 | );
318 | runOnlyForDeploymentPostprocessing = 0;
319 | };
320 | 2D02E4791E0B4A5D006451C7 /* Resources */ = {
321 | isa = PBXResourcesBuildPhase;
322 | buildActionMask = 2147483647;
323 | files = (
324 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
325 | );
326 | runOnlyForDeploymentPostprocessing = 0;
327 | };
328 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = {
329 | isa = PBXResourcesBuildPhase;
330 | buildActionMask = 2147483647;
331 | files = (
332 | );
333 | runOnlyForDeploymentPostprocessing = 0;
334 | };
335 | /* End PBXResourcesBuildPhase section */
336 |
337 | /* Begin PBXShellScriptBuildPhase section */
338 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
339 | isa = PBXShellScriptBuildPhase;
340 | buildActionMask = 2147483647;
341 | files = (
342 | );
343 | inputPaths = (
344 | );
345 | name = "Bundle React Native code and images";
346 | outputPaths = (
347 | );
348 | runOnlyForDeploymentPostprocessing = 0;
349 | shellPath = /bin/sh;
350 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
351 | };
352 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
353 | isa = PBXShellScriptBuildPhase;
354 | buildActionMask = 2147483647;
355 | files = (
356 | );
357 | inputPaths = (
358 | );
359 | name = "Bundle React Native Code And Images";
360 | outputPaths = (
361 | );
362 | runOnlyForDeploymentPostprocessing = 0;
363 | shellPath = /bin/sh;
364 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
365 | };
366 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */ = {
367 | isa = PBXShellScriptBuildPhase;
368 | buildActionMask = 2147483647;
369 | files = (
370 | );
371 | inputFileListPaths = (
372 | );
373 | inputPaths = (
374 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
375 | "${PODS_ROOT}/Manifest.lock",
376 | );
377 | name = "[CP] Check Pods Manifest.lock";
378 | outputFileListPaths = (
379 | );
380 | outputPaths = (
381 | "$(DERIVED_FILE_DIR)/Pods-PerspectiveCorrectionImageViewExample-checkManifestLockResult.txt",
382 | );
383 | runOnlyForDeploymentPostprocessing = 0;
384 | shellPath = /bin/sh;
385 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
386 | showEnvVarsInLog = 0;
387 | };
388 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */ = {
389 | isa = PBXShellScriptBuildPhase;
390 | buildActionMask = 2147483647;
391 | files = (
392 | );
393 | inputPaths = (
394 | "${PODS_ROOT}/Target Support Files/Pods-PerspectiveCorrectionImageViewExample/Pods-PerspectiveCorrectionImageViewExample-resources.sh",
395 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
396 | );
397 | name = "[CP] Copy Pods Resources";
398 | outputPaths = (
399 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
400 | );
401 | runOnlyForDeploymentPostprocessing = 0;
402 | shellPath = /bin/sh;
403 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PerspectiveCorrectionImageViewExample/Pods-PerspectiveCorrectionImageViewExample-resources.sh\"\n";
404 | showEnvVarsInLog = 0;
405 | };
406 | FD10A7F022414F080027D42C /* Start Packager */ = {
407 | isa = PBXShellScriptBuildPhase;
408 | buildActionMask = 2147483647;
409 | files = (
410 | );
411 | inputFileListPaths = (
412 | );
413 | inputPaths = (
414 | );
415 | name = "Start Packager";
416 | outputFileListPaths = (
417 | );
418 | outputPaths = (
419 | );
420 | runOnlyForDeploymentPostprocessing = 0;
421 | shellPath = /bin/sh;
422 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
423 | showEnvVarsInLog = 0;
424 | };
425 | FD10A7F122414F3F0027D42C /* Start Packager */ = {
426 | isa = PBXShellScriptBuildPhase;
427 | buildActionMask = 2147483647;
428 | files = (
429 | );
430 | inputFileListPaths = (
431 | );
432 | inputPaths = (
433 | );
434 | name = "Start Packager";
435 | outputFileListPaths = (
436 | );
437 | outputPaths = (
438 | );
439 | runOnlyForDeploymentPostprocessing = 0;
440 | shellPath = /bin/sh;
441 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
442 | showEnvVarsInLog = 0;
443 | };
444 | /* End PBXShellScriptBuildPhase section */
445 |
446 | /* Begin PBXSourcesBuildPhase section */
447 | 00E356EA1AD99517003FC87E /* Sources */ = {
448 | isa = PBXSourcesBuildPhase;
449 | buildActionMask = 2147483647;
450 | files = (
451 | 00E356F31AD99517003FC87E /* PerspectiveCorrectionImageViewExampleTests.m in Sources */,
452 | );
453 | runOnlyForDeploymentPostprocessing = 0;
454 | };
455 | 13B07F871A680F5B00A75B9A /* Sources */ = {
456 | isa = PBXSourcesBuildPhase;
457 | buildActionMask = 2147483647;
458 | files = (
459 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
460 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
461 | );
462 | runOnlyForDeploymentPostprocessing = 0;
463 | };
464 | 2D02E4771E0B4A5D006451C7 /* Sources */ = {
465 | isa = PBXSourcesBuildPhase;
466 | buildActionMask = 2147483647;
467 | files = (
468 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,
469 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,
470 | );
471 | runOnlyForDeploymentPostprocessing = 0;
472 | };
473 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = {
474 | isa = PBXSourcesBuildPhase;
475 | buildActionMask = 2147483647;
476 | files = (
477 | 2DCD954D1E0B4F2C00145EB5 /* PerspectiveCorrectionImageViewExampleTests.m in Sources */,
478 | );
479 | runOnlyForDeploymentPostprocessing = 0;
480 | };
481 | /* End PBXSourcesBuildPhase section */
482 |
483 | /* Begin PBXTargetDependency section */
484 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
485 | isa = PBXTargetDependency;
486 | target = 13B07F861A680F5B00A75B9A /* PerspectiveCorrectionImageViewExample */;
487 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
488 | };
489 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = {
490 | isa = PBXTargetDependency;
491 | target = 2D02E47A1E0B4A5D006451C7 /* PerspectiveCorrectionImageViewExample-tvOS */;
492 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */;
493 | };
494 | /* End PBXTargetDependency section */
495 |
496 | /* Begin XCBuildConfiguration section */
497 | 00E356F61AD99517003FC87E /* Debug */ = {
498 | isa = XCBuildConfiguration;
499 | buildSettings = {
500 | BUNDLE_LOADER = "$(TEST_HOST)";
501 | GCC_PREPROCESSOR_DEFINITIONS = (
502 | "DEBUG=1",
503 | "$(inherited)",
504 | );
505 | INFOPLIST_FILE = PerspectiveCorrectionImageViewExampleTests/Info.plist;
506 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
508 | OTHER_LDFLAGS = (
509 | "-ObjC",
510 | "-lc++",
511 | "$(inherited)",
512 | );
513 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeperspectivecorrectionimageview;
514 | PRODUCT_NAME = "$(TARGET_NAME)";
515 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PerspectiveCorrectionImageViewExample.app/PerspectiveCorrectionImageViewExample";
516 | };
517 | name = Debug;
518 | };
519 | 00E356F71AD99517003FC87E /* Release */ = {
520 | isa = XCBuildConfiguration;
521 | buildSettings = {
522 | BUNDLE_LOADER = "$(TEST_HOST)";
523 | COPY_PHASE_STRIP = NO;
524 | INFOPLIST_FILE = PerspectiveCorrectionImageViewExampleTests/Info.plist;
525 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
526 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
527 | OTHER_LDFLAGS = (
528 | "-ObjC",
529 | "-lc++",
530 | "$(inherited)",
531 | );
532 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeperspectivecorrectionimageview;
533 | PRODUCT_NAME = "$(TARGET_NAME)";
534 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PerspectiveCorrectionImageViewExample.app/PerspectiveCorrectionImageViewExample";
535 | };
536 | name = Release;
537 | };
538 | 13B07F941A680F5B00A75B9A /* Debug */ = {
539 | isa = XCBuildConfiguration;
540 | baseConfigurationReference = 47F7ED3B7971BE374F7B8635 /* Pods-PerspectiveCorrectionImageViewExample.debug.xcconfig */;
541 | buildSettings = {
542 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
543 | CLANG_ENABLE_MODULES = YES;
544 | CURRENT_PROJECT_VERSION = 1;
545 | ENABLE_BITCODE = NO;
546 | INFOPLIST_FILE = PerspectiveCorrectionImageViewExample/Info.plist;
547 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
548 | OTHER_LDFLAGS = (
549 | "$(inherited)",
550 | "-ObjC",
551 | "-lc++",
552 | );
553 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeperspectivecorrectionimageview;
554 | PRODUCT_NAME = PerspectiveCorrectionImageViewExample;
555 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
556 | SWIFT_VERSION = 5.0;
557 | VERSIONING_SYSTEM = "apple-generic";
558 | };
559 | name = Debug;
560 | };
561 | 13B07F951A680F5B00A75B9A /* Release */ = {
562 | isa = XCBuildConfiguration;
563 | baseConfigurationReference = E00ACF0FDA8BF921659E2F9A /* Pods-PerspectiveCorrectionImageViewExample.release.xcconfig */;
564 | buildSettings = {
565 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
566 | CLANG_ENABLE_MODULES = YES;
567 | CURRENT_PROJECT_VERSION = 1;
568 | INFOPLIST_FILE = PerspectiveCorrectionImageViewExample/Info.plist;
569 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
570 | OTHER_LDFLAGS = (
571 | "$(inherited)",
572 | "-ObjC",
573 | "-lc++",
574 | );
575 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeperspectivecorrectionimageview;
576 | PRODUCT_NAME = PerspectiveCorrectionImageViewExample;
577 | SWIFT_VERSION = 5.0;
578 | VERSIONING_SYSTEM = "apple-generic";
579 | };
580 | name = Release;
581 | };
582 | 2D02E4971E0B4A5E006451C7 /* Debug */ = {
583 | isa = XCBuildConfiguration;
584 | buildSettings = {
585 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
586 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
587 | CLANG_ANALYZER_NONNULL = YES;
588 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
589 | CLANG_WARN_INFINITE_RECURSION = YES;
590 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
591 | DEBUG_INFORMATION_FORMAT = dwarf;
592 | ENABLE_TESTABILITY = YES;
593 | GCC_NO_COMMON_BLOCKS = YES;
594 | INFOPLIST_FILE = "PerspectiveCorrectionImageViewExample-tvOS/Info.plist";
595 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
596 | OTHER_LDFLAGS = (
597 | "$(inherited)",
598 | "-ObjC",
599 | "-lc++",
600 | );
601 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.PerspectiveCorrectionImageViewExample-tvOS";
602 | PRODUCT_NAME = "$(TARGET_NAME)";
603 | SDKROOT = appletvos;
604 | TARGETED_DEVICE_FAMILY = 3;
605 | TVOS_DEPLOYMENT_TARGET = 10.0;
606 | };
607 | name = Debug;
608 | };
609 | 2D02E4981E0B4A5E006451C7 /* Release */ = {
610 | isa = XCBuildConfiguration;
611 | buildSettings = {
612 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
613 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
614 | CLANG_ANALYZER_NONNULL = YES;
615 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
616 | CLANG_WARN_INFINITE_RECURSION = YES;
617 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
618 | COPY_PHASE_STRIP = NO;
619 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
620 | GCC_NO_COMMON_BLOCKS = YES;
621 | INFOPLIST_FILE = "PerspectiveCorrectionImageViewExample-tvOS/Info.plist";
622 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
623 | OTHER_LDFLAGS = (
624 | "$(inherited)",
625 | "-ObjC",
626 | "-lc++",
627 | );
628 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.PerspectiveCorrectionImageViewExample-tvOS";
629 | PRODUCT_NAME = "$(TARGET_NAME)";
630 | SDKROOT = appletvos;
631 | TARGETED_DEVICE_FAMILY = 3;
632 | TVOS_DEPLOYMENT_TARGET = 10.0;
633 | };
634 | name = Release;
635 | };
636 | 2D02E4991E0B4A5E006451C7 /* Debug */ = {
637 | isa = XCBuildConfiguration;
638 | buildSettings = {
639 | BUNDLE_LOADER = "$(TEST_HOST)";
640 | CLANG_ANALYZER_NONNULL = YES;
641 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
642 | CLANG_WARN_INFINITE_RECURSION = YES;
643 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
644 | DEBUG_INFORMATION_FORMAT = dwarf;
645 | ENABLE_TESTABILITY = YES;
646 | GCC_NO_COMMON_BLOCKS = YES;
647 | INFOPLIST_FILE = "PerspectiveCorrectionImageViewExample-tvOSTests/Info.plist";
648 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
649 | OTHER_LDFLAGS = (
650 | "$(inherited)",
651 | "-ObjC",
652 | "-lc++",
653 | );
654 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.PerspectiveCorrectionImageViewExample-tvOSTests";
655 | PRODUCT_NAME = "$(TARGET_NAME)";
656 | SDKROOT = appletvos;
657 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PerspectiveCorrectionImageViewExample-tvOS.app/PerspectiveCorrectionImageViewExample-tvOS";
658 | TVOS_DEPLOYMENT_TARGET = 10.1;
659 | };
660 | name = Debug;
661 | };
662 | 2D02E49A1E0B4A5E006451C7 /* Release */ = {
663 | isa = XCBuildConfiguration;
664 | buildSettings = {
665 | BUNDLE_LOADER = "$(TEST_HOST)";
666 | CLANG_ANALYZER_NONNULL = YES;
667 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
668 | CLANG_WARN_INFINITE_RECURSION = YES;
669 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
670 | COPY_PHASE_STRIP = NO;
671 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
672 | GCC_NO_COMMON_BLOCKS = YES;
673 | INFOPLIST_FILE = "PerspectiveCorrectionImageViewExample-tvOSTests/Info.plist";
674 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
675 | OTHER_LDFLAGS = (
676 | "$(inherited)",
677 | "-ObjC",
678 | "-lc++",
679 | );
680 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.PerspectiveCorrectionImageViewExample-tvOSTests";
681 | PRODUCT_NAME = "$(TARGET_NAME)";
682 | SDKROOT = appletvos;
683 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PerspectiveCorrectionImageViewExample-tvOS.app/PerspectiveCorrectionImageViewExample-tvOS";
684 | TVOS_DEPLOYMENT_TARGET = 10.1;
685 | };
686 | name = Release;
687 | };
688 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
689 | isa = XCBuildConfiguration;
690 | buildSettings = {
691 | ALWAYS_SEARCH_USER_PATHS = NO;
692 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
693 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
694 | CLANG_CXX_LIBRARY = "libc++";
695 | CLANG_ENABLE_MODULES = YES;
696 | CLANG_ENABLE_OBJC_ARC = YES;
697 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
698 | CLANG_WARN_BOOL_CONVERSION = YES;
699 | CLANG_WARN_COMMA = YES;
700 | CLANG_WARN_CONSTANT_CONVERSION = YES;
701 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
702 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
703 | CLANG_WARN_EMPTY_BODY = YES;
704 | CLANG_WARN_ENUM_CONVERSION = YES;
705 | CLANG_WARN_INFINITE_RECURSION = YES;
706 | CLANG_WARN_INT_CONVERSION = YES;
707 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
708 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
709 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
710 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
711 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
712 | CLANG_WARN_STRICT_PROTOTYPES = YES;
713 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
714 | CLANG_WARN_UNREACHABLE_CODE = YES;
715 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
716 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
717 | COPY_PHASE_STRIP = NO;
718 | ENABLE_STRICT_OBJC_MSGSEND = YES;
719 | ENABLE_TESTABILITY = YES;
720 | GCC_C_LANGUAGE_STANDARD = gnu99;
721 | GCC_DYNAMIC_NO_PIC = NO;
722 | GCC_NO_COMMON_BLOCKS = YES;
723 | GCC_OPTIMIZATION_LEVEL = 0;
724 | GCC_PREPROCESSOR_DEFINITIONS = (
725 | "DEBUG=1",
726 | "$(inherited)",
727 | );
728 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
729 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
730 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
731 | GCC_WARN_UNDECLARED_SELECTOR = YES;
732 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
733 | GCC_WARN_UNUSED_FUNCTION = YES;
734 | GCC_WARN_UNUSED_VARIABLE = YES;
735 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
736 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
737 | LIBRARY_SEARCH_PATHS = (
738 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
739 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
740 | "\"$(inherited)\"",
741 | );
742 | MTL_ENABLE_DEBUG_INFO = YES;
743 | ONLY_ACTIVE_ARCH = YES;
744 | SDKROOT = iphoneos;
745 | };
746 | name = Debug;
747 | };
748 | 83CBBA211A601CBA00E9B192 /* Release */ = {
749 | isa = XCBuildConfiguration;
750 | buildSettings = {
751 | ALWAYS_SEARCH_USER_PATHS = NO;
752 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
753 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
754 | CLANG_CXX_LIBRARY = "libc++";
755 | CLANG_ENABLE_MODULES = YES;
756 | CLANG_ENABLE_OBJC_ARC = YES;
757 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
758 | CLANG_WARN_BOOL_CONVERSION = YES;
759 | CLANG_WARN_COMMA = YES;
760 | CLANG_WARN_CONSTANT_CONVERSION = YES;
761 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
762 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
763 | CLANG_WARN_EMPTY_BODY = YES;
764 | CLANG_WARN_ENUM_CONVERSION = YES;
765 | CLANG_WARN_INFINITE_RECURSION = YES;
766 | CLANG_WARN_INT_CONVERSION = YES;
767 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
768 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
769 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
770 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
771 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
772 | CLANG_WARN_STRICT_PROTOTYPES = YES;
773 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
774 | CLANG_WARN_UNREACHABLE_CODE = YES;
775 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
776 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
777 | COPY_PHASE_STRIP = YES;
778 | ENABLE_NS_ASSERTIONS = NO;
779 | ENABLE_STRICT_OBJC_MSGSEND = YES;
780 | GCC_C_LANGUAGE_STANDARD = gnu99;
781 | GCC_NO_COMMON_BLOCKS = YES;
782 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
783 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
784 | GCC_WARN_UNDECLARED_SELECTOR = YES;
785 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
786 | GCC_WARN_UNUSED_FUNCTION = YES;
787 | GCC_WARN_UNUSED_VARIABLE = YES;
788 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
789 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
790 | LIBRARY_SEARCH_PATHS = (
791 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
792 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
793 | "\"$(inherited)\"",
794 | );
795 | MTL_ENABLE_DEBUG_INFO = NO;
796 | SDKROOT = iphoneos;
797 | VALIDATE_PRODUCT = YES;
798 | };
799 | name = Release;
800 | };
801 | /* End XCBuildConfiguration section */
802 |
803 | /* Begin XCConfigurationList section */
804 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "PerspectiveCorrectionImageViewExampleTests" */ = {
805 | isa = XCConfigurationList;
806 | buildConfigurations = (
807 | 00E356F61AD99517003FC87E /* Debug */,
808 | 00E356F71AD99517003FC87E /* Release */,
809 | );
810 | defaultConfigurationIsVisible = 0;
811 | defaultConfigurationName = Release;
812 | };
813 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PerspectiveCorrectionImageViewExample" */ = {
814 | isa = XCConfigurationList;
815 | buildConfigurations = (
816 | 13B07F941A680F5B00A75B9A /* Debug */,
817 | 13B07F951A680F5B00A75B9A /* Release */,
818 | );
819 | defaultConfigurationIsVisible = 0;
820 | defaultConfigurationName = Release;
821 | };
822 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PerspectiveCorrectionImageViewExample-tvOS" */ = {
823 | isa = XCConfigurationList;
824 | buildConfigurations = (
825 | 2D02E4971E0B4A5E006451C7 /* Debug */,
826 | 2D02E4981E0B4A5E006451C7 /* Release */,
827 | );
828 | defaultConfigurationIsVisible = 0;
829 | defaultConfigurationName = Release;
830 | };
831 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PerspectiveCorrectionImageViewExample-tvOSTests" */ = {
832 | isa = XCConfigurationList;
833 | buildConfigurations = (
834 | 2D02E4991E0B4A5E006451C7 /* Debug */,
835 | 2D02E49A1E0B4A5E006451C7 /* Release */,
836 | );
837 | defaultConfigurationIsVisible = 0;
838 | defaultConfigurationName = Release;
839 | };
840 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PerspectiveCorrectionImageViewExample" */ = {
841 | isa = XCConfigurationList;
842 | buildConfigurations = (
843 | 83CBBA201A601CBA00E9B192 /* Debug */,
844 | 83CBBA211A601CBA00E9B192 /* Release */,
845 | );
846 | defaultConfigurationIsVisible = 0;
847 | defaultConfigurationName = Release;
848 | };
849 | /* End XCConfigurationList section */
850 | };
851 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
852 | }
853 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample.xcodeproj/xcshareddata/xcschemes/PerspectiveCorrectionImageViewExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
81 |
83 |
89 |
90 |
91 |
92 |
94 |
95 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (nonatomic, strong) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 |
10 | #import
11 | #import
12 | #import
13 |
14 | #ifdef FB_SONARKIT_ENABLED
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import
20 | #import
21 | static void InitializeFlipper(UIApplication *application) {
22 | FlipperClient *client = [FlipperClient sharedClient];
23 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
24 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
25 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
26 | [client addPlugin:[FlipperKitReactPlugin new]];
27 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
28 | [client start];
29 | }
30 | #endif
31 |
32 | @implementation AppDelegate
33 |
34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
35 | {
36 | #ifdef FB_SONARKIT_ENABLED
37 | InitializeFlipper(application);
38 | #endif
39 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
40 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
41 | moduleName:@"PerspectiveCorrectionImageViewExample"
42 | initialProperties:nil];
43 |
44 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
45 |
46 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
47 | UIViewController *rootViewController = [UIViewController new];
48 | rootViewController.view = rootView;
49 | self.window.rootViewController = rootViewController;
50 | [self.window makeKeyAndVisible];
51 | return YES;
52 | }
53 |
54 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
55 | {
56 | #if DEBUG
57 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
58 | #else
59 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
60 | #endif
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | PerspectiveCorrectionImageView Example
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 | NSExceptionDomains
32 |
33 | localhost
34 |
35 | NSExceptionAllowsInsecureHTTPLoads
36 |
37 |
38 |
39 |
40 | NSLocationWhenInUseUsageDescription
41 |
42 | UILaunchStoryboardName
43 | LaunchScreen
44 | UIRequiredDeviceCapabilities
45 |
46 | armv7
47 |
48 | UISupportedInterfaceOrientations
49 |
50 | UIInterfaceOrientationPortrait
51 | UIInterfaceOrientationLandscapeLeft
52 | UIInterfaceOrientationLandscapeRight
53 |
54 | UIViewControllerBasedStatusBarAppearance
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/example/ios/PerspectiveCorrectionImageViewExample/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../node_modules/react-native/scripts/react_native_pods'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | platform :ios, '10.0'
5 |
6 | target 'PerspectiveCorrectionImageViewExample' do
7 | config = use_native_modules!
8 |
9 | use_react_native!(:path => config["reactNativePath"])
10 |
11 | post_install do |installer|
12 | flipper_post_install(installer)
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/example/metro.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const blacklist = require('metro-config/src/defaults/blacklist');
3 | const escape = require('escape-string-regexp');
4 | const pak = require('../package.json');
5 |
6 | const root = path.resolve(__dirname, '..');
7 |
8 | const modules = Object.keys({
9 | ...pak.peerDependencies,
10 | });
11 |
12 | module.exports = {
13 | projectRoot: __dirname,
14 | watchFolders: [root],
15 |
16 | // We need to make sure that only one version is loaded for peerDependencies
17 | // So we blacklist them at the root, and alias them to the versions in example's node_modules
18 | resolver: {
19 | blacklistRE: blacklist(
20 | modules.map(
21 | (m) =>
22 | new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
23 | )
24 | ),
25 |
26 | extraNodeModules: modules.reduce((acc, name) => {
27 | acc[name] = path.join(__dirname, 'node_modules', name);
28 | return acc;
29 | }, {}),
30 | },
31 |
32 | transformer: {
33 | getTransformOptions: async () => ({
34 | transform: {
35 | experimentalImportSupport: false,
36 | inlineRequires: true,
37 | },
38 | }),
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-perspective-correction-image-view-example",
3 | "description": "Example app for react-native-perspective-correction-image-view",
4 | "version": "0.0.1",
5 | "private": true,
6 | "scripts": {
7 | "android": "react-native run-android",
8 | "ios": "react-native run-ios",
9 | "start": "react-native start"
10 | },
11 | "dependencies": {
12 | "react": "16.13.1",
13 | "react-native": "0.63.4"
14 | },
15 | "devDependencies": {
16 | "@babel/core": "^7.12.10",
17 | "@babel/runtime": "^7.12.5",
18 | "babel-plugin-module-resolver": "^4.0.0",
19 | "metro-react-native-babel-preset": "^0.64.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/example/src/App.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { StyleSheet, View, Text, Image } from 'react-native';
3 | import { PerspectiveCorrectionImage, CornerPoints } from 'react-native-perspective-correction-image-view';
4 |
5 | export default function App() {
6 | const sourceCorners: CornerPoints = [114, 80, 324, 46, 77, 203, 306, 252];
7 | const ref = React.createRef();
8 | return (
9 |
10 |
11 | Corner Points: [114, 80, 324, 46, 77, 203, 306, 252]
12 |
13 | Origianl Image
14 |
15 | Result Image
16 |
25 |
26 | );
27 | }
28 |
29 | const styles = StyleSheet.create({
30 | container: {
31 | flex: 1,
32 | alignItems: 'center',
33 | justifyContent: 'center',
34 | },
35 | text: {
36 | fontSize: 14,
37 | fontWeight: 'bold',
38 | marginBottom: 8,
39 | },
40 | });
41 |
--------------------------------------------------------------------------------
/example/src/sample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonskim/react-native-perspective-correction-image-view/a4e4272716f90edd4eb2fc4fc39d710baead6409/example/src/sample.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-perspective-correction-image-view",
3 | "version": "0.1.4",
4 | "description": "An image view component that corrects the distorted image with its corner points.",
5 | "main": "lib/commonjs/index",
6 | "module": "lib/module/index",
7 | "types": "lib/typescript/index.d.ts",
8 | "react-native": "src/index",
9 | "source": "src/index",
10 | "files": [
11 | "src",
12 | "lib",
13 | "android",
14 | "ios",
15 | "cpp",
16 | "react-native-perspective-correction-image-view.podspec",
17 | "!lib/typescript/example",
18 | "!android/build",
19 | "!ios/build",
20 | "!**/__tests__",
21 | "!**/__fixtures__",
22 | "!**/__mocks__"
23 | ],
24 | "scripts": {
25 | "test": "jest",
26 | "typescript": "tsc --noEmit",
27 | "lint": "eslint \"**/*.{js,ts,tsx}\"",
28 | "prepare": "bob build",
29 | "release": "release-it",
30 | "example": "yarn --cwd example",
31 | "pods": "cd example && pod-install --quiet",
32 | "bootstrap": "yarn example && yarn && yarn pods"
33 | },
34 | "keywords": [
35 | "react-native",
36 | "ios",
37 | "android"
38 | ],
39 | "repository": "https://github.com/leonskim/react-native-perspective-correction-image-view",
40 | "author": "Leon Kim (https://github.com/leonskim)",
41 | "license": "MIT",
42 | "bugs": {
43 | "url": "https://github.com/leonskim/react-native-perspective-correction-image-view/issues"
44 | },
45 | "homepage": "https://github.com/leonskim/react-native-perspective-correction-image-view#readme",
46 | "publishConfig": {
47 | "registry": "https://registry.npmjs.org/"
48 | },
49 | "devDependencies": {
50 | "@commitlint/config-conventional": "^11.0.0",
51 | "@react-native-community/eslint-config": "^2.0.0",
52 | "@release-it/conventional-changelog": "^2.0.0",
53 | "@types/jest": "^26.0.0",
54 | "@types/react": "^16.9.19",
55 | "@types/react-native": "^0.67.8",
56 | "commitlint": "^11.0.0",
57 | "eslint": "^7.2.0",
58 | "eslint-config-prettier": "^7.0.0",
59 | "eslint-plugin-prettier": "^3.1.3",
60 | "husky": "^6.0.0",
61 | "jest": "^26.0.1",
62 | "pod-install": "^0.1.0",
63 | "prettier": "^2.0.5",
64 | "react": "16.13.1",
65 | "react-native": "0.63.4",
66 | "react-native-builder-bob": "^0.18.0",
67 | "release-it": "^14.2.2",
68 | "typescript": "^4.1.3"
69 | },
70 | "peerDependencies": {
71 | "react": "*",
72 | "react-native": "*"
73 | },
74 | "jest": {
75 | "preset": "react-native",
76 | "modulePathIgnorePatterns": [
77 | "/example/node_modules",
78 | "/lib/"
79 | ]
80 | },
81 | "commitlint": {
82 | "extends": [
83 | "@commitlint/config-conventional"
84 | ]
85 | },
86 | "release-it": {
87 | "git": {
88 | "commitMessage": "chore: release ${version}",
89 | "tagName": "v${version}"
90 | },
91 | "npm": {
92 | "publish": true
93 | },
94 | "github": {
95 | "release": true
96 | },
97 | "plugins": {
98 | "@release-it/conventional-changelog": {
99 | "preset": "angular"
100 | }
101 | }
102 | },
103 | "eslintConfig": {
104 | "root": true,
105 | "extends": [
106 | "@react-native-community",
107 | "prettier"
108 | ],
109 | "rules": {
110 | "prettier/prettier": [
111 | "error",
112 | {
113 | "quoteProps": "consistent",
114 | "singleQuote": true,
115 | "tabWidth": 2,
116 | "trailingComma": "es5",
117 | "useTabs": false
118 | }
119 | ]
120 | }
121 | },
122 | "eslintIgnore": [
123 | "node_modules/",
124 | "lib/"
125 | ],
126 | "prettier": {
127 | "quoteProps": "consistent",
128 | "singleQuote": true,
129 | "tabWidth": 2,
130 | "trailingComma": "es5",
131 | "useTabs": false
132 | },
133 | "react-native-builder-bob": {
134 | "source": "src",
135 | "output": "lib",
136 | "targets": [
137 | "commonjs",
138 | "module",
139 | [
140 | "typescript",
141 | {
142 | "project": "tsconfig.build.json"
143 | }
144 | ]
145 | ]
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/scripts/bootstrap.js:
--------------------------------------------------------------------------------
1 | const os = require('os');
2 | const path = require('path');
3 | const child_process = require('child_process');
4 |
5 | const root = path.resolve(__dirname, '..');
6 | const args = process.argv.slice(2);
7 | const options = {
8 | cwd: process.cwd(),
9 | env: process.env,
10 | stdio: 'inherit',
11 | encoding: 'utf-8',
12 | };
13 |
14 | if (os.type() === 'Windows_NT') {
15 | options.shell = true
16 | }
17 |
18 | let result;
19 |
20 | if (process.cwd() !== root || args.length) {
21 | // We're not in the root of the project, or additional arguments were passed
22 | // In this case, forward the command to `yarn`
23 | result = child_process.spawnSync('yarn', args, options);
24 | } else {
25 | // If `yarn` is run without arguments, perform bootstrap
26 | result = child_process.spawnSync('yarn', ['bootstrap'], options);
27 | }
28 |
29 | process.exitCode = result.status;
30 |
--------------------------------------------------------------------------------
/src/__tests__/index.test.tsx:
--------------------------------------------------------------------------------
1 | it.todo('write a test');
2 |
--------------------------------------------------------------------------------
/src/getTransformMatrix.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * getTransformMatrix
3 | *
4 | * Originally it's from https://github.com/jlouthan/perspective-transform
5 | * However, it doesn't work well with TypeScript, we have brought it in and
6 | * assigned types to the params.
7 | *
8 | */
9 |
10 | // 4 corner points
11 | export type CornerPoints = [
12 | number, // x1
13 | number, // y1
14 | number, // x2
15 | number, // y2
16 | number, // x3
17 | number, // y3
18 | number, // x4
19 | number // y4
20 | ];
21 |
22 | export function getTransformMatrix(srcPts: CornerPoints, dstPts: CornerPoints) {
23 | var r1 = [
24 | srcPts[0],
25 | srcPts[1],
26 | 1,
27 | 0,
28 | 0,
29 | 0,
30 | -1 * dstPts[0] * srcPts[0],
31 | -1 * dstPts[0] * srcPts[1],
32 | ];
33 | var r2 = [
34 | 0,
35 | 0,
36 | 0,
37 | srcPts[0],
38 | srcPts[1],
39 | 1,
40 | -1 * dstPts[1] * srcPts[0],
41 | -1 * dstPts[1] * srcPts[1],
42 | ];
43 | var r3 = [
44 | srcPts[2],
45 | srcPts[3],
46 | 1,
47 | 0,
48 | 0,
49 | 0,
50 | -1 * dstPts[2] * srcPts[2],
51 | -1 * dstPts[2] * srcPts[3],
52 | ];
53 | var r4 = [
54 | 0,
55 | 0,
56 | 0,
57 | srcPts[2],
58 | srcPts[3],
59 | 1,
60 | -1 * dstPts[3] * srcPts[2],
61 | -1 * dstPts[3] * srcPts[3],
62 | ];
63 | var r5 = [
64 | srcPts[4],
65 | srcPts[5],
66 | 1,
67 | 0,
68 | 0,
69 | 0,
70 | -1 * dstPts[4] * srcPts[4],
71 | -1 * dstPts[4] * srcPts[5],
72 | ];
73 | var r6 = [
74 | 0,
75 | 0,
76 | 0,
77 | srcPts[4],
78 | srcPts[5],
79 | 1,
80 | -1 * dstPts[5] * srcPts[4],
81 | -1 * dstPts[5] * srcPts[5],
82 | ];
83 | var r7 = [
84 | srcPts[6],
85 | srcPts[7],
86 | 1,
87 | 0,
88 | 0,
89 | 0,
90 | -1 * dstPts[6] * srcPts[6],
91 | -1 * dstPts[6] * srcPts[7],
92 | ];
93 | var r8 = [
94 | 0,
95 | 0,
96 | 0,
97 | srcPts[6],
98 | srcPts[7],
99 | 1,
100 | -1 * dstPts[7] * srcPts[6],
101 | -1 * dstPts[7] * srcPts[7],
102 | ];
103 |
104 | var matA = [r1, r2, r3, r4, r5, r6, r7, r8];
105 | var matB = dstPts;
106 | var matC;
107 | try {
108 | matC = inv(dotMMsmall(transpose(matA), matA));
109 | } catch (e) {
110 | console.log(e);
111 | return [1, 0, 0, 0, 1, 0, 0, 0];
112 | }
113 |
114 | var matD = dotMMsmall(matC, transpose(matA));
115 | var matX = dotMV(matD, matB);
116 | for (var i = 0; i < matX.length; i++) {
117 | matX[i] = round(matX[i]);
118 | }
119 | matX[8] = 1;
120 |
121 | return matX;
122 | }
123 |
124 | function inv(a: number[][]) {
125 | var s = dim(a),
126 | abs = Math.abs,
127 | m = s[0],
128 | n = s[1];
129 | var A = clone(a),
130 | Ai,
131 | Aj;
132 | var I = identity(m),
133 | Ii,
134 | Ij;
135 | var i, j, k, x;
136 | for (j = 0; j < n; ++j) {
137 | var i0 = -1;
138 | var v0 = -1;
139 | for (i = j; i !== m; ++i) {
140 | k = abs(A[i][j]);
141 | if (k > v0) {
142 | i0 = i;
143 | v0 = k;
144 | }
145 | }
146 | Aj = A[i0];
147 | A[i0] = A[j];
148 | A[j] = Aj;
149 | Ij = I[i0];
150 | I[i0] = I[j];
151 | I[j] = Ij;
152 | x = Aj[j];
153 | for (k = j; k !== n; ++k) Aj[k] /= x;
154 | for (k = n - 1; k !== -1; --k) Ij[k] /= x;
155 | for (i = m - 1; i !== -1; --i) {
156 | if (i !== j) {
157 | Ai = A[i];
158 | Ii = I[i];
159 | x = Ai[j];
160 | for (k = j + 1; k !== n; ++k) Ai[k] -= Aj[k] * x;
161 | for (k = n - 1; k > 0; --k) {
162 | Ii[k] -= Ij[k] * x;
163 | --k;
164 | Ii[k] -= Ij[k] * x;
165 | }
166 | if (k === 0) Ii[0] -= Ij[0] * x;
167 | }
168 | }
169 | }
170 | return I;
171 | }
172 |
173 | function dotMMsmall(x: number[][], y: number[][]) {
174 | let i, j, k, p, q, r, ret, foo, bar: number[], woo, i0;
175 | p = x.length;
176 | q = y.length;
177 | r = y[0].length;
178 | ret = Array(p);
179 | for (i = p - 1; i >= 0; i--) {
180 | foo = Array(r);
181 | bar = x[i];
182 | for (k = r - 1; k >= 0; k--) {
183 | woo = bar[q - 1] * y[q - 1][k];
184 | for (j = q - 2; j >= 1; j -= 2) {
185 | i0 = j - 1;
186 | woo += bar[j] * y[j][k] + bar[i0] * y[i0][k];
187 | }
188 | if (j === 0) {
189 | woo += bar[0] * y[0][k];
190 | }
191 | foo[k] = woo;
192 | }
193 | ret[i] = foo;
194 | }
195 | return ret;
196 | }
197 |
198 | function transpose(x: number[][]) {
199 | var i,
200 | j,
201 | m = x.length,
202 | n = x[0].length,
203 | ret = Array(n),
204 | A0,
205 | A1,
206 | Bj;
207 | for (j = 0; j < n; j++) ret[j] = Array(m);
208 | for (i = m - 1; i >= 1; i -= 2) {
209 | A1 = x[i];
210 | A0 = x[i - 1];
211 | for (j = n - 1; j >= 1; --j) {
212 | Bj = ret[j];
213 | Bj[i] = A1[j];
214 | Bj[i - 1] = A0[j];
215 | --j;
216 | Bj = ret[j];
217 | Bj[i] = A1[j];
218 | Bj[i - 1] = A0[j];
219 | }
220 | if (j === 0) {
221 | Bj = ret[0];
222 | Bj[i] = A1[0];
223 | Bj[i - 1] = A0[0];
224 | }
225 | }
226 | if (i === 0) {
227 | A0 = x[0];
228 | for (j = n - 1; j >= 1; --j) {
229 | ret[j][0] = A0[j];
230 | --j;
231 | ret[j][0] = A0[j];
232 | }
233 | if (j === 0) {
234 | ret[0][0] = A0[0];
235 | }
236 | }
237 | return ret;
238 | }
239 |
240 | function dotMV(x: number[][], y: number[]) {
241 | var p = x.length,
242 | i;
243 | var ret = Array(p);
244 | for (i = p - 1; i >= 0; i--) {
245 | ret[i] = dotVV(x[i], y);
246 | }
247 | return ret;
248 | }
249 |
250 | function dotVV(x: number[], y: number[]) {
251 | var i,
252 | n = x.length,
253 | i1,
254 | ret = x[n - 1] * y[n - 1];
255 | for (i = n - 2; i >= 1; i -= 2) {
256 | i1 = i - 1;
257 | ret += x[i] * y[i] + x[i1] * y[i1];
258 | }
259 | if (i === 0) {
260 | ret += x[0] * y[0];
261 | }
262 | return ret;
263 | }
264 |
265 | function dim(x: number[][]) {
266 | var y;
267 | if (typeof x === 'object') {
268 | y = x[0];
269 | if (typeof y === 'object') {
270 | return [x.length, y.length];
271 | }
272 | return [x.length];
273 | }
274 | return [];
275 | }
276 |
277 | function _foreach2(x: any, s: number[], k: number, f: (p: any) => void) {
278 | if (k === s.length - 1) {
279 | return f(x);
280 | }
281 | var i;
282 | var n = s[k];
283 | var ret = Array(n);
284 | for (i = n - 1; i >= 0; i--) {
285 | ret[i] = _foreach2(x[i], s, k + 1, f);
286 | }
287 | return ret;
288 | }
289 |
290 | function cloneV(x: number[]) {
291 | var _n = x.length;
292 | var i;
293 | var ret = Array(_n);
294 | for (i = _n - 1; i !== -1; --i) {
295 | ret[i] = x[i];
296 | }
297 | return ret;
298 | }
299 |
300 | function clone(x: any) {
301 | if (typeof x !== 'object') return x;
302 | var V = cloneV;
303 | var s = dim(x);
304 | return _foreach2(x, s, 0, V);
305 | }
306 |
307 | function identity(n: number) {
308 | return diag(rep([n], 1));
309 | }
310 |
311 | function diag(d: number[]) {
312 | var i;
313 | var i1;
314 | var j;
315 | var n = d.length;
316 | var A = Array(n);
317 | var Ai;
318 | for (i = n - 1; i >= 0; i--) {
319 | Ai = Array(n);
320 | i1 = i + 2;
321 | for (j = n - 1; j >= i1; j -= 2) {
322 | Ai[j] = 0;
323 | Ai[j - 1] = 0;
324 | }
325 | if (j > i) {
326 | Ai[j] = 0;
327 | }
328 | Ai[i] = d[i];
329 | for (j = i - 1; j >= 1; j -= 2) {
330 | Ai[j] = 0;
331 | Ai[j - 1] = 0;
332 | }
333 | if (j === 0) {
334 | Ai[0] = 0;
335 | }
336 | A[i] = Ai;
337 | }
338 | return A;
339 | }
340 |
341 | function rep(s: number[], v: number, k?: number) {
342 | if (typeof k === 'undefined') {
343 | k = 0;
344 | }
345 | var n = s[k];
346 | var ret = Array(n);
347 | var i;
348 | if (k === s.length - 1) {
349 | for (i = n - 2; i >= 0; i -= 2) {
350 | ret[i + 1] = v;
351 | ret[i] = v;
352 | }
353 | if (i === -1) {
354 | ret[0] = v;
355 | }
356 | return ret;
357 | }
358 | for (i = n - 1; i >= 0; i--) {
359 | ret[i] = rep(s, v, k + 1);
360 | }
361 | return ret;
362 | }
363 |
364 | function round(num: number) {
365 | return Math.round(num * 10000000000) / 10000000000;
366 | }
367 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {
3 | View,
4 | ViewProps,
5 | Image,
6 | ImageSourcePropType,
7 | ColorValue,
8 | } from 'react-native';
9 | import {
10 | getTransformMatrix,
11 | CornerPoints as CornerPointsType,
12 | } from './getTransformMatrix';
13 |
14 | export type CornerPoints = CornerPointsType;
15 |
16 | interface PerspectiveCorrectionImageProps extends ViewProps {
17 | source: ImageSourcePropType;
18 | sourceCorners: CornerPoints;
19 | sourceWidth: number;
20 | sourceHeight: number;
21 | width: number;
22 | height: number;
23 | backgroundColor?: ColorValue;
24 | }
25 |
26 | export const PerspectiveCorrectionImage = React.forwardRef<
27 | View,
28 | PerspectiveCorrectionImageProps
29 | >(
30 | (
31 | {
32 | source,
33 | sourceCorners,
34 | sourceWidth,
35 | sourceHeight,
36 | width,
37 | height,
38 | backgroundColor,
39 | ...props
40 | }: PerspectiveCorrectionImageProps,
41 | ref?: React.ForwardedRef
42 | ) => {
43 | const targetCorners: CornerPoints = [
44 | 0,
45 | 0,
46 | width,
47 | 0,
48 | 0,
49 | height,
50 | width,
51 | height,
52 | ];
53 | const c = getTransformMatrix(sourceCorners, targetCorners);
54 |
55 | /*
56 | * Transform matrix order (4x4, transposed)
57 | *
58 | * 0, 3, x, 6,
59 | * 1, 4, x, 7,
60 | * x, x, x, x,
61 | * 2, 5, x, 8
62 | */
63 | const matrix = [
64 | c[0],
65 | c[3],
66 | 0,
67 | c[6],
68 | c[1],
69 | c[4],
70 | 0,
71 | c[7],
72 | 0,
73 | 0,
74 | 1,
75 | 0,
76 | c[2],
77 | c[5],
78 | 0,
79 | c[8],
80 | ];
81 |
82 | return (
83 |
93 |
107 |
108 | );
109 | }
110 | );
111 |
--------------------------------------------------------------------------------
/tsconfig.build.json:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "extends": "./tsconfig",
4 | "exclude": ["example"]
5 | }
6 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./",
4 | "paths": {
5 | "react-native-perspective-correction-image-view": ["./src/index"]
6 | },
7 | "allowUnreachableCode": false,
8 | "allowUnusedLabels": false,
9 | "esModuleInterop": true,
10 | "importsNotUsedAsValues": "error",
11 | "forceConsistentCasingInFileNames": true,
12 | "jsx": "react",
13 | "lib": ["esnext"],
14 | "module": "esnext",
15 | "moduleResolution": "node",
16 | "noFallthroughCasesInSwitch": true,
17 | "noImplicitReturns": true,
18 | "noImplicitUseStrict": false,
19 | "noStrictGenericChecks": false,
20 | "noUnusedLocals": true,
21 | "noUnusedParameters": true,
22 | "resolveJsonModule": true,
23 | "skipLibCheck": true,
24 | "strict": true,
25 | "target": "esnext"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------