This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CropperExample({ | |
image, | |
cropperRef, | |
isCroppingLocked, | |
setIsCroppingLocked, | |
setCroppingRatio, | |
setIsCropResettable, | |
}) { | |
return ( | |
<CropperView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Skia, | |
TileMode, | |
FilterMode, | |
MipmapMode, | |
} from '@shopify/react-native-skia' | |
export function renderLUTImage({ | |
baseImage, | |
lutImage, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
------------------------------------------------------------- | |
* decodeAsync → renders RAW to PNG using minimal processing | |
• applies BaselineExposure | |
• localToneMapAmount interpolated from measuredDR() | |
* extractPreview → extracts embedded JPEG preview, writes to tmp, returns {uri,width,height} | |
* CIRAW defaults: gamutMapping ON, lensCorrection ON, boostAmount 0, all noise‑reduction 0 | |
* isPreview flag maps to CIRAWFilter.isDraftModeEnabled | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AppState } from 'react-native' | |
import { useRef, useEffect } from 'react' | |
const App = () => { | |
const appState = useRef(AppState.currentState) | |
useEffect(() => { | |
const appStateSubscription = AppState.addEventListener( | |
'change', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Based on the work of Nicholas C. Zakas | |
* https://github.com/nzakas/computer-science-in-javascript/ | |
*/ | |
class Node { | |
constructor(value = null, left = null, right = null) { | |
this.value = value; | |
this.right = right; | |
this.left = left; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An ES6 utility function for finding the nth-max value in an array. | |
*/ | |
let nthMax = (array, nth = 1) => { | |
if(nth > (array.length - 1)) { | |
throw new Error('Nth max value exceeds array size'); | |
} | |
let newArr = array, | |
i = 0; |