1 #ifndef __DALI_IMAGE_SAMPLER_H__
2 #define __DALI_IMAGE_SAMPLER_H__
5 * Copyright (c) 2014 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>
31 * ImageSampler represents a set of sampling settings that can be applied to a texture.
33 namespace ImageSampler
41 MAGNIFY_BIT_SHIFT = 4,
51 MASK_MINIFY_FILTER = 0x000F,
52 MASK_MAGNIFY_FILTER = 0x00F0,
53 MASK_UWRAP_MODE = 0x0F00,
54 MASK_VWRAP_MODE = 0xF000,
58 * Precalculate default sampler bitfield
62 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)
66 * @brief Pack the filter mode into a bitfield.
68 * @param[in] minify The minification filter.
69 * @param[in] magnify The magnification filter.
70 * @return Return the packed bitfield.
72 unsigned int PackBitfield( FilterMode::Type minify, FilterMode::Type magnify, WrapMode::Type uWrap = WrapMode::DEFAULT, WrapMode::Type vWrap = WrapMode::DEFAULT );
75 * @brief Return the minification filter from a packed bitfield.
77 * @return Return the minification filter.
79 FilterMode::Type GetMinifyFilterMode( unsigned int bitfield );
82 * @brief Return the magnification filter from a packed bitfield.
84 * @return Return the magnification filter.
86 FilterMode::Type GetMagnifyFilterMode( unsigned int bitfield );
89 * @brief Return the wrap mode in x direction from a packed bitfield.
91 * @return Return the wrap mode.
93 WrapMode::Type GetUWrapMode( unsigned int bitfield );
96 * @brief Return the wrap mode in y direction from a packed bitfield.
98 * @return Return the wrap mode.
100 WrapMode::Type GetVWrapMode( unsigned int bitfield );
102 } // namespace ImageSampler
104 } // namespace Internal
109 #endif // __DALI_INTERNAL_IMAGE_SAMPLER_H__