// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2014 Benoit Steiner <[email protected]> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_CXX11_TENSOR_TENSOR_IMAGE_PATCH_H #define EIGEN_CXX11_TENSOR_TENSOR_IMAGE_PATCH_H // IWYU pragma: private #include "./InternalHeaderCheck.h" namespace Eigen { /** \class TensorImagePatch * \ingroup CXX11_Tensor_Module * * \brief Patch extraction specialized for image processing. * This assumes that the input has a least 3 dimensions ordered as follow: * 1st dimension: channels (of size d) * 2nd dimension: rows (of size r) * 3rd dimension: columns (of size c) * There can be additional dimensions such as time (for video) or batch (for * bulk processing after the first 3. * Calling the image patch code with patch_rows and patch_cols is equivalent * to calling the regular patch extraction code with parameters d, patch_rows, * patch_cols, and 1 for all the additional dimensions. */ namespace internal { traits<TensorImagePatchOp<Rows, Cols, XprType>>; eval<TensorImagePatchOp<Rows, Cols, XprType>, Eigen::Dense>; nested<TensorImagePatchOp<Rows, Cols, XprType>, 1, typename eval<TensorImagePatchOp<Rows, Cols, XprType>>::type>; template <typename Self, bool Vectorizable> struct ImagePatchCopyOp { … }; ImagePatchCopyOp<Self, true>; template <typename Self> struct ImagePatchPaddingOp { … }; } // end namespace internal template <DenseIndex Rows, DenseIndex Cols, typename XprType> class TensorImagePatchOp : public TensorBase<TensorImagePatchOp<Rows, Cols, XprType>, ReadOnlyAccessors> { … }; // Eval as rvalue TensorEvaluator<const TensorImagePatchOp<Rows, Cols, ArgType>, Device>; } // end namespace Eigen #endif // EIGEN_CXX11_TENSOR_TENSOR_IMAGE_PATCH_H