mediapipe/mediapipe/calculators/image/image_transformation_calculator.proto
2023-02-18 16:58:56 -08:00

58 lines
2.1 KiB
Protocol Buffer

// 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;
import "mediapipe/calculators/image/rotation_mode.proto";
import "mediapipe/framework/calculator.proto";
import "mediapipe/gpu/scale_mode.proto";
option java_package = "com.google.mediapipe.calculator.proto";
option java_outer_classname = "ImageTransformationCalculatorOptionsProto";
message ImageTransformationCalculatorOptions {
extend CalculatorOptions {
optional ImageTransformationCalculatorOptions ext = 251952830;
}
// RGB values in range of 0 - 255
message Color {
optional int32 red = 1 [default = 0];
optional int32 green = 2 [default = 0];
optional int32 blue = 3 [default = 0];
}
// Output dimensions. Set to 0 if they should be the same as the input.
optional int32 output_width = 1 [default = 0];
optional int32 output_height = 2 [default = 0];
// Counterclockwise rotation mode.
optional RotationMode.Mode rotation_mode = 3;
// Vertical flipping, applied after rotation.
optional bool flip_vertically = 4 [default = false];
// Horizontal flipping, applied after rotation.
optional bool flip_horizontally = 5 [default = false];
// Scale mode.
optional ScaleMode.Mode scale_mode = 6;
// Padding type. This option is only used when the scale mode is FIT.
// Default is to use BORDER_CONSTANT. If set to false, it will use
// BORDER_REPLICATE instead.
optional bool constant_padding = 7 [default = true];
// The color for the padding. This option is only used when the scale mode is
// FIT. Default is black. This is for CPU only.
optional Color padding_color = 8;
}