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

// Models to describe color transform between adjacent frames.
// Color transform are always specified for 3 channels (RGB).

syntax = "proto2";

package mediapipe;

// Transforms a 3D color vector x = (c1, c2, c3) according to
//  [ gain_c1    0      0      bias_c1       *   [ c1
//    0       gain_c2   0      bias_c2             c2
//    0          0    gain_c3  bias_c3 ]           c3
//                                                  1 ]
message GainBiasModel {
  optional float gain_c1 = 1 [default = 1.0];
  optional float bias_c1 = 2 [default = 0.0];
  optional float gain_c2 = 3 [default = 1.0];
  optional float bias_c2 = 4 [default = 0.0];
  optional float gain_c3 = 5 [default = 1.0];
  optional float bias_c3 = 6 [default = 0.0];
}

message MixtureGainBiasModel {
  repeated GainBiasModel model = 1;
}

// Transforms a 3D color vector x = (c1, c2, c3) according to
//  [ g_00    g_01      g_02      g_03       *   [ c1
//    g_10    g_11      g_12      g_13             c2
//    g_20    g_21      g_22      g_23 ]           c3
//                                                 1 ]
message AffineToneModel {
  optional float g_00 = 1 [default = 1.0];
  optional float g_01 = 2 [default = 0.0];
  optional float g_02 = 3 [default = 0.0];
  optional float g_03 = 4 [default = 0.0];

  optional float g_10 = 5 [default = 0.0];
  optional float g_11 = 6 [default = 1.0];
  optional float g_12 = 7 [default = 0.0];
  optional float g_13 = 8 [default = 0.0];

  optional float g_20 = 9 [default = 0.0];
  optional float g_21 = 10 [default = 0.0];
  optional float g_22 = 11 [default = 1.0];
  optional float g_23 = 12 [default = 0.0];
}

message MixtureAffineToneModel {
  repeated AffineToneModel model = 1;
}
