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

syntax = "proto2";

package mediapipe.tasks;

import "mediapipe/framework/calculator.proto";
import "mediapipe/gpu/gpu_origin.proto";

message TensorsToImageCalculatorOptions {
  extend mediapipe.CalculatorOptions {
    optional TensorsToImageCalculatorOptions ext = 511831156;
  }

  // For CONVENTIONAL mode for OpenGL, input image starts at bottom and needs
  // to be flipped vertically as tensors are expected to start at top.
  // (DEFAULT or unset interpreted as CONVENTIONAL.)
  optional mediapipe.GpuOrigin.Mode gpu_origin = 1;

  // Range of float values [min, max].
  // min, must be strictly less than max.
  message FloatRange {
    optional float min = 1;
    optional float max = 2;
  }

  // Range of uint values [min, max].
  // min, must be strictly less than max.
  message UIntRange {
    optional uint64 min = 1;
    optional uint64 max = 2;
  }

  // The input tensor element range/type image pixels are converted from.
  oneof range {
    FloatRange input_tensor_float_range = 2;
    UIntRange input_tensor_uint_range = 3;
  }
}
