x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
dynamic_at_c.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\gil\extension\dynamic_image\dynamic_at_c.hpp
旋转
特效
属性
历史版本
/* Copyright 2005-2007 Adobe Systems Incorporated Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). See http://opensource.adobe.com/gil for most recent version including documentation. */ /*************************************************************************************************/ #ifndef GIL_DYNAMIC_AT_C_HPP #define GIL_DYNAMIC_AT_C_HPP #include "../../gil_config.hpp" #include
#include
#include
#include
//////////////////////////////////////////////////////////////////////////////////////// /// \file /// \brief Constructs for static-to-dynamic integer convesion /// \author Lubomir Bourdev and Hailin Jin \n /// Adobe Systems Incorporated /// \date 2005-2007 \n Last updated on May 4, 2006 /// //////////////////////////////////////////////////////////////////////////////////////// namespace boost { namespace gil { #define GIL_AT_C_VALUE(z, N, text) mpl::at_c
::type::value, #define GIL_DYNAMIC_AT_C_LIMIT 226 // size of the maximum vector to handle #define GIL_AT_C_LOOKUP(z, NUM, text) \ template
\ struct at_c_fn
{ \ template
inline \ static ValueType apply(std::size_t index) { \ static ValueType table[] = { \ BOOST_PP_REPEAT(NUM, GIL_AT_C_VALUE, BOOST_PP_EMPTY) \ }; \ return table[index]; \ } \ }; namespace detail { namespace at_c { template
struct at_c_fn; BOOST_PP_REPEAT(GIL_DYNAMIC_AT_C_LIMIT, GIL_AT_C_LOOKUP, BOOST_PP_EMPTY) template
struct at_c_impl; template <> struct at_c_impl<0> { template
inline static ValueType apply(std::size_t index) { return at_c_fn<0,mpl::size
::value>::template apply
(index); } }; template <> struct at_c_impl<1> { template
inline static ValueType apply(std::size_t index) { const std::size_t SIZE=mpl::size
::value; const std::size_t REM = SIZE % GIL_DYNAMIC_AT_C_LIMIT; switch (index / GIL_DYNAMIC_AT_C_LIMIT) { case 0: return at_c_fn<0 ,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply
(index); case 1: return at_c_fn
::template apply
(index - GIL_DYNAMIC_AT_C_LIMIT); }; throw; } }; template <> struct at_c_impl<2> { template
inline static ValueType apply(std::size_t index) { const std::size_t SIZE=mpl::size
::value; const std::size_t REM = SIZE % GIL_DYNAMIC_AT_C_LIMIT; switch (index / GIL_DYNAMIC_AT_C_LIMIT) { case 0: return at_c_fn<0 ,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply
(index); case 1: return at_c_fn
::template apply
(index - GIL_DYNAMIC_AT_C_LIMIT); case 2: return at_c_fn
::template apply
(index - GIL_DYNAMIC_AT_C_LIMIT*2); }; throw; } }; template <> struct at_c_impl<3> { template
inline static ValueType apply(std::size_t index) { const std::size_t SIZE=mpl::size
::value; const std::size_t REM = SIZE % GIL_DYNAMIC_AT_C_LIMIT; switch (index / GIL_DYNAMIC_AT_C_LIMIT) { case 0: return at_c_fn<0 ,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply
(index); case 1: return at_c_fn
::template apply
(index - GIL_DYNAMIC_AT_C_LIMIT); case 2: return at_c_fn
::template apply
(index - GIL_DYNAMIC_AT_C_LIMIT*2); case 3: return at_c_fn
::template apply
(index - GIL_DYNAMIC_AT_C_LIMIT*3); }; throw; } }; } } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Given an MPL Random Access Sequence and a dynamic index n, returns the value of the n-th element /// It constructs a lookup table at compile time /// //////////////////////////////////////////////////////////////////////////////////// template
inline ValueType at_c(std::size_t index) { const std::size_t Size=mpl::size
::value; return detail::at_c::at_c_impl
::template apply
(index); } #undef GIL_AT_C_VALUE #undef GIL_DYNAMIC_AT_C_LIMIT #undef GIL_AT_C_LOOKUP } } // namespace boost::gil #endif
dynamic_at_c.hpp
网页地址
文件地址
上一页
6/10
下一页
下载
( 5 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.