1- import { Img } from '@nativescript-community/ui-image' ;
1+ import { Img , registerPluginGetContextFromOptions } from '@nativescript-community/ui-image' ;
22import { applyMixins , colorMatrixProperty , cssProperty } from './index-common' ;
3- import { registerPluginGetContextFromOptions } from '@nativescript-community/ui-image' ;
43
54declare module '@nativescript-community/ui-image' {
65 interface Img {
@@ -12,8 +11,7 @@ declare module '@nativescript-community/ui-image' {
1211
1312const FloatConstructor = interop . sizeof ( interop . types . id ) === 4 ? Float32Array : Float64Array ;
1413
15-
16- function filterFromMatrix ( matrix : number [ ] , ciFilter :CIFilter = CIFilter . filterWithName ( 'CIColorMatrix' ) ) {
14+ function filterFromMatrix ( matrix : number [ ] , ciFilter : CIFilter = CIFilter . filterWithName ( 'CIColorMatrix' ) ) {
1715 ciFilter . setValueForKey ( CIVector . vectorWithValuesCount ( new FloatConstructor ( matrix . slice ( 0 , 4 ) ) . buffer as any , 4 ) , 'inputRVector' ) ;
1816 ciFilter . setValueForKey ( CIVector . vectorWithValuesCount ( new FloatConstructor ( matrix . slice ( 5 , 9 ) ) . buffer as any , 4 ) , 'inputGVector' ) ;
1917 ciFilter . setValueForKey ( CIVector . vectorWithValuesCount ( new FloatConstructor ( matrix . slice ( 10 , 14 ) ) . buffer as any , 4 ) , 'inputBVector' ) ;
@@ -22,11 +20,11 @@ function filterFromMatrix(matrix: number[], ciFilter:CIFilter = CIFilter.filterW
2220 ciFilter . setName ( JSON . stringify ( matrix ) ) ;
2321}
2422registerPluginGetContextFromOptions ( ( context , transformers , options : Partial < Img > ) => {
25- const ciFilter = options . mCIFilter ?? ( options . colorMatrix ? filterFromMatrix ( options . colorMatrix ) : undefined ) ;
23+ const ciFilter = options . mCIFilter ?? ( options . colorMatrix ? filterFromMatrix ( options . colorMatrix ) : undefined ) ;
2624 if ( ciFilter ) {
2725 transformers . push ( SDImageFilterTransformer . transformerWithFilter ( ciFilter ) ) ;
2826 }
29- } )
27+ } ) ;
3028
3129class ImgExtended {
3230 nativeImageViewProtected : SDAnimatedImageView | UIImageView ;
0 commit comments