// Copyright 2019 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.

syntax = "proto2";

package mediapipe.autoflip;

import "mediapipe/examples/desktop/autoflip/autoflip_messages.proto";
import "mediapipe/framework/calculator.proto";

// Next tag: 3
message SignalFusingCalculatorOptions {
  extend mediapipe.CalculatorOptions {
    optional SignalFusingCalculatorOptions ext = 280092372;
  }
  // Setting related to each type of signal this calculator could process.
  repeated SignalSettings signal_settings = 1;

  // Force a flush of the frame buffer after this number of frames.
  optional int32 max_scene_size = 2 [default = 600];
}

// Next tag: 6
message SignalSettings {
  // The type of signal these settings pertain to.
  optional SignalType type = 1;

  // Force a normalized incoming score to be re-normalized to within this range.
  // (set values to min:0 and max:1 for no change in the incoming score)
  // Values must be between 0-1, min must be less than max.
  //
  // Example of score adjustment:
  // Incoming OCR score: .7
  // Min OCR Score: .9
  // Max OCR Score: 1.0
  // --Result: .97
  optional float min_score = 2 [default = 0];
  optional float max_score = 3 [default = 1.0];

  // Is this signal required within the output cropped video?  If it is it will
  // be included or the video will be marked as failed to convert.
  optional bool is_required = 4 [default = false];

  // When used with ContentZoomingCalculator, this flag can be set indicating
  // that areas outside of these salient regions can be cropped from the frame.
  // When no salient regions have this flag set true, no zooming is performed.
  // When one or more salient regions have this flag set true, the max zoom
  // value will be used that keeps all “only_required” detections within view.
  // The ContentZoomingCalculator currently supports zooming by finding the size
  // of non-salient top/bottom borders regions and provides this information to
  // the SceneCroppingCalculator for reframing.
  optional bool only_required = 5 [default = false];
}
