您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ArrayList_Count函数代码示例

51自学网 2021-06-01 19:47:32
  C++
这篇教程C++ ArrayList_Count函数代码示例写得很实用,希望能帮到您。

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

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

示例1: xf_event_execute_action_script

static BOOL xf_event_execute_action_script(xfContext* xfc, XEvent* event){	int index;	int count;	char* name;	FILE* actionScript;	BOOL match = FALSE;	const char* xeventName;	char buffer[1024] = { 0 };	char command[1024] = { 0 };	if (!xfc->actionScript || !xfc->xevents)		return FALSE;	if (event->type > (sizeof(X11_EVENT_STRINGS) / sizeof(const char*)))		return FALSE;	xeventName = X11_EVENT_STRINGS[event->type];	count = ArrayList_Count(xfc->xevents);	for (index = 0; index < count; index++)	{		name = (char*) ArrayList_GetItem(xfc->xevents, index);		if (_stricmp(name, xeventName) == 0)		{			match = TRUE;			break;		}	}	if (!match)		return FALSE;	sprintf_s(command, sizeof(command), "%s xevent %s %lu",	          xfc->actionScript, xeventName, (unsigned long) xfc->window->handle);	actionScript = popen(command, "r");	if (!actionScript)		return FALSE;	while (fgets(buffer, sizeof(buffer), actionScript))	{		strtok(buffer, "/n");	}	pclose(actionScript);	return TRUE;}
开发者ID:awakecoding,项目名称:FreeRDP,代码行数:49,


示例2: tsmf_presentation_sync

void tsmf_presentation_sync(TSMF_PRESENTATION* presentation){	UINT32 index;	UINT32 count;	ArrayList_Lock(presentation->stream_list);	count = ArrayList_Count(presentation->stream_list);	for (index = 0; index < count; index++)	{		TSMF_STREAM* stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);		WaitForSingleObject(stream->ready, 500);	}	ArrayList_Unlock(presentation->stream_list);}
开发者ID:EmiyaShilong,项目名称:FreeRDP,代码行数:15,


示例3: if

void RDPListener::on_property_call(Glib::VariantBase &property,                                   const Glib::RefPtr<Gio::DBus::Connection> &,                                   const Glib::ustring &,                                   const Glib::ustring &,                                   const Glib::ustring &,                                   const Glib::ustring &property_name){    if (property_name == "Port") {        property = Glib::Variant<uint16_t>::create(port);    } else if (property_name == "NumConnectedPeers") {        property = Glib::Variant<uint32_t>::create(ArrayList_Count(this->server->clients));    } else if (property_name == "RequiresAuthentication") {        property = Glib::Variant<bool>::create(authenticating);    }}
开发者ID:datto,项目名称:RDPMux,代码行数:15,


示例4: AreaFilter_CreateHull

int AreaFilter_CreateHull (AreaFilter* self, ArrayList* points){	int u = AreaFilter_MakeChain (self, points, AreaFilter_CompareLow);		if (ArrayList_Count(points) == 0)		return (0);	/*	  int k;	  for (k = 0 ; k < u ; ++k)	      WriteLine ("point %d: %f %f", k, ((FilterPoint*)ArrayList_GetItem(points, k)[k])->x,                                        	       ((FilterPoint*)ArrayList_GetItem(points, k)[k])->y);	*/	ArrayList* pointsHigh = ArrayList_new(ArrayList_Count(points)+1-u, NULL);	//WriteLine ("points.Length = %d, u = %d", ArrayList_Count(points), u);		ArrayList_Copy (points, u, pointsHigh, 0, ArrayList_Count(points) - u);	ArrayList_SetItem(pointsHigh, ArrayList_Count(pointsHigh) - 1,  ArrayList_GetItem(points, 0));	int h = AreaFilter_MakeChain (self, pointsHigh, AreaFilter_CompareHigh);		int p;	for ( p = u ; p < ArrayList_Count(points) ; ++p) {		ArrayList_SetItem(points, p, ArrayList_GetItem(pointsHigh, p-u));	}		/*	  WriteLine ("h = %d, u = %d", h, u);	  int k;	  for (k = 0 ; k < (h + u) ; ++k)	      WriteLine ("point %d: %f %f", k, ((FilterPoint*)ArrayList_GetItem(points, k)[k])->x,                                        	       ((FilterPoint*)ArrayList_GetItem(points, k)[k])->y);	*/	return (h + u);}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:36,


示例5: tsmf_presentation_set_geometry_info

void tsmf_presentation_set_geometry_info(TSMF_PRESENTATION *presentation,		UINT32 x, UINT32 y, UINT32 width, UINT32 height, int num_rects, RDP_RECT *rects){	UINT32 index;	UINT32 count;	TSMF_STREAM *stream;	/* The server may send messages with invalid width / height.	 * Ignore those messages. */	if (!width || !height)		return;	if ((width == presentation->width) && (height == presentation->height) &&			(x == presentation->x) && (y == presentation->y) &&			(num_rects == presentation->nr_rects) &&			(0 == memcmp(rects, presentation->rects, num_rects * sizeof(RDP_RECT))))	{		return;	}	presentation->x = x;	presentation->y = y;	presentation->width = width;	presentation->height = height;	presentation->nr_rects = num_rects;	presentation->rects = realloc(presentation->rects, sizeof(RDP_RECT) * num_rects);	if (presentation->rects)		memcpy(presentation->rects, rects, sizeof(RDP_RECT) * num_rects);	ArrayList_Lock(presentation->stream_list);	count = ArrayList_Count(presentation->stream_list);	for (index = 0; index < count; index++)	{		stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);		if (!stream->decoder)			continue;		if (stream->decoder->UpdateRenderingArea)		{			stream->decoder->UpdateRenderingArea(stream->decoder, x, y, width, height, num_rects, rects);		}	}	ArrayList_Unlock(presentation->stream_list);}
开发者ID:JozLes77,项目名称:FreeRDP,代码行数:48,


示例6: tsmf_presentation_start

void tsmf_presentation_start(TSMF_PRESENTATION* presentation){	UINT32 index;	UINT32 count;	TSMF_STREAM* stream;	ArrayList_Lock(presentation->stream_list);	count = ArrayList_Count(presentation->stream_list);	for (index = 0; index < count; index++)	{		stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);		tsmf_stream_start(stream);	}	ArrayList_Unlock(presentation->stream_list);}
开发者ID:EmiyaShilong,项目名称:FreeRDP,代码行数:16,


示例7: tsmf_presentation_restarted

BOOL tsmf_presentation_restarted(TSMF_PRESENTATION* presentation){	UINT32 index;	UINT32 count;	TSMF_STREAM* stream;	BOOL ret = TRUE;	ArrayList_Lock(presentation->stream_list);	count = ArrayList_Count(presentation->stream_list);	for (index = 0; index < count; index++)	{		stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index);		ret &= tsmf_stream_restart(stream);	}	ArrayList_Unlock(presentation->stream_list);	return ret;}
开发者ID:JunaidLoonat,项目名称:FreeRDP,代码行数:18,


示例8: tsmf_presentation_volume_changed

void tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, UINT32 newVolume, UINT32 muted){	UINT32 index;	UINT32 count;	TSMF_STREAM* stream;	presentation->volume = newVolume;	presentation->muted = muted;	ArrayList_Lock(presentation->stream_list);	count = ArrayList_Count(presentation->stream_list);	for (index = 0; index < count; index++)	{		stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);		tsmf_stream_change_volume(stream, newVolume, muted);	}	ArrayList_Unlock(presentation->stream_list);}
开发者ID:EmiyaShilong,项目名称:FreeRDP,代码行数:18,


示例9: shadow_client_boardcast_quit

int shadow_client_boardcast_quit(rdpShadowServer* server, int nExitCode){	wMessageQueue* queue = NULL;	int count = 0;	int index = 0;	ArrayList_Lock(server->clients);	for (index = 0; index < ArrayList_Count(server->clients); index++)	{		queue = ((rdpShadowClient*)ArrayList_GetItem(server->clients, index))->MsgQueue;		if (MessageQueue_PostQuit(queue, nExitCode))		{			count++;		}	}	ArrayList_Unlock(server->clients);	return count;}
开发者ID:Graf3x,项目名称:FreeRDP,代码行数:19,


示例10: MultiMatch_CreatePointList

ArrayList* MultiMatch_CreatePointList (MultiMatch* self, ArrayList* matches){	ArrayList* points = ArrayList_new0 (FilterPoint_delete);	// Create a point list.	int i;	for(i=0; i<ArrayList_Count(matches); i++) {		Match* m = (Match*) ArrayList_GetItem(matches, i);		FilterPoint* p = FilterPoint_new0 ();		p->x = m->kp1->x;		p->y = m->kp1->y;		p->user = m;		WriteLine ("%f %f # CPOINTS", p->x, p->y);		ArrayList_AddItem(points, p);	}		return (points);}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:20,


示例11: rpc_client_call_find_by_id

RpcClientCall* rpc_client_call_find_by_id(rdpRpc* rpc, UINT32 CallId){	int index;	int count;	RpcClientCall* clientCall;	ArrayList_Lock(rpc->client->ClientCallList);	clientCall = NULL;	count = ArrayList_Count(rpc->client->ClientCallList);	for (index = 0; index < count; index++)	{		clientCall = (RpcClientCall*) ArrayList_GetItem(rpc->client->ClientCallList, index);		if (clientCall->CallId == CallId)			break;	}	ArrayList_Unlock(rpc->client->ClientCallList);	return clientCall;}
开发者ID:a1154043439,项目名称:FreeRDP,代码行数:20,


示例12: dvcman_free

void dvcman_free(IWTSVirtualChannelManager* pChannelMgr){	int i;	int count;	IWTSPlugin* pPlugin;	DVCMAN_LISTENER* listener;	DVCMAN_CHANNEL* channel;	DVCMAN* dvcman = (DVCMAN*) pChannelMgr;	ArrayList_Lock(dvcman->channels);	count = ArrayList_Count(dvcman->channels);	for (i = 0; i < count; i++)	{		channel = (DVCMAN_CHANNEL*) ArrayList_GetItem(dvcman->channels, i);		dvcman_channel_free(channel);	}	ArrayList_Unlock(dvcman->channels);	ArrayList_Free(dvcman->channels);	for (i = 0; i < dvcman->num_listeners; i++)	{		listener = (DVCMAN_LISTENER*) dvcman->listeners[i];		free(listener->channel_name);		free(listener);	}	for (i = 0; i < dvcman->num_plugins; i++)	{		pPlugin = dvcman->plugins[i];		if (pPlugin->Terminated)			pPlugin->Terminated(pPlugin);	}	StreamPool_Free(dvcman->pool);	free(dvcman);}
开发者ID:Oshirowanen,项目名称:FreeRDP,代码行数:41,


示例13: winpr_unref_named_pipe

static void winpr_unref_named_pipe(WINPR_NAMED_PIPE* pNamedPipe){	int index;	NamedPipeServerSocketEntry* baseSocket;	if (!pNamedPipe)		return;	assert(pNamedPipe->name);	assert(g_NamedPipeServerSockets);	//WLog_VRB(TAG, "%p (%s)", pNamedPipe, pNamedPipe->name);	ArrayList_Lock(g_NamedPipeServerSockets);	for (index = 0; index < ArrayList_Count(g_NamedPipeServerSockets); index++)	{		baseSocket = (NamedPipeServerSocketEntry*) ArrayList_GetItem(						 g_NamedPipeServerSockets, index);		assert(baseSocket->name);		if (!strcmp(baseSocket->name, pNamedPipe->name))		{			assert(baseSocket->references > 0);			assert(baseSocket->serverfd != -1);			if (--baseSocket->references == 0)			{				//WLog_DBG(TAG, "removing shared server socked resource");				//WLog_DBG(TAG, "closing shared serverfd %d", baseSocket->serverfd);				ArrayList_Remove(g_NamedPipeServerSockets, baseSocket);				close(baseSocket->serverfd);				free(baseSocket->name);				free(baseSocket);			}			break;		}	}	ArrayList_Unlock(g_NamedPipeServerSockets);}
开发者ID:matthew-n,项目名称:FreeRDP,代码行数:40,


示例14: CreateFileA

HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes,				   DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile){	int i;	if (!lpFileName)		return INVALID_HANDLE_VALUE;	if (pthread_once(&_HandleCreatorsInitialized, _HandleCreatorsInit) != 0)	{		SetLastError(ERROR_DLL_INIT_FAILED);		return INVALID_HANDLE_VALUE;	}	if (_HandleCreators == NULL)	{		SetLastError(ERROR_DLL_INIT_FAILED);		return INVALID_HANDLE_VALUE;	}	ArrayList_Lock(_HandleCreators);	for (i=0; i <= ArrayList_Count(_HandleCreators); i++)	{		HANDLE_CREATOR* creator = ArrayList_GetItem(_HandleCreators, i);		if (creator && creator->IsHandled(lpFileName))		{			HANDLE newHandle = creator->CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes,													dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);			ArrayList_Unlock(_HandleCreators);			return newHandle;		}	}	ArrayList_Unlock(_HandleCreators);	return INVALID_HANDLE_VALUE;}
开发者ID:bceverly,项目名称:FreeRDP,代码行数:38,


示例15: FreeRDP_WTSCloseServer

VOID WINAPI FreeRDP_WTSCloseServer(HANDLE hServer){	int index;	int count;	rdpPeerChannel* channel;	WTSVirtualChannelManager* vcm;	vcm = (WTSVirtualChannelManager*) hServer;	if (vcm)	{		HashTable_Remove(g_ServerHandles, (void*) (UINT_PTR) vcm->SessionId);		ArrayList_Lock(vcm->dynamicVirtualChannels);		count = ArrayList_Count(vcm->dynamicVirtualChannels);		for (index = 0; index < count; index++)		{			channel = (rdpPeerChannel*) ArrayList_GetItem(vcm->dynamicVirtualChannels, index);			WTSVirtualChannelClose(channel);		}		ArrayList_Unlock(vcm->dynamicVirtualChannels);		ArrayList_Free(vcm->dynamicVirtualChannels);		if (vcm->drdynvc_channel)		{			WTSVirtualChannelClose(vcm->drdynvc_channel);			vcm->drdynvc_channel = NULL;		}		MessageQueue_Free(vcm->queue);		free(vcm);	}}
开发者ID:Auto-Droid,项目名称:FreeRDP,代码行数:38,


示例16: tsmf_presentation_sync

/** * Function description * * @return 0 on success, otherwise a Win32 error code */UINT tsmf_presentation_sync(TSMF_PRESENTATION* presentation){	UINT32 index;	UINT32 count;	UINT error;	ArrayList_Lock(presentation->stream_list);	count = ArrayList_Count(presentation->stream_list);	for (index = 0; index < count; index++)	{		TSMF_STREAM* stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);		if (WaitForSingleObject(stream->ready, 500) == WAIT_FAILED)		{			error = GetLastError();			WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", error);			return error;		}	}	ArrayList_Unlock(presentation->stream_list);	return CHANNEL_RC_OK;}
开发者ID:artemh,项目名称:FreeRDP,代码行数:28,


示例17: ArrayList_Lock

TSMF_STREAM *tsmf_stream_find_by_id(TSMF_PRESENTATION *presentation, UINT32 stream_id){	UINT32 index;	UINT32 count;	BOOL found = FALSE;	TSMF_STREAM *stream;	ArrayList_Lock(presentation->stream_list);	count = ArrayList_Count(presentation->stream_list);	for (index = 0; index < count; index++)	{		stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);		if (stream->stream_id == stream_id)		{			found = TRUE;			break;		}	}	ArrayList_Unlock(presentation->stream_list);	return (found) ? stream : NULL;}
开发者ID:JozLes77,项目名称:FreeRDP,代码行数:23,


示例18: winpr_unref_named_pipe

static void winpr_unref_named_pipe(WINPR_NAMED_PIPE* pNamedPipe){	int index;	NamedPipeServerSocketEntry *baseSocket;	if (!pNamedPipe)		return;	assert(pNamedPipe->name);	assert(g_NamedPipeServerSockets);	//fprintf(stderr, "%s: %p (%s)/n", __FUNCTION__, pNamedPipe, pNamedPipe->name);	ArrayList_Lock(g_NamedPipeServerSockets);	for (index = 0; index < ArrayList_Count(g_NamedPipeServerSockets); index++)	{		baseSocket = (NamedPipeServerSocketEntry*) ArrayList_GetItem(				g_NamedPipeServerSockets, index);		assert(baseSocket->name);		if (!strcmp(baseSocket->name, pNamedPipe->name))		{			assert(baseSocket->references > 0);			assert(baseSocket->serverfd != -1);			if (--baseSocket->references == 0)			{				//fprintf(stderr, "%s: removing shared server socked resource/n", __FUNCTION__);				//fprintf(stderr, "%s: closing shared serverfd %d/n", __FUNCTION__, baseSocket->serverfd);				ArrayList_Remove(g_NamedPipeServerSockets, baseSocket);				close(baseSocket->serverfd);				free(baseSocket->name);				free(baseSocket);			}			break;		}	}	ArrayList_Unlock(g_NamedPipeServerSockets);}
开发者ID:10084462,项目名称:FreeRDP,代码行数:37,


示例19: AreaFilter_MakeChain

int AreaFilter_MakeChain (AreaFilter* self, ArrayList* points, int (*comp)(const FilterPoint*, const FilterPoint*)){	IComparator comparator;	comparator.compareTo = (int ( *)(IComparator *,const void *,const void *)) comp;	ArrayList_Sort(points, &comparator);		int s = 1;	int pCount = ArrayList_Count(points);	int i;	for (i = 2 ; i < pCount ; ++i) {		int j;		for (j = s ; j >= 1 && AreaFilter_ccw (points, i, j, j - 1) ; --j)			;				s = j + 1;				// Swap		FilterPoint* t = (FilterPoint*) ArrayList_GetItem(points, s);		ArrayList_SetItem(points, s, ArrayList_GetItem(points, i));		ArrayList_SetItem(points, i, t);	}		return (s);}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:24,


示例20: x11_shadow_pointer_position_update

int x11_shadow_pointer_position_update(x11ShadowSubsystem* subsystem){	SHADOW_MSG_OUT_POINTER_POSITION_UPDATE* msg;	UINT32 msgId = SHADOW_MSG_OUT_POINTER_POSITION_UPDATE_ID;	rdpShadowClient* client;	rdpShadowServer* server;	int count = 0;	int index = 0;	msg = (SHADOW_MSG_OUT_POINTER_POSITION_UPDATE*) calloc(1, sizeof(SHADOW_MSG_OUT_POINTER_POSITION_UPDATE));	if (!msg)		return -1;	msg->xPos = subsystem->pointerX;	msg->yPos = subsystem->pointerY;	msg->Free = x11_shadow_message_free;	server = subsystem->server;	ArrayList_Lock(server->clients);	for (index = 0; index < ArrayList_Count(server->clients); index++)	{		client = (rdpShadowClient*)ArrayList_GetItem(server->clients, index);		/* Skip the client which send us the latest mouse event */		if (client == subsystem->lastMouseClient)			continue; 		if (shadow_client_post_msg(client, NULL, msgId, (SHADOW_MSG_OUT*) msg, NULL))			count++;	}	ArrayList_Unlock(server->clients);	return count;}
开发者ID:DavBfr,项目名称:FreeRDP,代码行数:36,


示例21: MultiMatch_LocateMatchSets

// Find and return a list of MatchSet objects.//// This is the heart of the matching process.//// minimumMatches: minimum number of matches required in final results.// bestMatches: number of best matches to keep, or zero to keep all.// useRANSAC: whether ransac filtering should be used (true recommended//     for 2d rigid transformed images, such as panoramas).ArrayList* MultiMatch_LocateMatchSets (MultiMatch* self, 				     int minimumMatches, int bestMatches,				     bool useRANSAC, bool useAreaFiltration){// mod 06 Mar 2008 TKS to allow alternative primary matchers	if( ArrayList_Count( self->globalMatches ) == 0 ) {		MultiMatch_BuildGlobalKD (self);		MultiMatch_BuildGlobalMatchList (self);	}	MultiMatch_PartitionMatches (self);	self->filteredMatchSets = ArrayList_new0 (NULL);	// Walk all image combinations.	int n0;	for ( n0 = 0 ; n0 < self->imageCount ; ++n0) {		int n1;		for ( n1 = n0 + 1 ; n1 < self->imageCount ; ++n1) {			MatchSet* ms = (MatchSet*) self->matchSets[n0][n1];			if (ms == NULL || ms->matches == NULL)				continue;						if (useRANSAC) {				ArrayList* ransacMatches = NULL;				int maxX = ms->xDim1 >= ms->xDim2 ? ms->xDim1 : ms->xDim2;				int maxY = ms->yDim1 >= ms->yDim2 ? ms->yDim1 : ms->yDim2;								// TODO: 16.0 -> configurable				ImageMatchModel* bestRansac = MatchDriver_FilterMatchSet					(ms->matches, 16.0, maxX, maxY);								ms->bestMatchFit = bestRansac;				if (bestRansac != NULL)					ransacMatches = bestRansac->fittingGround;				if (ransacMatches == NULL) {					if (self->verbose)						WriteLine ("RANSAC says: no good matches from " 							   "%d original matches", ArrayList_Count(ms->matches));					continue;				} else {					if (self->verbose)						WriteLine ("RANSAC purged: %d to %d",							   ArrayList_Count(ms->matches), ArrayList_Count(ransacMatches));				}								// Overwrite matches with RANSAC checked ones.				ms->matches = ransacMatches;			}			// Number of RANSAC-ok matches before count-filtering.			int beforeBestFilterCount = ArrayList_Count(ms->matches);						// TODO: replace with area filtering			WriteLine ("Filtering... (%s, %s)",				   ms->file1,				   ms->file2);						// First filtration: Join matches			int beforeJoinFiltering = ArrayList_Count(ms->matches);			ms->matches = MatchKeys_FilterJoins (ms->matches);			WriteLine ("   A. Join Filtration: %d to %d",				   beforeJoinFiltering, ArrayList_Count(ms->matches));			#if 0			// Second: Area filtration			if (useAreaFiltration && bestMatches > 0) {				int beforeAreaFiltering = ms.Matches.Count;				double pixelCount = ms.xDim1 * ms.yDim1;				double areaPixels;				ms.Matches = FilterMatchesByArea (ms.Matches, bestMatches,								  out areaPixels);				Console.WriteLine ("   B. Area Filtration: {0} to {1}, covering {2:N2} % of image /"{3}/"",						   beforeAreaFiltering, ms.Matches.Count,						   (areaPixels * 100.0) / pixelCount,						   System.IO.Path.GetFileName (ms.File1));			}#endif#if 0			if (useAreaFiltration && bestMatches > 0) {				int beforeFiltering = ms.Matches.Count;								ms.Matches = FilterMatchesByCoverage (ms, ms.Matches, bestMatches);								Console.WriteLine ("   B. Coverage Filtration: {0} to {1} on image /"{2}/"",						   beforeFiltering, ms.Matches.Count,						   System.IO.Path.GetFileName (ms.File1));			} else#endif//.........这里部分代码省略.........
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:101,


示例22: MultiMatch_LoadKeysetsFromMemory

void MultiMatch_LoadKeysetsFromMemory (MultiMatch* self, ArrayList* memlist){	self->imageCount = ArrayList_Count(memlist);	self->keySets = memlist;}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:5,


示例23: tsmf_stream_pop_sample

static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync){	UINT32 index;	UINT32 count;	TSMF_STREAM *s;	TSMF_SAMPLE* sample;	BOOL pending = FALSE;	TSMF_PRESENTATION* presentation = stream->presentation;	if (!stream)		return NULL;	if (Queue_Count(stream->sample_list) < 1)		return NULL;	if (sync)	{		if (stream->decoder)		{			if (stream->decoder->GetDecodedData)			{				if (stream->major_type == TSMF_MAJOR_TYPE_AUDIO)				{					/* Check if some other stream has earlier sample that needs to be played first */					/* Start time is more reliable than end time as some stream types seem to have incorrect					 * end times from the server					 */					if (stream->last_start_time > AUDIO_TOLERANCE)					{						ArrayList_Lock(presentation->stream_list);						count = ArrayList_Count(presentation->stream_list);						for (index = 0; index < count; index++)						{							s = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);							/* Start time is more reliable than end time as some stream types seem to have incorrect							 * end times from the server							 */							if (s != stream && !s->eos && s->last_start_time &&								s->last_start_time < stream->last_start_time - AUDIO_TOLERANCE)							{								DEBUG_TSMF("Pending due to audio tolerance");								pending = TRUE;								break;							}						}						ArrayList_Unlock(presentation->stream_list);					}				}				else				{					/* Start time is more reliable than end time as some stream types seem to have incorrect					 * end times from the server					 */					if (stream->last_start_time > presentation->audio_start_time)					{						DEBUG_TSMF("Pending due to stream start time > audio start time");						pending = TRUE;					}				}			}		}	}	if (pending)		return NULL;	sample = (TSMF_SAMPLE *) Queue_Dequeue(stream->sample_list);	/* Only update stream last end time if the sample end time is valid and greater than the current stream end time */	if (sample && (sample->end_time > stream->last_end_time) && (!sample->invalidTimestamps))		stream->last_end_time = sample->end_time;	/* Only update stream last start time if the sample start time is valid and greater than the current stream start time */	if (sample && (sample->start_time > stream->last_start_time) && (!sample->invalidTimestamps))		stream->last_start_time = sample->start_time;	return sample;}
开发者ID:artemh,项目名称:FreeRDP,代码行数:81,


示例24: main

//.........这里部分代码省略.........	// next arg is either output file name or "-" for stdout	// anything else beginning with '-' is an error	if( argv[optionCount][0] == '-' ){		if( strcmp( argv[optionCount], "-" ) == 0 )streamout = true;		else {			WriteLine ("Option error. Run without arguments for help.");			exit (1);		}	}		if (bottomDefault != -1 && preAlign == false) {		WriteLine ("Please enable automatic alignment (/"--align/") before using the");		WriteLine ("--bottom-is-* options. Thank you. Run /"autopano.exe/" without");		WriteLine ("arguments for usage help.");		exit (1);	}	if (generateHorizon > 0 && preAlign == false) {		WriteLine ("Please enable automatic alignment (/"--align/") before using the");		WriteLine ("--generate-horizon option. Thank you. Run /"autopano.exe/" without");		WriteLine ("arguments for usage help.");		exit (1);	}	MultiMatch* mm = MultiMatch_new0 ();	ArrayList* keyfiles = ArrayList_new0(NULL);	int i;	for( i=0; i<argc - 1 - optionCount; i++) {		ArrayList_AddItem(keyfiles, argv[i+optionCount+1]);	}	WriteLine ("Loading keyfiles");	MultiMatch_LoadKeysets (mm, keyfiles);	WriteLine ("/nMatching...%s", useRansac == true ? " RANSAC enabled" : "");	ArrayList* msList = MultiMatch_LocateMatchSets (mm, 3, maxMatches,							useRansac, useAreaFiltration);	// Connected component check	WriteLine ("/nConnected component check...");	ArrayList* components = MultiMatch_ComponentCheck (mm, msList);	WriteLine ("Connected component identification resulted in %d component%s:",		   ArrayList_Count(components), ArrayList_Count(components) > 1 ? "s" : "");	int compN = 1;	int j;	for(j=0; j<ArrayList_Count(components); j++) {		Component* comp = (Component*) ArrayList_GetItem(components, j);                char* compstr = Component_ToString(comp);                WriteLine ("component %d: %s", compN++, compstr);                free(compstr);	}	if (ArrayList_Count(components) > 1) {		WriteLine ("");		WriteLine ("Warning: There is one or more components that are not connected through control");		WriteLine ("         points. An optimization of the resulting PTO will not be possible");		WriteLine ("         without prior adding of control points between the components listed");		WriteLine ("         above. Please see the manual page for autopano(1) for details.");		WriteLine ("");	} else		WriteLine ("");	// BondBall algorithm	BondBall* bb = NULL;	if (preAlign) {		bb = MultiMatch_BuildBondBall (mm, msList, bottomDefault);		if (bb == NULL) {			WriteLine ("WARNING: Failed to build bondball as requested. No pre-aligning of images");			WriteLine ("         takes place./n");		}	}	if (refine) {		WriteLine ("Refining keypoints");		RefineKeypoints (msList, refineMiddle, keepUnrefinable);	}	FILE* pto;	if ( streamout ) {		pto = stdout;	} else {		WriteLine ("Creating output file /"%s/"", argv[optionCount]);		pto = fopen(argv[optionCount], "w");	}	WritePTOFile (pto, mm, msList, bb, generateHorizon, useIntegerCoordinates,		      useAbsolutePathnames);	ArrayList_delete(keyfiles);	ArrayList_delete(components);	BondBall_delete(bb);	MultiMatch_delete(mm);	if ( !streamout )		fclose(pto);	return 0;}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:101,


示例25: tsmf_sample_playback

static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample){	BOOL ret = FALSE;	UINT32 width;	UINT32 height;	UINT32 pixfmt = 0;	TSMF_STREAM* stream = sample->stream;	if (stream->decoder)	{		if (stream->decoder->DecodeEx)		{			/* Try to "sync" video buffers to audio buffers by looking at the running time for each stream			 * The difference between the two running times causes an offset between audio and video actual			 * render times. So, we try to adjust timestamps on the video buffer to match those on the audio buffer.			 */			if (stream->major_type == TSMF_MAJOR_TYPE_VIDEO)			{					TSMF_STREAM* temp_stream = NULL;				TSMF_PRESENTATION* presentation = stream->presentation;				ArrayList_Lock(presentation->stream_list);				int count = ArrayList_Count(presentation->stream_list);				int index = 0;				for (index = 0; index < count; index++)				{					UINT64 time_diff;					temp_stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index);					if (temp_stream->major_type == TSMF_MAJOR_TYPE_AUDIO)					{						UINT64 video_time = (UINT64) stream->decoder->GetRunningTime(stream->decoder);						UINT64 audio_time = (UINT64) temp_stream->decoder->GetRunningTime(temp_stream->decoder);						UINT64 max_adjust = VIDEO_ADJUST_MAX;						if (video_time < audio_time)							max_adjust = -VIDEO_ADJUST_MAX;						if (video_time > audio_time)							time_diff = video_time - audio_time;						else							time_diff = audio_time - video_time;						time_diff = time_diff < VIDEO_ADJUST_MAX ? time_diff : max_adjust;						sample->start_time += time_diff;						sample->end_time += time_diff;						break;					}				}				ArrayList_Unlock(presentation->stream_list);			}			ret = stream->decoder->DecodeEx(stream->decoder, sample->data, sample->data_size, sample->extensions,						sample->start_time, sample->end_time, sample->duration);		}		else		{			ret = stream->decoder->Decode(stream->decoder, sample->data, sample->data_size, sample->extensions);		}	}	if (!ret)	{		WLog_ERR(TAG, "decode error, queue ack anyways");		if (!tsmf_sample_queue_ack(sample))		{			WLog_ERR(TAG, "error queuing sample for ack");			return FALSE;		}		return TRUE;	}	free(sample->data);	sample->data = NULL;	if (stream->major_type == TSMF_MAJOR_TYPE_VIDEO)	{		if (stream->decoder->GetDecodedFormat)		{			pixfmt = stream->decoder->GetDecodedFormat(stream->decoder);			if (pixfmt == ((UINT32) -1))			{				WLog_ERR(TAG, "unable to decode video format");				if (!tsmf_sample_queue_ack(sample))				{					WLog_ERR(TAG, "error queuing sample for ack");				}				return FALSE;			}			sample->pixfmt = pixfmt;		}		if (stream->decoder->GetDecodedDimension)		{			ret = stream->decoder->GetDecodedDimension(stream->decoder, &width, &height);			if (ret && (width != stream->width || height != stream->height))//.........这里部分代码省略.........
开发者ID:artemh,项目名称:FreeRDP,代码行数:101,


示例26: KDTree_GoodCandidate

IKDTreeDomain* KDTree_GoodCandidate (ArrayList* exset, int* splitDim){	IKDTreeDomain* first = (IKDTreeDomain*) ArrayList_GetItem(exset, 0);	if (first == NULL) {		FatalError ("Not of type IKDTreeDomain (TODO: custom exception)");	}		int dim = IKDTreeDomain_GetDimensionCount(first);		// initialize temporary hr search min/max values	double* minHr = (double*)malloc(sizeof(double)* dim);	double* maxHr = (double*)malloc(sizeof(double)* dim);	int i;	for (i = 0 ; i < dim ; ++i) {		minHr[i] = Double_PositiveInfinity;		maxHr[i] = Double_NegativeInfinity;	}	int j;	for(j=0; j<ArrayList_Count(exset); j++) {		IKDTreeDomain* dom = (IKDTreeDomain*) ArrayList_GetItem(exset, j);		int k;		for (k = 0 ; k < dim ; ++k) {			double dimE = IKDTreeDomain_GetDimensionElement (dom, k);						if (dimE < minHr[k])				minHr[k] = dimE;			if (dimE > maxHr[k])				maxHr[k] = dimE;		}	}	// find the maximum range dimension	double* diffHr = (double*)malloc(sizeof(double)* dim);	int maxDiffDim = 0;	double maxDiff = 0.0;	int k;	for (k = 0 ; k < dim ; ++k) {		diffHr[k] = maxHr[k] - minHr[k];		if (diffHr[k] > maxDiff) {			maxDiff = diffHr[k];			maxDiffDim = k;		}	}		free(maxHr); maxHr = NULL;	// the splitting dimension is maxDiffDim	// now find a exemplar as close to the arithmetic middle as possible	double middle = (maxDiff / 2.0) + minHr[maxDiffDim];	IKDTreeDomain* exemplar = NULL;	double exemMinDiff = Double_PositiveInfinity;		free(minHr); minHr=NULL;	int l;	for(l=0; l<ArrayList_Count(exset); l++) {		IKDTreeDomain* dom = (IKDTreeDomain*) ArrayList_GetItem(exset, l);		double curDiff = abs (IKDTreeDomain_GetDimensionElement (dom, maxDiffDim) - middle);		if (curDiff < exemMinDiff) {			exemMinDiff = curDiff;			exemplar = dom;		}	}	free(diffHr); diffHr = NULL;	// return the values	*splitDim = maxDiffDim;		return (exemplar);}
开发者ID:BangL,项目名称:android_external_Focal,代码行数:73,


示例27: CreateNamedPipeA

HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances,						DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes){	int index;	HANDLE hNamedPipe = INVALID_HANDLE_VALUE;	char* lpPipePath;	struct sockaddr_un s;	WINPR_NAMED_PIPE* pNamedPipe = NULL;	int serverfd = -1;	NamedPipeServerSocketEntry* baseSocket = NULL;	if (!lpName)		return INVALID_HANDLE_VALUE;	InitWinPRPipeModule();	pNamedPipe = (WINPR_NAMED_PIPE*) calloc(1, sizeof(WINPR_NAMED_PIPE));	if (!pNamedPipe)		return INVALID_HANDLE_VALUE;	WINPR_HANDLE_SET_TYPE(pNamedPipe, HANDLE_TYPE_NAMED_PIPE);	if (!(pNamedPipe->name = _strdup(lpName)))		goto out;	if (!(pNamedPipe->lpFileName = GetNamedPipeNameWithoutPrefixA(lpName)))		goto out;	if (!(pNamedPipe->lpFilePath = GetNamedPipeUnixDomainSocketFilePathA(lpName)))		goto out;	pNamedPipe->dwOpenMode = dwOpenMode;	pNamedPipe->dwPipeMode = dwPipeMode;	pNamedPipe->nMaxInstances = nMaxInstances;	pNamedPipe->nOutBufferSize = nOutBufferSize;	pNamedPipe->nInBufferSize = nInBufferSize;	pNamedPipe->nDefaultTimeOut = nDefaultTimeOut;	pNamedPipe->dwFlagsAndAttributes = dwOpenMode;	pNamedPipe->clientfd = -1;	pNamedPipe->ServerMode = TRUE;	ArrayList_Lock(g_NamedPipeServerSockets);	for (index = 0; index < ArrayList_Count(g_NamedPipeServerSockets); index++)	{		baseSocket = (NamedPipeServerSocketEntry*) ArrayList_GetItem(						 g_NamedPipeServerSockets, index);		if (!strcmp(baseSocket->name, lpName))		{			serverfd = baseSocket->serverfd;			//WLog_DBG(TAG, "using shared socked resource for pipe %p (%s)", pNamedPipe, lpName);			break;		}	}	/* If this is the first instance of the named pipe... */	if (serverfd == -1)	{		/* Create the UNIX domain socket and start listening. */		if (!(lpPipePath = GetNamedPipeUnixDomainSocketBaseFilePathA()))			goto out;		if (!PathFileExistsA(lpPipePath))		{			CreateDirectoryA(lpPipePath, 0);			UnixChangeFileMode(lpPipePath, 0xFFFF);		}		free(lpPipePath);		if (PathFileExistsA(pNamedPipe->lpFilePath))		{			DeleteFileA(pNamedPipe->lpFilePath);		}		if ((serverfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)		{			WLog_ERR(TAG, "CreateNamedPipeA: socket error, %s", strerror(errno));			goto out;		}		ZeroMemory(&s, sizeof(struct sockaddr_un));		s.sun_family = AF_UNIX;		strcpy(s.sun_path, pNamedPipe->lpFilePath);		if (bind(serverfd, (struct sockaddr*) &s, sizeof(struct sockaddr_un)) == -1)		{			WLog_ERR(TAG, "CreateNamedPipeA: bind error, %s", strerror(errno));			goto out;		}		if (listen(serverfd, 2) == -1)		{			WLog_ERR(TAG, "CreateNamedPipeA: listen error, %s", strerror(errno));			goto out;		}		UnixChangeFileMode(pNamedPipe->lpFilePath, 0xFFFF);		if (!(baseSocket = (NamedPipeServerSocketEntry*) malloc(sizeof(NamedPipeServerSocketEntry))))			goto out;//.........这里部分代码省略.........
开发者ID:matthew-n,项目名称:FreeRDP,代码行数:101,


示例28: RefineKeypoints

// selectMiddlePoint: if true, select the middle point in the patch,//   otherwise build the mean// neverLosePoints: if true, and if we cannot do the refinement, still use//   the control point.void RefineKeypoints (ArrayList* msList,		bool selectMiddlePoint, bool neverLosePoints){	DisplayImage* pic1 = NULL;	DisplayImage* pic2 = NULL;	char* pic1Name = NULL;	char* pic2Name = NULL;	/* Keep stats for the refineHandler delegate	 */	int totalRefines = 0;	int doneRefines = 0;	int i;	for(i=0; i<ArrayList_Count(msList); i++) {		MatchSet* ms = (MatchSet*) ArrayList_GetItem(msList, i);		int j;		for(j=0; j<ArrayList_Count(ms->matches); j++) {			ArrayList_GetItem(ms->matches, j);			totalRefines += 1;		}	} 	for(i=0; i<ArrayList_Count(msList); i++) {		MatchSet* ms = (MatchSet*) ArrayList_GetItem(msList, i);		WriteLine ("  between /"%s/" and /"%s/"",			   ms->file1, ms->file2);				if (pic1Name != ms->file1) {			pic1Name = ms->file1;			pic1 = DisplayImage_new (ms->file1);		}		if (pic2Name != ms->file2) {			pic2Name = ms->file2;			pic2 = DisplayImage_new (ms->file2);		}		/*WriteLine ("pair: %s, %s, %d keypoint matches",		  ms->file1, ms->file2, ArrayList_Count(ms->Matches));*/				ArrayList* refinedMatches = ArrayList_new0 (NULL);		int j;		for(j=0; j<ArrayList_Count(ms->matches); j++) {			Match* m = (Match*) ArrayList_GetItem(ms->matches, j);			int p1x = (int) (m->kp1->x + 0.5);			int p1y = (int) (m->kp1->y + 0.5);			int p1radius;			DisplayImage* patch1 = ExtractPatch (pic1, p1x, p1y,							    m->kp1->scale, &p1radius);			int p2x = (int) (m->kp2->x + 0.5);			int p2y = (int) (m->kp2->y + 0.5);			int p2radius;			DisplayImage* patch2 = ExtractPatch (pic2, p2x, p2y,							     m->kp2->scale, &p2radius);			/* Call the refine handler delegate in case there is one to			 * inform the callee of a single refining step (for progress			 * bar displays and such).			 */			doneRefines += 1;			if (refineHandler != NULL)				refineHandler (doneRefines, totalRefines);			// Skip over keypoint matches we cannot refine as part of the			// image lies outside.			if (patch1 == NULL || patch2 == NULL) {				if (neverLosePoints)					ArrayList_AddItem(refinedMatches, m);                                DisplayImage_delete(patch1);                                DisplayImage_delete(patch2);				continue;			}			// Otherwise, run the SIFT algorithm on both small patches.			ArrayList* p1kp = ExtractKeypoints (patch1);			ArrayList* p2kp = ExtractKeypoints (patch2);			/*WriteLine ("p1kp = %d, p2kp = %d", ArrayList_Count(p1kp),			  ArrayList_Count(p2kp));*/						// Apply the matching, RANSAC enabled.			MultiMatch* mm = MultiMatch_new0 ();			mm->verbose = false;			ArrayList* matches = NULL;			matches = MultiMatch_TwoPatchMatch (mm, p1kp,							    patch1->width, patch1->height, p2kp, patch2->width,							    patch2->height, true);                        DisplayImage_delete(patch1);                        DisplayImage_delete(patch2);			/* In case there are less than three keypoints in the			 * two patches, we ignore them all.			 */			if (0 /*was exception ???*/ ) { //.........这里部分代码省略.........
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:101,


示例29: x11_shadow_screen_grab

int x11_shadow_screen_grab(x11ShadowSubsystem* subsystem){	int count;	int status;	int x, y;	int width, height;	XImage* image;	rdpShadowScreen* screen;	rdpShadowServer* server;	rdpShadowSurface* surface;	RECTANGLE_16 invalidRect;	RECTANGLE_16 surfaceRect;	const RECTANGLE_16 *extents;	server = subsystem->server;	surface = server->surface;	screen = server->screen;	count = ArrayList_Count(server->clients);	if (count < 1)		return 1;	surfaceRect.left = 0;	surfaceRect.top = 0;	surfaceRect.right = surface->width;	surfaceRect.bottom = surface->height;	XLockDisplay(subsystem->display);	/*	 * Ignore BadMatch error during image capture. The screen size may be 	 * changed outside. We will resize to correct resolution at next frame	 */	XSetErrorHandler(x11_shadow_error_handler_for_capture);	if (subsystem->use_xshm)	{		image = subsystem->fb_image;		XCopyArea(subsystem->display, subsystem->root_window, subsystem->fb_pixmap,				subsystem->xshm_gc, 0, 0, subsystem->width, subsystem->height, 0, 0);		status = shadow_capture_compare(surface->data, surface->scanline, surface->width, surface->height,				(BYTE*) &(image->data[surface->width * 4]), image->bytes_per_line, &invalidRect);	}	else	{		image = XGetImage(subsystem->display, subsystem->root_window,					surface->x, surface->y, surface->width, surface->height, AllPlanes, ZPixmap);		if (!image)		{			/*			 * BadMatch error happened. The size may have been changed again.			 * Give up this frame and we will resize again in next frame 			 */			goto fail_capture;		}		status = shadow_capture_compare(surface->data, surface->scanline, surface->width, surface->height,				(BYTE*) image->data, image->bytes_per_line, &invalidRect);	}	/* Restore the default error handler */	XSetErrorHandler(NULL);	XSync(subsystem->display, False);	XUnlockDisplay(subsystem->display);	region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect);	region16_intersect_rect(&(surface->invalidRegion), &(surface->invalidRegion), &surfaceRect);	if (!region16_is_empty(&(surface->invalidRegion)))	{		extents = region16_extents(&(surface->invalidRegion));		x = extents->left;		y = extents->top;		width = extents->right - extents->left;		height = extents->bottom - extents->top;		freerdp_image_copy(surface->data, PIXEL_FORMAT_XRGB32,				surface->scanline, x, y, width, height,				(BYTE*) image->data, PIXEL_FORMAT_XRGB32,				image->bytes_per_line, x, y, NULL);		//x11_shadow_blend_cursor(subsystem);		count = ArrayList_Count(server->clients);		shadow_subsystem_frame_update((rdpShadowSubsystem *)subsystem);		if (count == 1)		{			rdpShadowClient* client;			client = (rdpShadowClient*) ArrayList_GetItem(server->clients, 0);//.........这里部分代码省略.........
开发者ID:DavBfr,项目名称:FreeRDP,代码行数:101,


示例30: WritePTOFile

void WritePTOFile (FILE* pto, MultiMatch* mm,		   ArrayList* msList, BondBall* bb, int generateHorizon, bool integerCoordinates,		   bool useAbsolutePathnames){	fprintf(pto, "# Hugin project file/n");	fprintf(pto, "# automatically generated by autopano-sift, available at/n");	fprintf(pto, "# http://cs.tu-berlin.de/~nowozin/autopano-sift//n/n");	fprintf(pto, "p f2 w3000 h1500 v360  n/"JPEG q90/"/n");	fprintf(pto, "m g1 i0/n/n");		int imageIndex = 0;	HashTable* imageNameTab = HashTable_new0 (NULL, NULL);	ArrayList* resolutions = ArrayList_new0 (Resolution_delete);	int i;	for(i=0; i<ArrayList_Count(mm->keySets); i++) {		KeypointXMLList* kx = (KeypointXMLList*) ArrayList_GetItem(mm->keySets, i);		HashTable_AddItem(imageNameTab, kx->imageFile, (void*)imageIndex);		ArrayList_AddItem(resolutions, Resolution_new (kx->xDim, kx->yDim));				char*  imageFile = kx->imageFile;				// If the resolution was already there, use the first image with		// the exact same resolution as reference for camera-related		// values.				int refIdx;		for (refIdx = 0 ; refIdx < (ArrayList_Count(resolutions) - 1) ; ++refIdx) {			if (Resolution_CompareTo((Resolution*) ArrayList_GetItem(resolutions, refIdx), kx->xDim, kx->yDim) == 0)				break;		}		if (refIdx == (ArrayList_Count(resolutions) - 1))			refIdx = -1;				Position* pos = bb == NULL ? NULL :			(Position*) HashTable_GetItem(bb->positions, imageFile);		/*		  if (pos != NULL) {		  WriteLine ("yaw %g, pitch %g, rotation %g",		  pos->yaw, pos->pitch, pos->rotation);		  }*/		double yaw = 0.0, pitch = 0.0, rotation = 0.0;		if (pos != NULL) {			yaw = pos->yaw;			pitch = pos->pitch;			rotation = pos->rotation;		}				if (imageIndex == 0 || refIdx == -1) {			fprintf(pto, "i w%d h%d f0 a0 b-0.01 c0 d0 e0 p%g r%g v180 y%g  u10 n/"%s/"/n",				kx->xDim, kx->yDim, pitch, rotation, yaw, imageFile);		} else {			fprintf(pto, "i w%d h%d f0 a=%d b=%d c=%d d0 e0 p%g r%g v=%d y%g  u10 n/"%s/"/n",				kx->xDim, kx->yDim, refIdx, refIdx, refIdx, pitch, rotation, refIdx, yaw, imageFile);		}		imageIndex += 1;	}		fprintf(pto, "/nv p1 r1 y1/n/n");		fprintf(pto, "# match list automatically generated/n");	int j;	for(j=0; j<ArrayList_Count(msList); j++) {		MatchSet* ms = (MatchSet*) ArrayList_GetItem(msList, j);		int k;		for(k=0; k<ArrayList_Count(ms->matches); k++) {			Match* m = (Match*) ArrayList_GetItem(ms->matches, k);			if (integerCoordinates == false) {				fprintf(pto, "c n%d N%d x%.6f y%.6f X%.6f Y%.6f t0/n",					(int)HashTable_GetItem(imageNameTab, ms->file1), (int)HashTable_GetItem(imageNameTab, ms->file2),					m->kp1->x, m->kp1->y, m->kp2->x, m->kp2->y);			} else {				fprintf(pto, "c n%d N%d x%d y%d X%d Y%d t0/n",					(int)HashTable_GetItem(imageNameTab, ms->file1), (int)HashTable_GetItem(imageNameTab, ms->file2),					(int) (m->kp1->x + 0.5), (int) (m->kp1->y + 0.5),					(int) (m->kp2->x + 0.5), (int) (m->kp2->y + 0.5));			}		}	}		// Generate horizon if we should	if (bb != NULL && generateHorizon > 0) {		WriteLine ("Creating horizon...");				int kMain = 2;		int hPoints = generateHorizon;		int horizonPointsMade = 0;		bool hasGood = true;		while (hPoints > 0 && hasGood) {			hasGood = false;			int kStep = 2 * kMain;			int p;			for (p = 0 ; hPoints > 0 && p < kMain ; ++p) {				double stepSize = ((double) ArrayList_Count(bb->firstRow)) / ((double) kStep);				double beginIndex = p * stepSize;				double endIndex = (((double) ArrayList_Count(bb->firstRow)) / (double) kMain) +					p * stepSize;//.........这里部分代码省略.........
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:101,



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


C++ ArrayList_GetItem函数代码示例
C++ ArrayHelper函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。