• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Video类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Video的典型用法代码示例。如果您正苦于以下问题:C++ Video类的具体用法?C++ Video怎么用?C++ Video使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Video类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: analyse

void PCACloudReducer::analyse(const CloudAction & c){
    Video flatten;
    for (const Video & v: c._landmarks){
        flatten.insert(flatten.end(),v.begin(),v.end());
    }
    _pca = std::unique_ptr<PCA_Result<66>>(new PCA_Result<66>(std::move(computePCA<66>(flatten))));
}
开发者ID:alexschlueter,项目名称:detect-emotion,代码行数:7,代码来源:processors.cpp


示例2: Vector2

bool D3D9Sprite::CreateRenderTarget(
	VideoWeakPtr video,
	const unsigned int width,
	const unsigned int height,
	const Texture::TARGET_FORMAT format)
{
	if (m_type != Sprite::T_NOT_LOADED && m_type != Sprite::T_RELOAD)
	{
		m_video.lock()->Message(L"The sprite can't be loaded twice - D3D9Sprite::CreateRenderTarget");
		return false;
	}
	m_video = video;
	Video* pVideo = m_video.lock().get();

	const unsigned int screenX = static_cast<unsigned int>(pVideo->GetScreenSize().x);
	const unsigned int screenY = static_cast<unsigned int>(pVideo->GetScreenSize().y);
	if (width > screenX || height > screenY)
	{
		pVideo->Message(L"The render target surface size can't be greater than the backbuffer - D3D9Sprite::CreateRenderTarget");
		return false;
	}

	m_texture = pVideo->CreateRenderTargetTexture(width, height, format);
	if (!m_texture)
		return false;

	m_size = Vector2(static_cast<float>(width), static_cast<float>(height));
	D3D9Video::RENDER_TARGET target(this, width, height, format);
	D3D9Video::AddToTargetList(target);
	m_type = Sprite::T_TARGET;
	m_targetFormat = format;

	SetupSpriteRects(1, 1);
	return GetInternalData();
}
开发者ID:skaflux,项目名称:ethanon,代码行数:35,代码来源:D3D9Sprite.cpp


示例3: throw

void 
SDL_Window::applySettings(const WindowSettings& settings) throw (Exception){
	Video *video = Video::getInstance();
	VideoSettings videoSettings = video->currentSettings();

	SDL_VideoSettings sdlVideoSettings(videoSettings);
	SDL_WindowSettings sdlWindowSettings(settings);

	Uint32 videoFlags = sdlVideoSettings.getFlags();
	Uint32 windowFlags = sdlWindowSettings.getFlags();
	Uint32 flags = videoFlags | windowFlags;

	int bitsPerPixel = sdlWindowSettings.getBitsPerPixel();

	surface = SDL_SetVideoMode(settings.width, settings.height, 
		bitsPerPixel, flags);

	if (surface == NULL){
		throw Exception("Error on SDL_SetVideoMode()");
	} 

	if (canvas)
		delete canvas;
	
	canvas = new SDL_Canvas();

	if (!canvas){
		throw Exception("Sem memoria");
	}

        SDL_WM_SetCaption(sdlWindowSettings.title.c_str(), NULL);
        
	this->settings = settings;
}
开发者ID:GCrean,项目名称:Emperor_vs_Aliens,代码行数:34,代码来源:sdlwindow.cpp


示例4: DragDrop

/*	FUNCTION:		ViewObject :: DragDrop
	ARGUMENTS:		none
	RETURN:			n/a
	DESCRIPTION:	Hook function called when user drops files in application window.
					Essentially, determine if file is image or video.	
*/
void ViewObject :: DragDrop(entry_ref *ref, float mouse_x, float mouse_y)
{
	//	Image file?
	BPath path(ref);
	BBitmap *bitmap = BTranslationUtils::GetBitmap(path.Path(), NULL);
	if (bitmap)
	{
		MediaSource *media = new MediaSource(this);
		GLCreateTexture(media, bitmap);
		if (!SurfaceUpdate(media, mouse_x, mouse_y))
			delete media;
		delete bitmap;
		return;
	}
	
	//	Video file
	Video *video = new Video(ref);
	if (video->GetStatus() == B_OK)
	{
		MediaSource *media = new MediaSource(this);
		GLCreateTexture(media, video->GetBitmap());
		media->SetVideo(video);
		if (SurfaceUpdate(media, mouse_x, mouse_y))
			video->Start();
		else
			delete media;
		return;
	}
	else
		delete video;
	
	printf("Unsupported file\n");
}
开发者ID:mariuz,项目名称:haiku,代码行数:39,代码来源:ViewObject.cpp


示例5: saveScreenTga

		std::string saveScreenTga(const Video& video)
		{
			Int32 num = 0;
			std::string name;

			// Vyhledani cisla pod ktere ukladat
			while (num < 1000)
			{
				num++;
				name = Format("screenshot_{0}.tga") << num;
				if (!File::exists(name))
				{
					break;
				}
			}

			// Maximalne 1000 screenshotu
			if (num >= 1000)
			{
				D6_THROW(IoException, "Maximum number of 1000 screenshots reached");
			}

			Image image(video.getScreen().getClientWidth(), video.getScreen().getClientHeight());
			glReadPixels(0, 0, video.getScreen().getClientWidth(), video.getScreen().getClientHeight(), GL_RGBA, GL_UNSIGNED_BYTE, &image.at(0));
			saveTarga(name, image);
			return name;
		}
开发者ID:michalweiser,项目名称:duel6r,代码行数:27,代码来源:Util.cpp


示例6: DrawFog

// Draw fog on the small bitmap
void MapControl::DrawFog(unsigned short XWin, unsigned short YWin)
{
	Video *video = core->GetVideoDriver();

	Region old_clip;
	video->GetClipRect(old_clip);

	Region r( XWin + XPos, YWin + YPos, Width, Height );
	video->SetClipRect(&r);

	// FIXME: this is ugly, the knowledge of Map and ExploredMask
	//   sizes should be in Map.cpp
	int w = MyMap->GetWidth() / 2;
	int h = MyMap->GetHeight() / 2;

	for (int y = 0; y < h; y++) {
		for (int x = 0; x < w; x++) {
			Point p( (short) (MAP_MULT * x), (short) (MAP_MULT * y) );
			bool visible = MyMap->IsVisible( p, true );
			if (! visible) {
				Region rgn = Region ( MAP_TO_SCREENX(MAP_DIV * x), MAP_TO_SCREENY(MAP_DIV * y), MAP_DIV, MAP_DIV );
				video->DrawRect( rgn, colors[black] );
			}
		}
	}

	video->SetClipRect(&old_clip);
}
开发者ID:ObsidianBlk,项目名称:GemRB--Unofficial-,代码行数:29,代码来源:MapControl.cpp


示例7: reopenVideo

bool VideoPlayer::reopenVideo(Video &video) {
	if (video.isEmpty())
		return true;

	if (video.fileName.empty()) {
		video.close();
		return false;
	}

	Properties properties;

	properties.type = video.properties.type;

	Common::String fileName = findFile(video.fileName, properties);
	if (fileName.empty()) {
		video.close();
		return false;
	}

	Common::SeekableReadStream *stream = _vm->_dataIO->getFile(fileName);
	if (!stream) {
		video.close();
		return false;
	}

	if (!video.decoder->reloadStream(stream)) {
		delete stream;
		return false;
	}

	return true;
}
开发者ID:33d,项目名称:scummvm,代码行数:32,代码来源:videoplayer.cpp


示例8: warpedB

void STWarp<T>::computePartialDerivatives( const WarpingField<T> &warpField,
                                        Video<T> &Bx,
                                        Video<T> &By,
                                        Video<T> &Bt,
                                        Video<T> &C) {
    VideoProcessing::dx(*videoB,Bx,true);
    VideoProcessing::dy(*videoB,By,true);
    VideoProcessing::dt(*videoB,Bt,true);

    Video<stwarp_video_t> warpedB(videoA->size());

    C.copy(*videoA);
    VideoProcessing::backwardWarp(*videoB,warpField,warpedB);
    C.subtract(warpedB);
    // TODO: out of bounds set to 0

    Video<T> temp(videoA->size());
    VideoProcessing::backwardWarp(Bx,warpField,temp);
    Bx.copy(temp);

    temp.reset(0);
    VideoProcessing::backwardWarp(By,warpField,temp);
    By.copy(temp);

    temp.reset(0);
    if( !params.bypassTimeWarp ){
        VideoProcessing::backwardWarp(Bt,warpField,temp);
    }
    Bt.copy(temp);
}
开发者ID:mgharbi,项目名称:video_var,代码行数:30,代码来源:STWarp.cpp


示例9: DoFadeStep

void GlobalTimer::DoFadeStep(ieDword count) {
	Video *video = core->GetVideoDriver();
	if (fadeToCounter) {
		fadeToCounter-=count;
		if (fadeToCounter<0) {
			fadeToCounter=0;
		}
		video->SetFadePercent( ( ( fadeToMax - fadeToCounter ) * 100 ) / fadeToMax );
		//bug/patch #1837747 made this unneeded
		//goto end; //hmm, freeze gametime?
	}
	//i think this 'else' is needed now because of the 'goto' cut above
	else if (fadeFromCounter!=fadeFromMax) {
		if (fadeFromCounter>fadeFromMax) {
			fadeFromCounter-=count;
			if (fadeFromCounter<fadeFromMax) {
				fadeFromCounter=fadeFromMax;
			}
			//don't freeze gametime when already dark
		} else {
			fadeFromCounter+=count;
			if (fadeToCounter>fadeFromMax) {
				fadeToCounter=fadeFromMax;
			}
			video->SetFadePercent( ( ( fadeFromMax - fadeFromCounter ) * 100 ) / fadeFromMax );
			//bug/patch #1837747 made this unneeded
			//goto end; //freeze gametime?
		}
	}
	if (fadeFromCounter==fadeFromMax) {
		video->SetFadePercent( 0 );
	}
}
开发者ID:ObsidianBlk,项目名称:GemRB--Unofficial-,代码行数:33,代码来源:GlobalTimer.cpp


示例10: VideoThread

/*	FUNCTION:		Video :: VideoThread
	ARGUMENTS:		cookie
	RETURN:			thread exit status
	DESCRIPTION:	Video playback thread
*/
int32 Video :: VideoThread(void *cookie)
{
	Video *video = (Video *) cookie;
	if (video->fVideoTrack == NULL)
	{
		exit_thread(B_ERROR);
		return B_ERROR;
	}
	
	float frames_per_second = (float)video->fVideoTrack->CountFrames() / (float)video->fVideoTrack->Duration() * 1000000.0f;
	bigtime_t frame_time = (bigtime_t) (1000000.0f / frames_per_second);
	video->fPerformanceTime = real_time_clock_usecs() + frame_time;
	status_t err = B_OK;
	printf("frame_rate = %f\n", frames_per_second);
	
	while (1)
	{
		err = video->ShowNextFrame();
		bigtime_t zzz = video->fPerformanceTime - real_time_clock_usecs();
		if (zzz < 0)
			zzz = 1;
		video->fPerformanceTime += frame_time;
		snooze(zzz);
	} 
	exit_thread(err);
	return err;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:32,代码来源:Video.cpp


示例11: MZ_GC_DECL_REG

Scheme_Object *video_tcoords(int argc, Scheme_Object **argv)
{
    Scheme_Object *ret = NULL;
    Scheme_Object **coord_list = NULL;
    MZ_GC_DECL_REG(2);
    MZ_GC_VAR_IN_REG(0, argv);
    MZ_GC_VAR_IN_REG(1, coord_list);
    MZ_GC_REG();
    if (!SCHEME_NUMBERP(argv[0]))
        scheme_wrong_type("video-tcoords", "number", 0, argc, argv);

    Video *v = find_video("video-tcoords", argv[0]);
    if (v != NULL)
    {
        coord_list = (Scheme_Object **)scheme_malloc(4 *
                     sizeof(Scheme_Object *));

        float *coords  = v->get_tcoords();

        coord_list[0] = scheme_vector(coords[0], coords[4], coords[2]);
        coord_list[1] = scheme_vector(coords[3], coords[4], coords[5]);
        coord_list[2] = scheme_vector(coords[3], coords[1], coords[5]);
        coord_list[3] = scheme_vector(coords[0], coords[1], coords[2]);

        ret = scheme_build_list(4, coord_list);
    }
    else
    {
        ret = scheme_void;
    }

    MZ_GC_UNREG();
    return ret;
}
开发者ID:rmoorman,项目名称:fluxus,代码行数:34,代码来源:FluxusVideo.cpp


示例12: if

void AnimationManager::FinishUpdateLoadedTextures(string newLocationId)
{
    for (map<string, Video *>::iterator iter = videoByIdMap.begin(); iter != videoByIdMap.end(); ++iter)
    {
        bool loadSprite = false;
        bool deleteSprite = false;
        string videoId = iter->first;
        Video *pVideo = iter->second;

        if (pVideo == NULL)
        {
            continue;
        }

        pVideo->UpdateReadiness(newLocationId, &loadSprite, &deleteSprite);

        if (loadSprite)
        {
            ResourceLoader::GetInstance()->AddVideoToLoadList(pVideo);
        }
        else if (deleteSprite)
        {
            ResourceLoader::GetInstance()->AddVideoToDeleteList(pVideo);
        }
    }
}
开发者ID:mbasaglia,项目名称:my-little-investigations,代码行数:26,代码来源:AnimationManager.cpp


示例13: MotionSpecialTest

    bool MotionSpecialTest()
    {
        Video video;

        if (SOURCE.length() == 0)
        {
            TEST_LOG_SS(Error, "Video source is undefined (-s parameter)!");
            return false;
        }
        if(!video.SetSource(SOURCE))
        {
            TEST_LOG_SS(Error, "Can't open video file '" << SOURCE << "'!");
            return false;
        }

        Filter filter;

        video.SetFilter(&filter);

        video.Start();

#ifdef TEST_PERFORMANCE_TEST_ENABLE
        TEST_LOG_SS(Info, PerformanceMeasurerStorage::s_storage.Report(false, true));
        PerformanceMeasurerStorage::s_storage.Clear();
#endif

        return true;
    }
开发者ID:Winddoing,项目名称:MyCode,代码行数:28,代码来源:TestMotion.cpp


示例14: main

int main(int argc, char **argv)
{
	Video *input = NULL;
	int width, height, time;

	if (argc<4)
	{
		cout << "Usage: t_adaptive_scaling <input_folder> <ratio> <output_folder>" << endl;
		return 0;
		//default parameters
	}
	double ratio = atof(argv[2]);

	// load input video
	cout << "Loading input video..." << endl;
	input = new Video(argv[1]);	
	//vpyramid = VideoPyramid(input);

	// simple calculation of motion energy of every frame
	double *gradient = MotionEnergy(input,0.0);
	//double *energy = SmoothMotionEnergy(gradient,input->GetTime(),5);

	cout << "Adaptively scaling video ..." << endl;
	AdaptiveTemporalReduce(input, gradient, ceil(input->GetTime()*ratio),argv[3]);

	delete gradient;
	delete input;
}
开发者ID:TTgogogo,项目名称:retarget-toolkit,代码行数:28,代码来源:t_adaptive_scaling.cpp


示例15: printf

void STWarp<T>::buildPyramid(vector<vector<int> > pyrSizes,
        vector<Video<stwarp_video_t>*> &pyramidA, 
        vector<Video<stwarp_video_t>*> &pyramidB
        ) const{
    int n = pyrSizes.size();
    if(params.verbosity > 0) {
        printf("+ Building ST-pyramids with %d levels...",n);
    }
    pyramidA[0] = videoA;
    pyramidB[0] = videoB;
    Video<stwarp_video_t> copy;
    for (int i = 1; i < n; ++i) {
        pyramidA[i] = 
            new Video<stwarp_video_t>(pyrSizes[i][0],
            pyrSizes[i][1],pyrSizes[i][2],dimensions[3]);
        pyramidB[i] = 
            new Video<stwarp_video_t>(pyrSizes[i][0],
            pyrSizes[i][1],pyrSizes[i][2],dimensions[3]);

        // Lowpass and downsample
        copy.copy(*pyramidA[i-1]);
        VideoProcessing::resize(copy,pyramidA[i]);
        copy.copy(*pyramidB[i-1]);
        VideoProcessing::resize(copy,pyramidB[i]);
    }
    if(params.verbosity >0) {
        printf("done.\n");
    }
}
开发者ID:mgharbi,项目名称:video_var,代码行数:29,代码来源:STWarp.cpp


示例16: Draw

void Sprite::Draw( void ) {
	Video *video = Video::Instance();
	Trig *trig = Trig::Instance();
	Camera *camera = Camera::Instance();
	
	if( !video->OutOfBounds( sx, sy ) )
		image->DrawCentered( sx, sy, trig->RadToDeg( ang ) - trig->RadToDeg( (1.57 - camera->GetAngle() ) ) );
}
开发者ID:cthielen,项目名称:epsilonfighter,代码行数:8,代码来源:sprite.cpp


示例17: PrintInitial

int Font::PrintInitial(int x, int y, const Region &rgn, unsigned char currChar) const
{
    Video *video = core->GetVideoDriver();
    video->BlitSpriteRegion( sprBuffer, size[currChar],
                             x + rgn.x, y + rgn.y - yPos[currChar], true, &rgn );
    x += size[currChar].w;
    return x;
}
开发者ID:JeremyAgost,项目名称:gemrb,代码行数:8,代码来源:Font.cpp


示例18: getVideoBySlot

bool VideoPlayer::closeVideo(int slot) {
	Video *video = getVideoBySlot(slot);
	if (!video)
		return false;

	video->close();
	return true;
}
开发者ID:Termimad,项目名称:scummvm,代码行数:8,代码来源:videoplayer.cpp


示例19: copyVideoLink

void MediaView::copyVideoLink() {
    Video *video = playlistModel->activeVideo();
    if (!video) return;
    QApplication::clipboard()->setText(video->getStreamUrl());
    QString message = tr("You can now paste the video stream URL into another application") + ". " +
                      tr("The link will be valid only for a limited time.");
    MainWindow::instance()->showMessage(message);
}
开发者ID:flaviotordini,项目名称:minitube,代码行数:8,代码来源:mediaview.cpp


示例20: copyWebPage

void MediaView::copyWebPage() {
    Video *video = playlistModel->activeVideo();
    if (!video) return;
    QString address = video->getWebpage();
    QApplication::clipboard()->setText(address);
    QString message = tr("You can now paste the YouTube link into another application");
    MainWindow::instance()->showMessage(message);
}
开发者ID:flaviotordini,项目名称:minitube,代码行数:8,代码来源:mediaview.cpp



注:本文中的Video类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VideoBuffer类代码示例发布时间:2022-05-31
下一篇:
C++ Victor类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap