# Path: android_env/components/utils.py
# def touch_position_to_pixel_position(
#     touch_position: np.ndarray,
#     width_height: Sequence[int],
# ) -> Tuple[int, int]:
# def transpose_pixels(frame: np.ndarray) -> np.ndarray:
# def orient_pixels(
#     frame: np.ndarray,
#     orientation: adb_pb2.AdbCall.Rotate.Orientation) -> np.ndarray:


from absl.testing import absltest
from absl.testing import parameterized
from android_env.components import utils
from android_env.proto import adb_pb2
import numpy as np
# coding=utf-8
# Copyright 2021 DeepMind Technologies Limited.
#
# 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.

"""Tests for android_env.components.utils."""



class UtilsTest(parameterized.TestCase):

  @parameterized.parameters(
      ([0.5, 0.5], [320, 480], (160, 240)),
      ([0.25, 0.75], [320, 480], (80, 360)),
      ([0.0, 0.0], [320, 480], (0, 0)),
      ([1.0, 1.0], [320, 480], (319, 479)),
      )
  def test_touch_position_to_pixel_position(
      self, touch_pos, width_height, pixel_pos):

# Path: android_env/components/utils.py
# def touch_position_to_pixel_position(
#     touch_position: np.ndarray,
#     width_height: Sequence[int],
# ) -> Tuple[int, int]:
# def transpose_pixels(frame: np.ndarray) -> np.ndarray:
# def orient_pixels(
#     frame: np.ndarray,
#     orientation: adb_pb2.AdbCall.Rotate.Orientation) -> np.ndarray:


# Path: android_env/components/utils_test.py
from absl.testing import absltest
from absl.testing import parameterized
from android_env.components import utils
from android_env.proto import adb_pb2
import numpy as np

# coding=utf-8
# Copyright 2021 DeepMind Technologies Limited.
#
# 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.

"""Tests for android_env.components.utils."""



class UtilsTest(parameterized.TestCase):

  @parameterized.parameters(
      ([0.5, 0.5], [320, 480], (160, 240)),
      ([0.25, 0.75], [320, 480], (80, 360)),
      ([0.0, 0.0], [320, 480], (0, 0)),
      ([1.0, 1.0], [320, 480], (319, 479)),
      )
  def test_touch_position_to_pixel_position(
      self, touch_pos, width_height, pixel_pos):

    self.assertEqual(utils.touch_position_to_pixel_position(