// Copyright 2025 Adobe. All rights reserved.
// This file is licensed to you under the Apache License,
// Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
// or the MIT license (http://opensource.org/licenses/MIT),
// at your option.
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
// Unless required by applicable law or agreed to in writing,
// this software is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or
// implied. See the LICENSE-MIT and LICENSE-APACHE files for the
// specific language governing permissions and limitations under
// each license.
import { getNeonBinary } from "./binary.js";
export class Trustmark {
    constructor(trustmark) {
        this.trustmark = trustmark;
    }
    static newTrustmark(config) {
        return __awaiter(this, void 0, void 0, function* () {
            const trustmark = yield getNeonBinary().trustmarkNew(config);
            return new Trustmark(trustmark);
        });
    }
    encode(image, strength, watermark) {
        return __awaiter(this, void 0, void 0, function* () {
            return getNeonBinary().trustmarkEncode.call(this.trustmark, image, strength, watermark);
        });
    }
    decode(image) {
        return __awaiter(this, void 0, void 0, function* () {
            return getNeonBinary().trustmarkDecode.call(this.trustmark, image);
        });
    }
}
