@umituz/react-native-design-system 2.8.12 → 2.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/image/infrastructure/utils/ImageFilterUtils.ts +8 -9
- package/src/image/infrastructure/utils/MetadataExtractor.ts +4 -4
- package/src/image/infrastructure/utils/filters/{BasicFilters.ts → ColorAdjustmentFilters.ts} +10 -6
- package/src/image/infrastructure/utils/filters/{SpecialFilters.ts → StyleFilters.ts} +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.13",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, and onboarding utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -4,18 +4,17 @@
|
|
|
4
4
|
* Legacy wrapper for backward compatibility. Use specific filter classes directly.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { ColorAdjustmentFilters } from './filters/ColorAdjustmentFilters';
|
|
8
|
+
import { StyleFilters } from './filters/StyleFilters';
|
|
9
9
|
import { FilterHelpers } from './filters/FilterHelpers';
|
|
10
10
|
|
|
11
11
|
export class ImageFilterUtils {
|
|
12
|
-
static applyBrightness =
|
|
13
|
-
static applyContrast =
|
|
14
|
-
static applySaturation =
|
|
15
|
-
static applyVintage =
|
|
16
|
-
static applyBlur =
|
|
12
|
+
static applyBrightness = ColorAdjustmentFilters.applyBrightness;
|
|
13
|
+
static applyContrast = ColorAdjustmentFilters.applyContrast;
|
|
14
|
+
static applySaturation = ColorAdjustmentFilters.applySaturation;
|
|
15
|
+
static applyVintage = StyleFilters.applyVintage;
|
|
16
|
+
static applyBlur = StyleFilters.applyBlur;
|
|
17
17
|
static applyIntensity = FilterHelpers.applyIntensity;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
export { BasicFilters, SpecialFilters, FilterHelpers };
|
|
20
|
+
export { ColorAdjustmentFilters, StyleFilters, FilterHelpers };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { ImageErrorHandler } from './ImageErrorHandler';
|
|
8
8
|
|
|
9
9
|
export class MetadataExtractor {
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
static async getImageDimensions(_uri: string): Promise<{ width: number; height: number }> {
|
|
12
12
|
try {
|
|
13
13
|
// In a real implementation, we would use:
|
|
@@ -25,7 +25,7 @@ export class MetadataExtractor {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
static async getFileSize(_uri: string): Promise<number> {
|
|
30
30
|
try {
|
|
31
31
|
// In real implementation, use expo-file-system or similar
|
|
@@ -35,7 +35,7 @@ export class MetadataExtractor {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
static async extractExifData(_uri: string): Promise<any> {
|
|
40
40
|
try {
|
|
41
41
|
// Mock EXIF data extraction
|
|
@@ -54,7 +54,7 @@ export class MetadataExtractor {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
static async extractGPSData(_uri: string): Promise<{ latitude: number; longitude: number } | null> {
|
|
59
59
|
try {
|
|
60
60
|
// Mock GPS data extraction
|
package/src/image/infrastructure/utils/filters/{BasicFilters.ts → ColorAdjustmentFilters.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Infrastructure -
|
|
2
|
+
* Infrastructure - Color Adjustment Filters
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Brightness, contrast, and saturation adjustments
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export class
|
|
7
|
+
export class ColorAdjustmentFilters {
|
|
8
8
|
static applyBrightness(
|
|
9
9
|
data: Uint8ClampedArray,
|
|
10
10
|
brightness: number
|
|
@@ -29,9 +29,13 @@ export class BasicFilters {
|
|
|
29
29
|
const factor = (259 * (contrast * 2.55 + 255)) / (255 * (259 - contrast * 2.55));
|
|
30
30
|
|
|
31
31
|
for (let i = 0; i < result.length; i += 4) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const r = result[i] ?? 0;
|
|
33
|
+
const g = result[i + 1] ?? 0;
|
|
34
|
+
const b = result[i + 2] ?? 0;
|
|
35
|
+
|
|
36
|
+
result[i] = Math.min(255, Math.max(0, factor * (r - 128) + 128));
|
|
37
|
+
result[i + 1] = Math.min(255, Math.max(0, factor * (g - 128) + 128));
|
|
38
|
+
result[i + 2] = Math.min(255, Math.max(0, factor * (b - 128) + 128));
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
return result;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Infrastructure -
|
|
2
|
+
* Infrastructure - Style Filters
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Vintage and blur effects
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export class
|
|
7
|
+
export class StyleFilters {
|
|
8
8
|
static applyVintage(
|
|
9
9
|
data: Uint8ClampedArray,
|
|
10
10
|
intensity: number,
|