亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? region_dim.h

?? 彩信瀏覽器
?? H
字號:
/* * This file is part of Ambulant Player, www.ambulantplayer.org. * * Copyright (C) 2003-2007 Stichting CWI,  * Kruislaan 413, 1098 SJ Amsterdam, The Netherlands. * * Ambulant Player is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * Ambulant Player is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Ambulant Player; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA *//*  * @$Id: region_dim.h,v 1.23 2007/02/12 14:14:09 jackjansen Exp $  */#ifndef AMBULANT_COMMON_REGION_DIM_H#define AMBULANT_COMMON_REGION_DIM_H#include "ambulant/config/config.h"#include "ambulant/lib/gtypes.h"// std::runtime_error#include <stdexcept>// floor#include <math.h>namespace ambulant {namespace common {using namespace lib;/// A representation for a region dimension.////// The respresentation implemented is capable of/// representing auto, absolute or relative coordinates.////// Objects of this class may be used to permanently hold/// the dimensions of a region (as they are specified in the /// original document or by the animated one)./// Conversions to absolute coordinates should be done/// only dynamically, and as late as possible./// An entity having access to the whole layout tree/// (animated or not) should be responsible for all /// on the fly conversions.////// For simplicity we assume that all absolute coordinates/// have been converted to uniform units.class region_dim {  	/// A type holding either an int (for absolute values) or double (for relative values).	union dim_value_holder_t {		int int_val;		double dbl_val;	};	  public:	//////////////////////	// region_dim constructors		/// Default constructor,	// constructs an auto region_dim.	region_dim()	:	m_type(rdt_auto) { m_holder.dbl_val = 0;}    	/// Constructs an absolute dim (assumed in pixels).    region_dim(int value)    :	m_type(rdt_absolute) { m_holder.int_val = value;}		/// Constructs a relative dim (proportion or percent).    region_dim(double value)    :	m_type(rdt_relative) { m_holder.dbl_val = value;}		// Constructs a region_dim from another region_dim.    region_dim(const region_dim& other)    :	m_type(other.m_type) {		if(other.absolute())			m_holder.int_val = other.get_as_int();		else if(other.relative()) 			m_holder.dbl_val = other.get_as_dbl();   }      	/// constructs a region_dim from the provided string.	/// Does very little error checking.	region_dim(const std::string& s) 	:	m_type(rdt_auto) {		m_holder.dbl_val = 0;		if(s.empty()) return;			char *endptr;		int ivalue = strtol(s.c_str(), &endptr, 10);		if(*endptr == '\0' || strcmp(endptr, "px") == 0) {			m_holder.int_val = ivalue;			m_type = rdt_absolute;		} else if (*endptr == '%') {			m_holder.dbl_val = ivalue / 100.0;			m_type = rdt_relative;		} 	}     	//////////////////////	// region_dim destructor	    ~region_dim(){}    	//////////////////////	// region_dim assignments (construct from existing)		/// Sets this to other.    const region_dim& operator=(const region_dim& other) { 		if(&other != this) {			m_type = other.m_type;			m_holder = other.m_holder;		}		return *this;    }    	/// Sets this to the absolute value provided.    const region_dim& operator=(int value) { 		m_type = rdt_absolute;		m_holder.int_val = value;		return *this;    }    	/// Sets this to the relative value provided.    const region_dim& operator=(double value) { 		m_type = rdt_relative;		m_holder.dbl_val = value;		return *this;    }   	//////////////////////	// type queries		/// Return true if this region_dim is relative.	bool relative() const { return m_type == rdt_relative;}		/// Return true if this region_dim is absolute.	bool absolute() const { return m_type == rdt_absolute;}		/// Return true if this region_dim is not auto.	bool defined() const { return m_type != rdt_auto;}		/// Return true if this region_dim is auto.	bool isauto() const { return m_type == rdt_auto;}		/// Get value as absolute integer (or abort).	int get_as_int() const { 		if(absolute()) return m_holder.int_val; #ifndef AMBULANT_PLATFORM_WIN32_WCE_3		throw std::runtime_error("Illegal call. Region dim is not absolute");#else		abort();#endif		return 0;	}		/// Get value as relative double (or abort).	double get_as_dbl() const { 		if(relative()) return m_holder.dbl_val;#ifndef AMBULANT_PLATFORM_WIN32_WCE_3		throw std::runtime_error("Illegal call. Region dim is not relative");#else		abort();#endif		return 0;	}		/// Get value as absolute int.	/// Relative values are interpreted with respect to ref,	/// auto values will abort.	int get(int ref) const {		switch(m_type) {			case rdt_absolute: return get_as_int();			case rdt_relative: return int(floor(ref*get_as_dbl() + 0.5));			case rdt_auto: break;		}#ifndef AMBULANT_PLATFORM_WIN32_WCE_3		throw std::runtime_error("Illegal call. Region dim is undefined");#else		abort();		return 0;#endif	}		/// Return true if two region_dim objects are identical.	bool operator== (const region_dim& other) const {		if (m_type != other.m_type) return false;		if (m_type == rdt_absolute) return m_holder.int_val == other.m_holder.int_val;		if (m_type == rdt_relative) return m_holder.dbl_val == other.m_holder.dbl_val;		return true;	}	bool operator!= (const region_dim& other) const { return !(*this == other); }			region_dim& operator+=(const region_dim& rhs) {		assert(m_type == rhs.m_type);		if(absolute())			m_holder.int_val += rhs.get_as_int();		else if(relative()) 			m_holder.dbl_val += rhs.get_as_dbl();		return *this;	}		region_dim& operator-=(const region_dim& rhs) {		assert(m_type == rhs.m_type);		if(absolute())			m_holder.int_val -= rhs.get_as_int();		else if(relative()) 			m_holder.dbl_val -= rhs.get_as_dbl();		return *this;	}		region_dim& operator*=(int n) {		if(absolute())			m_holder.int_val *= n;		else if(relative()) 			m_holder.dbl_val *= n;		return *this;	}		region_dim& operator/=(int n) {		if(absolute())			m_holder.int_val /= n;		else if(relative()) 			m_holder.dbl_val /= n;		return *this;	}		region_dim operator+(const region_dim& rhs) const { region_dim t(*this); t+=rhs; return t;}		region_dim operator-(const region_dim& rhs) const { region_dim t(*this); t-=rhs; return t;}			region_dim operator*(int n) const { region_dim t(*this); t*=n; return t;}		region_dim operator/(int n) const { region_dim t(*this); t/=n; return t;}		// define comparisons	bool operator<(const region_dim& rhs) const {		if(isauto()) return true;		return  absolute()?(m_holder.dbl_val<rhs.m_holder.dbl_val):			m_holder.int_val<rhs.m_holder.int_val;}	bool operator<=(const region_dim& rhs) const {		if(isauto()) return true;		return  absolute()?m_holder.dbl_val<= rhs.m_holder.dbl_val:			m_holder.int_val<=rhs.m_holder.int_val;}	bool operator>(const region_dim& rhs) const {		if(isauto()) return true;		return  absolute()?(m_holder.dbl_val>rhs.m_holder.dbl_val):			m_holder.int_val>rhs.m_holder.int_val;}	bool operator>=(const region_dim& rhs) const {		if(isauto()) return true;		return  absolute()?m_holder.dbl_val>=rhs.m_holder.dbl_val:			m_holder.int_val>=rhs.m_holder.int_val;}  private: 	// region dimension types	enum region_dim_type {rdt_auto, rdt_relative, rdt_absolute};		// region dimension data	region_dim_type m_type;	dim_value_holder_t m_holder;};/// A structure holding all layout attributes of a SMIL region.struct region_dim_spec {	/// The 6 possible layout attributes.	region_dim left, width, right, top, height, bottom;		/// Default constructor, sets all values to auto.	region_dim_spec() {}		/// Constructor using SMIL anchor coords string.	/// For non-rectangular coords values this will set the region_dim_spec	/// to the bounding box for the shape.	region_dim_spec(const std::string& coords, const char *shape = 0);		bool operator== (region_dim_spec& other) const {		return left==other.left && width==other.width && right==other.right		    && top == other.top && height==other.height && bottom==other.bottom;	}	bool operator!= (region_dim_spec& other) const { return !(*this == other); }		/// Convert all relative parameters to absolute.	void convert(const lib::rect& rc);};// Sets the region dimensions from the bounding box specified by the coords attributeinline region_dim_spec::region_dim_spec(const std::string& coords, const char *shape) {	if(coords.empty()) return;	std::list<std::string> list;	lib::split_trim_list(coords, list, ',');	std::list<std::string>::iterator it = list.begin();	if((!shape || (shape && strcmp(shape, "rect")==0)) && list.size() == 4) {		left = region_dim(*it++);		top = region_dim(*it++);		width = region_dim(*it++) - left;		height = region_dim(*it++) - top;	} else if((shape && strcmp(shape, "circle")==0) && list.size() == 3) {		region_dim x(*it++);		region_dim y(*it++);		region_dim r(*it++);		left = x-r;		top = y-r;		width = r+r;		height = width;	} else if((shape && strcmp(shape, "poly")==0) && list.size() >= 6 && (list.size() % 2) == 0) {		region_dim l, t, r, b;		while(it!=list.end()) {			region_dim x(*it++);			l = std::min<region_dim>(l, x);			r = std::max<region_dim>(r, x);			region_dim y(*it++);			t = std::min<region_dim>(t, y);			b = std::max<region_dim>(b, y);		}		left = l;		top = t;		width = r-l;		height = b-t;	} }// Converts those coordinates that are relative to absolute inline void region_dim_spec::convert(const lib::rect& rc) {	int w = rc.width(), h = rc.height();		if(!left.isauto()) left = left.get(w);	if(!right.isauto()) right = right.get(w);	if(!width.isauto()) width = width.get(w);		if(!top.isauto()) top = top.get(h);	if(!bottom.isauto()) bottom = bottom.get(h);	if(!height.isauto()) height = height.get(h);}/// A structure holding attributes of a SMIL regPoint or regAlign./// A region node may hold along its other attributes this data structure.struct regpoint_spec {	/// The two coordinates.	region_dim left, top;		/// Default constructor initializes everything to auto.	regpoint_spec() {}		/// Specific constructor giving percentage values.	regpoint_spec(double hor, double vert)	:   left(hor),		top(vert) {}		bool operator== (regpoint_spec& other) const {		return left==other.left  && top == other.top;	}		bool operator!= (regpoint_spec& other) const { return !(*this == other); }};} // namespace common } // namespace ambulantinline std::string repr(const ambulant::common::region_dim& rd) {	char sz[16] = "<auto>";	if(rd.relative())		sprintf(sz, "%d%c", int(floor(0.5+rd.get_as_dbl() * 100.0)), '%');	else if(rd.absolute())		sprintf(sz, "%d", rd.get_as_int());	return sz;}///////////////////////////////#ifndef AMBULANT_NO_IOSTREAMS_HEADERS// std::ostream for debug output#ifndef AMBULANT_NO_OSTREAM#include <ostream>#else /*AMBULANT_NO_OSTREAM*/#include <ostream.h>#endif/*AMBULANT_NO_OSTREAM*/#endif // AMBULANT_NO_IOSTREAMS_HEADERS///////////////////////////////#ifndef AMBULANT_NO_OSTREAM// debug region_dim print outinline std::ostream& operator<<(std::ostream& os, const ambulant::common::region_dim& rd) { 	if(rd.relative())		return os << rd.get_as_dbl() * 100.0 << '%' ;	else if(rd.absolute())		return os << rd.get_as_int();	return os <<  "<auto>";}// debug region_dim_spec printoutinline std::ostream& operator<<(std::ostream& os, const ambulant::common::region_dim_spec& rds) { 	os << '('  << rds.left << ", " << rds.width  << ", "  << rds.right;	os << ", " << rds.top  << ", " << rds.height << ", "  << rds.bottom;	return os << ')';}#endif#endif // AMBULANT_COMMON_REGION_DIM_H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久高清一区二区三区| 国v精品久久久网| 在线亚洲一区二区| 亚洲欧美国产三级| 一本一本大道香蕉久在线精品 | 久久久影视传媒| 中文字幕日韩一区二区| 91美女片黄在线| 一色桃子久久精品亚洲| 成人在线视频一区| 日韩一区二区三区视频| 开心九九激情九九欧美日韩精美视频电影| 欧美麻豆精品久久久久久| 午夜欧美2019年伦理| 欧美丰满美乳xxx高潮www| 丝袜亚洲精品中文字幕一区| 欧美日韩一区 二区 三区 久久精品| 五月激情综合色| 日韩欧美国产一区二区在线播放| 免费成人你懂的| 久久中文字幕电影| 成人avav在线| 亚洲影院理伦片| 日韩一区二区三免费高清| 久久国产综合精品| 国产欧美视频在线观看| 国产精品一区二区久久精品爱涩 | 色婷婷激情久久| 国产精品黄色在线观看| 在线观看视频一区二区| 亚洲bt欧美bt精品| 欧美不卡激情三级在线观看| 激情综合色播五月| 国产精品久久久久久久蜜臀| 色94色欧美sute亚洲线路一ni| 亚洲综合区在线| 欧美一级午夜免费电影| 精品在线观看视频| 18欧美乱大交hd1984| 91蝌蚪porny九色| 国内成人精品2018免费看| 国产精品久久久久久久岛一牛影视| 91黄色免费版| 久久99精品国产麻豆婷婷洗澡| 欧美国产日本视频| 欧美另类一区二区三区| 久久av资源网| 亚洲成人在线免费| 国产亚洲精品中文字幕| 欧美色中文字幕| 国产高清亚洲一区| 亚洲精品成人悠悠色影视| 欧美一区二区三区日韩视频| 日本精品免费观看高清观看| 黄色小说综合网站| 一级中文字幕一区二区| 亚洲精品在线电影| 欧美日韩亚洲另类| 盗摄精品av一区二区三区| 免费成人av资源网| 一区二区久久久| 日本一区二区三级电影在线观看 | 亚洲精品视频观看| 久久久久久久精| 欧美电影影音先锋| 99免费精品视频| 激情综合一区二区三区| 三级不卡在线观看| 亚洲人吸女人奶水| 国产精品久久久久久亚洲毛片| 国产日韩欧美精品在线| 久久婷婷国产综合国色天香 | 久久国产精品区| 蜜臀99久久精品久久久久久软件| 亚洲成人一二三| 亚洲福利视频一区二区| 亚洲午夜在线电影| 亚洲综合色噜噜狠狠| 一级做a爱片久久| 香蕉久久夜色精品国产使用方法 | 欧美电影精品一区二区| 欧美一区二区福利视频| 欧美一区二区三级| 日韩欧美一区在线| 精品国产伦一区二区三区免费| 精品噜噜噜噜久久久久久久久试看| 欧美一区永久视频免费观看| 91精品国产高清一区二区三区| 91精品国产综合久久久久久| 日韩亚洲电影在线| www国产成人免费观看视频 深夜成人网| 精品久久久久久久人人人人传媒| 精品剧情在线观看| 国产日韩在线不卡| 中文字幕字幕中文在线中不卡视频| 亚洲女厕所小便bbb| 亚洲电影激情视频网站| 日本亚洲一区二区| 国产麻豆精品在线观看| 99精品一区二区| 欧美男女性生活在线直播观看| 日韩视频不卡中文| 日本一区二区久久| 亚洲精品国产无套在线观| 视频一区在线视频| 国精产品一区一区三区mba桃花 | 91久久精品国产91性色tv| 欧美精品一级二级| 久久久蜜桃精品| 亚洲精品免费在线| 蜜臀av一区二区在线观看| 大胆亚洲人体视频| 欧美优质美女网站| 亚洲精品在线电影| 樱桃视频在线观看一区| 老司机午夜精品| 99视频热这里只有精品免费| 欧美一区二区大片| 日韩美女久久久| 蜜臀91精品一区二区三区| 国产91精品入口| 精品福利av导航| 国产精品伦理一区二区| 日韩精品1区2区3区| 成人激情黄色小说| 日韩一区二区精品在线观看| 国产精品国产三级国产三级人妇| 日韩精品91亚洲二区在线观看| 国产91精品露脸国语对白| 欧美日韩国产另类不卡| 国产精品免费视频观看| 日韩国产精品久久久久久亚洲| 成人午夜电影小说| 日韩午夜在线观看视频| 亚洲欧美日韩国产另类专区| 韩国三级在线一区| 欧美精品xxxxbbbb| 一区二区成人在线观看| 高清av一区二区| 欧美一级片在线| 亚洲午夜免费电影| a在线欧美一区| 精品国产乱码久久久久久免费| 五月激情综合婷婷| 欧洲在线/亚洲| 亚洲乱码中文字幕| 成人av动漫网站| 国产精品三级在线观看| 国产一区 二区| 精品国产91亚洲一区二区三区婷婷| 亚洲永久精品大片| 日本韩国欧美三级| 成人免费在线视频| 成人污视频在线观看| 久久免费美女视频| 激情综合网最新| 精品精品国产高清a毛片牛牛| 日韩精品一级中文字幕精品视频免费观看| 91免费国产视频网站| 国产精品激情偷乱一区二区∴| 国产精品一区一区| 久久久精品免费观看| 国产黄色精品网站| 国产亚洲精品aa午夜观看| 国产精品自拍网站| 久久久久亚洲蜜桃| 国产精品18久久久久久vr| 久久久精品影视| 粉嫩高潮美女一区二区三区| 国产亚洲短视频| 成人黄色一级视频| 亚洲欧美综合网| 91国偷自产一区二区三区成为亚洲经典 | 成人免费毛片片v| 国产精品久久久久精k8| 91蝌蚪porny| 亚洲在线一区二区三区| 欧美剧在线免费观看网站| 丝袜亚洲另类欧美综合| 91精品国产免费久久综合| 麻豆精品一二三| 久久精品一区四区| 91小视频免费观看| 亚洲国产综合91精品麻豆| 正在播放一区二区| 国产一本一道久久香蕉| 国产精品久久久久影院亚瑟| 色婷婷精品大在线视频| 视频在线观看一区二区三区| 日韩欧美电影一二三| 韩国av一区二区| 成人欧美一区二区三区小说| 欧美性生活久久| 精品在线一区二区三区| 欧美激情中文字幕| 精品视频1区2区| 国产主播一区二区三区| 亚洲摸摸操操av| 26uuu亚洲| 在线精品国精品国产尤物884a|