/* * osgART/GenericVideoObject * osgART: AR ToolKit for OpenSceneGraph * * Copyright (c) 2005-2007 ARToolworks, Inc. All rights reserved. * * Rev Date Who Changes * 1.0 2006-12-08 --- Version 1.0 release. * */ /* * This file is part of osgART - AR Toolkit for OpenSceneGraph * * Copyright (c) 2005-2007 ARToolworks, Inc. All rights reserved. * * (See the AUTHORS file in the root of this distribution.) * * * OSGART is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * OSGART 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OSGART; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "osgART/GenericVideoObject" #if defined(_WIN32) #include #endif #if !defined(_MSC_VER) || !defined(_X86_) # include #endif namespace osgART { /*static*/ unsigned int GenericVideoObject::mathNextPowerOf2(unsigned int x) { #if defined(_MSC_VER) && defined(_X86_) unsigned int result = 0; _asm bsr ecx,x; // Find the base 2 logarithm _asm inc ecx; // Increase it by 1 _asm mov eax,1; _asm shl eax,cl; // Find the antilogarithm _asm mov result,eax; return result; // Return the result #else return ((unsigned int)(exp2((double)((int)(log2((double)x)) + 1)))); #endif } GenericVideoObject::GenericVideoObject(GenericVideo* video) : osg::Group(), m_vShader(0L), m_vTexture(0L), m_video(video), m_distortionMode(NO_CORRECTION), m_textureMode(USE_TEXTURE_RECTANGLE), m_videoimage(new osg::Image) { } GenericVideoObject::~GenericVideoObject() { } }; // namespace osgART