TSRSdk Class Reference

Inherits from NSObject
Declared in TSRSdk.h
TSRSdk.mm

Overview

TSRSdk is a class responsible for managing and verifying the license of the super-resolution SDK. The class provides methods for initializing the SDK with online license verification, and releasing the resources when the SDK is no longer needed. It also allows setting a custom logger for logging purposes.

Usage:

  1. Get an instance of TSRSdk using the getInstance method.
  2. Initialize the TSRSdk object with online license verification using the initWithAppId:sdkLicenseVerifyResultCallback:tsrLogger: methods.
  3. Perform super-resolution rendering using the TSRPass class.
  4. Release resources when the TSRSdk object is no longer needed by calling the reset method.

Example for online verification:


- (void)onTSRSdkLicenseVerifyResult:(TSRSdkLicenseStatus)status {
if (status == TSRSdkLicenseStatusAvailable) {
// Creating TSRPass for super-resolution rendering
} else {
// Do something when the verification of sdk's license failed.
}
}

// Init TSRSdk and verify the online license
[TSRSdk.getInstance initWithAppId:APPID sdkLicenseVerifyResultCallback:self tsrLogger:[[Logger alloc] init]];
// Release resources when the TSRSdk object is no longer needed.
[TSRSdk.getInstance reset];

– initWithAppId:sdkLicenseVerifyResultCallback:tsrLogger:

Initializes the TSRSdk with online license verification. This method only can be executed once before the reset is executed.

- (void)initWithAppId:(long)appId sdkLicenseVerifyResultCallback:(id<TSRSdkLicenseVerifyResultCallback>)sdkLicenseVerifyResultCallback tsrLogger:(id<TSRLogger>)tsrLogger

Parameters

appId

appId

sdkLicenseVerifyResultCallback

SdkLicenseVerifyResultCallback is an interface for handling the result of SDK license verification.

tsrLogger

Set a TSRLogger for the TSRSdk. The TSRLogger must not be null.

Discussion

Initializes the TSRSdk with online license verification. This method only can be executed once before the reset is executed.

Declared In

TSRSdk.h

– reset

Releases the resources associated with the TSRSdk instance.

This method should be called when the TSRSdk instance is no longer needed, to free up memory and other resources.

After calling this method, you must re-initialize the TSRSdk instance using the initWithAppId methods before using it again.

- (void)reset

Discussion

Releases the resources associated with the TSRSdk instance.

This method should be called when the TSRSdk instance is no longer needed, to free up memory and other resources.

After calling this method, you must re-initialize the TSRSdk instance using the initWithAppId methods before using it again.

Declared In

TSRSdk.h