Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/facemesh ios #3215

Draft
wants to merge 11 commits into
base: ucr
Choose a base branch
from
Draft
Binary file added .DS_Store
Binary file not shown.
Binary file added .github/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
url = https://github.com/mit-cml/closure-library.git
[submodule "appinventor/components-ios/SchemeKit/picrin"]
path = appinventor/schemekit/src/picrin
url = https://github.com/mit-cml/picrin.git
url = git@github.com:mit-cml/picrin.git
1 change: 1 addition & 0 deletions appinventor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ fastlane/test_output

iOSInjectionProject/
AICompanionApp.xcconfig

4 changes: 0 additions & 4 deletions appinventor/AICompanionApp.xcconfig.sample

This file was deleted.

3 changes: 2 additions & 1 deletion appinventor/AICompanionApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
TargetAttributes = {
06463EF71D95956800B23DCD = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = A35W4MM59Y;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all of these changes shouldn't have been added during github add, in a big project never do git add . . I know it's tedious but always do git add <individual files you want to add>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted. I'll be more careful with git add in the future.

LastSwiftMigration = 1100;
ProvisioningStyle = Manual;
};
Expand Down Expand Up @@ -836,7 +837,7 @@
INFOPLIST_FILE = aicompanionapp/src/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = edu.mit.appinventor.aicompanion3;
PRODUCT_BUNDLE_IDENTIFIER = "edu.mit.appinventor.aicomp-anion3";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "9c96ca04-1d70-4a2b-bb01-28f545b35d28";
PROVISIONING_PROFILE_SPECIFIER = "MIT App Inventor Production";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@
ReferencedContainer = "container:AICompanionApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "IDEPreferLogStreaming"
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
<AdditionalOption
key = "MallocStackLogging"
Expand Down
44 changes: 44 additions & 0 deletions appinventor/AIComponentKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@
22843757284F89DF00EC3133 /* AssetFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22843756284F89DF00EC3133 /* AssetFetcher.swift */; };
46E77D8E29DD6894002CCDFB /* ShowAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E77D8D29DD6894002CCDFB /* ShowAlert.swift */; };
5132E481C0B949ECDE06AE78 /* Pods_AIComponentKit_AIComponentKitTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FD2633D7266389EB43FF45F /* Pods_AIComponentKit_AIComponentKitTests.framework */; };
5F7ED1062C35C950004418C5 /* tf-converter.min.js in Resources */ = {isa = PBXBuildFile; fileRef = 5F7ED1002C35C94C004418C5 /* tf-converter.min.js */; };
5F7ED1072C35C950004418C5 /* app.js in Resources */ = {isa = PBXBuildFile; fileRef = 5F7ED1012C35C94D004418C5 /* app.js */; };
5F7ED1082C35C950004418C5 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 5F7ED1022C35C94E004418C5 /* index.html */; };
5F7ED1092C35C950004418C5 /* group1-shard1of1.bin in Resources */ = {isa = PBXBuildFile; fileRef = 5F7ED1032C35C94F004418C5 /* group1-shard1of1.bin */; };
5F7ED10A2C35C950004418C5 /* VERSIONS.txt in Resources */ = {isa = PBXBuildFile; fileRef = 5F7ED1042C35C94F004418C5 /* VERSIONS.txt */; };
5F7ED10B2C35C950004418C5 /* tf-core.min.js in Resources */ = {isa = PBXBuildFile; fileRef = 5F7ED1052C35C950004418C5 /* tf-core.min.js */; };
5F7ED10D2C35C987004418C5 /* facemesh.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F7ED10C2C35C987004418C5 /* facemesh.swift */; };
681D59052A84138A007B5DB5 /* FileScope.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681D59042A84138A007B5DB5 /* FileScope.swift */; };
681D59072A84139E007B5DB5 /* OptionList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681D59062A84139E007B5DB5 /* OptionList.swift */; };
703C389B22B059C6000EA56A /* UIBezierPath+EllipticalArc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 703C389A22B059C6000EA56A /* UIBezierPath+EllipticalArc.swift */; };
Expand Down Expand Up @@ -433,6 +440,13 @@
46E77D8D29DD6894002CCDFB /* ShowAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowAlert.swift; sourceTree = "<group>"; };
4FD2633D7266389EB43FF45F /* Pods_AIComponentKit_AIComponentKitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AIComponentKit_AIComponentKitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
58E89B4AF39EEFF895CBBDD1 /* Pods-AIComponentKit-AIComponentKitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AIComponentKit-AIComponentKitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AIComponentKit-AIComponentKitTests/Pods-AIComponentKit-AIComponentKitTests.release.xcconfig"; sourceTree = "<group>"; };
5F7ED1002C35C94C004418C5 /* tf-converter.min.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "tf-converter.min.js"; sourceTree = "<group>"; };
5F7ED1012C35C94D004418C5 /* app.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = app.js; sourceTree = "<group>"; };
5F7ED1022C35C94E004418C5 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = "<group>"; };
5F7ED1032C35C94F004418C5 /* group1-shard1of1.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = "group1-shard1of1.bin"; sourceTree = "<group>"; };
5F7ED1042C35C94F004418C5 /* VERSIONS.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSIONS.txt; sourceTree = "<group>"; };
5F7ED1052C35C950004418C5 /* tf-core.min.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "tf-core.min.js"; sourceTree = "<group>"; };
5F7ED10C2C35C987004418C5 /* facemesh.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = facemesh.swift; sourceTree = "<group>"; };
681D59042A84138A007B5DB5 /* FileScope.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileScope.swift; sourceTree = "<group>"; };
681D59062A84139E007B5DB5 /* OptionList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptionList.swift; sourceTree = "<group>"; };
685FE23350C9E159CA508795 /* Pods-AIComponentKitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AIComponentKitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AIComponentKitTests/Pods-AIComponentKitTests.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -590,6 +604,7 @@
0618A2851D8CF4EE0013A191 /* components-ios/src */ = {
isa = PBXGroup;
children = (
5F7ED0FF2C35C922004418C5 /* extensions */,
22843756284F89DF00EC3133 /* AssetFetcher.swift */,
06E59EA21D92C66B00C42804 /* components */,
DE962F6020ADCD58004AA45A /* resources */,
Expand Down Expand Up @@ -970,6 +985,28 @@
path = util;
sourceTree = "<group>";
};
5F7266182C754755009C3CAB /* assets */ = {
isa = PBXGroup;
children = (
5F7ED1012C35C94D004418C5 /* app.js */,
5F7ED1032C35C94F004418C5 /* group1-shard1of1.bin */,
5F7ED1022C35C94E004418C5 /* index.html */,
5F7ED1002C35C94C004418C5 /* tf-converter.min.js */,
5F7ED1052C35C950004418C5 /* tf-core.min.js */,
5F7ED1042C35C94F004418C5 /* VERSIONS.txt */,
);
path = assets;
sourceTree = "<group>";
};
5F7ED0FF2C35C922004418C5 /* extensions */ = {
isa = PBXGroup;
children = (
5F7266182C754755009C3CAB /* assets */,
5F7ED10C2C35C987004418C5 /* facemesh.swift */,
);
name = extensions;
sourceTree = "<group>";
};
681D59032A84137D007B5DB5 /* common */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1157,7 +1194,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5F7ED1082C35C950004418C5 /* index.html in Resources */,
5F7ED1092C35C950004418C5 /* group1-shard1of1.bin in Resources */,
DE6D5A0F20FEA8DA003B2C67 /* checked.svg in Resources */,
5F7ED10B2C35C950004418C5 /* tf-core.min.js in Resources */,
DE962F5F20ADCD2C004AA45A /* comodo_usrtrust.der in Resources */,
DE962F6420ADCDA0004AA45A /* pop_script in Resources */,
064E097E233BDBE400884FEF /* Media.xcassets in Resources */,
Expand All @@ -1166,6 +1206,8 @@
061DC7B4223C396000539213 /* classic_button.disabled.png in Resources */,
060395451F342ADE006D6E66 /* language-codes.plist in Resources */,
DE962F6620ADCDE0004AA45A /* sub_script in Resources */,
5F7ED1062C35C950004418C5 /* tf-converter.min.js in Resources */,
5F7ED1072C35C950004418C5 /* app.js in Resources */,
DE962F6220ADCD7D004AA45A /* append_script in Resources */,
060395461F342ADE006D6E66 /* iso3166_1_2_to_iso3166_1_3.plist in Resources */,
DE5CBD281FE36C8B00F5EDDE /* webviewer.js in Resources */,
Expand All @@ -1175,6 +1217,7 @@
061DC7B3223C396000539213 /* classic_button.pressed.png in Resources */,
DE6D5A0C20FE9E8D003B2C67 /* unchecked.svg in Resources */,
062B743B2BC06AD9002E221F /* PrivacyInfo.xcprivacy in Resources */,
5F7ED10A2C35C950004418C5 /* VERSIONS.txt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1317,6 +1360,7 @@
06C70BA92A8BB72800C6C78D /* ServiceAccountTokenProvider.swift in Sources */,
06C70BA82A8BB72800C6C78D /* ASN1.swift in Sources */,
068AA8191DE61D8E0011CC74 /* Application.swift in Sources */,
5F7ED10D2C35C987004418C5 /* facemesh.swift in Sources */,
DE033B4320179A9300544E5F /* PermissionHandler.swift in Sources */,
0633F362297D0B1400C3C3E9 /* Translator.swift in Sources */,
062300A81DCE409D0035E4A4 /* BluetoothClient.swift in Sources */,
Expand Down
44 changes: 40 additions & 4 deletions appinventor/components-ios/src/ImageSprite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ open class ImageSprite: Sprite {
fileprivate var _image = UIImage()
fileprivate var _width = kLengthPreferred
fileprivate var _height = kLengthPreferred

public override init(_ parent: ComponentContainer) {
super.init(parent)
Width = kLengthPreferred
Expand Down Expand Up @@ -39,13 +39,49 @@ open class ImageSprite: Sprite {
}
}
}

@objc open var Image: UIImage {
get {
return _image
}
}

@objc open func setMarkOrigin(_ originCoordinates: String) {
// parse u and v with originCoordinates interpreted in "(u, v)" format

let trimmed = originCoordinates.trimmingCharacters(in: CharacterSet(charactersIn: "()"))
let components = trimmed.split(separator: ",")

let doubleU = Double(components[0].trimmingCharacters(in: .whitespaces))
let doubleV = Double(components[1].trimmingCharacters(in: .whitespaces))
super.U = doubleU!
super.V = doubleV!

}

//for setOriginX

@objc open var setOriginX: Double {
get {
return super.U
}
set(u) {
super.U = u
}
}

//for setOriginY

@objc open var setOriginY: Double {
get {
return super.V
}
set(v) {
super.V = v
}
}


@objc open var Rotates: Bool {
get {
return _rotates
Expand All @@ -58,7 +94,7 @@ open class ImageSprite: Sprite {
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear out these minor changes and make the code consistent as possible

override open var Heading: CGFloat {
get {
return super.Heading
Expand All @@ -71,7 +107,7 @@ open class ImageSprite: Sprite {
}
}
}

override open var Width: Int32 {
get {
return _width
Expand Down
Loading