Added MPPConnection

This commit is contained in:
Prianka Liz Kariat 2023-05-31 20:43:24 +05:30
parent 71f2f8f43b
commit ad499c170a
3 changed files with 78 additions and 0 deletions

View File

@ -60,3 +60,9 @@ objc_library(
srcs = ["sources/MPPLandmark.m"], srcs = ["sources/MPPLandmark.m"],
hdrs = ["sources/MPPLandmark.h"], hdrs = ["sources/MPPLandmark.h"],
) )
objc_library(
name = "MPPConnection",
srcs = ["sources/MPPConnection.m"],
hdrs = ["sources/MPPConnection.h"],
)

View File

@ -0,0 +1,44 @@
// Copyright 2023 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/** The value class representing a landmark connection. */
NS_SWIFT_NAME(Connection)
@interface MPPConnection : NSObject
@property(nonatomic, readonly) NSInteger start;
@property(nonatomic, readonly) NSInteger end;
/**
* Initializes a new `MPPConnection` with the start and end landmarks integer constants.
*
* @param start The integer representing the starting landmark of the connection.
* @param end The integer representing the ending landmark of the connection.
*
* @return An instance of `MPPConnection` initialized with the given start and end landmarks integer
* constants.
*/
- (instancetype)initWithStart:(NSInteger)star end:(NSInteger)end NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,28 @@
// Copyright 2023 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import "mediapipe/tasks/ios/components/containers/sources/MPPConnection.h"
@implementation MPPConnection
- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end {
self = [super init];
if (self) {
_start = start;
_end = end;
}
return self;
}
@end