1 #ifndef DALI_IMAGE_SAMPLER_H
2 #define DALI_IMAGE_SAMPLER_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/actors/sampling.h>
29 * ImageSampler represents a set of sampling settings that can be applied to a texture.
31 namespace ImageSampler
39 MAGNIFY_BIT_SHIFT = 4,
49 MASK_MINIFY_FILTER = 0x000F,
50 MASK_MAGNIFY_FILTER = 0x00F0,
51 MASK_UWRAP_MODE = 0x0F00,
52 MASK_VWRAP_MODE = 0xF000,
56 * Precalculate default sampler bitfield
60 DEFAULT_BITFIELD = (Dali::FilterMode::DEFAULT << MINIFY_BIT_SHIFT) | (Dali::FilterMode::DEFAULT << MAGNIFY_BIT_SHIFT) | (Dali::WrapMode::DEFAULT << UWRAP_BIT_SHIFT) | (Dali::WrapMode::DEFAULT << VWRAP_BIT_SHIFT)
64 * @brief Pack the filter mode into a bitfield.
66 * @param[in] minify The minification filter.
67 * @param[in] magnify The magnification filter.
68 * @return Return the packed bitfield.
70 unsigned int PackBitfield(FilterMode::Type minify, FilterMode::Type magnify, WrapMode::Type uWrap = WrapMode::DEFAULT, WrapMode::Type vWrap = WrapMode::DEFAULT);
73 * @brief Return the minification filter from a packed bitfield.
75 * @return Return the minification filter.
77 FilterMode::Type GetMinifyFilterMode(unsigned int bitfield);
80 * @brief Return the magnification filter from a packed bitfield.
82 * @return Return the magnification filter.
84 FilterMode::Type GetMagnifyFilterMode(unsigned int bitfield);
87 * @brief Return the wrap mode in x direction from a packed bitfield.
89 * @return Return the wrap mode.
91 WrapMode::Type GetUWrapMode(unsigned int bitfield);
94 * @brief Return the wrap mode in y direction from a packed bitfield.
96 * @return Return the wrap mode.
98 WrapMode::Type GetVWrapMode(unsigned int bitfield);
100 } // namespace ImageSampler
102 } // namespace Internal
106 #endif // DALI_IMAGE_SAMPLER_H