Loading...
Searching...
No Matches
axis_swap.cuh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023, NVIDIA CORPORATION.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <cuproj/detail/utility/cuda.hpp>
21
22namespace cuproj {
23
34template <typename Coordinate>
35struct axis_swap : operation<Coordinate> {
43 CUPROJ_HOST_DEVICE Coordinate operator()(Coordinate const& coord, direction) const
44 {
45 return Coordinate{coord.y, coord.x};
46 }
47};
48
53} // namespace cuproj
Base class for all transform operations.
Definition operation.cuh:63
direction
Enumerates the direction of a transform operation.
Definition operation.cuh:44
Axis swap operation: swap x and y coordinates.
Definition axis_swap.cuh:35
CUPROJ_HOST_DEVICE Coordinate operator()(Coordinate const &coord, direction) const
Swap x and y coordinates.
Definition axis_swap.cuh:43