两种纹理合成算法的实现源代码


包括两种合成方式,像块合成及像素合成。一种是Li-Yi Wei的像素算法,一种是Freeman的像块合成算法。
资源截图
代码片段和文件信息
#include “Cclist.h“
#include 
#include 
#include 

ccMinNode::ccMinNode()
{
next = (ccMinNode *)LIST_MAGIC;
prev = (ccMinNode *)LIST_MAGIC; 
}

ccMinNode::ccMinNode(const ccMinNode &)
{
{
next = (ccMinNode *)LIST_MAGIC;
prev = (ccMinNode *)LIST_MAGIC; 
}
}

ccMinNode::~ccMinNode()
{
}

ccNode::ccNode(void)
{
name = 0;
nameHash = 0;
}


ccNode::~ccNode(void)
{
if(name)
delete [] name;
}


//****************************************************************************
// The behaviour of this function is this: If NULL is passed the current name
// (if any) is cleared and nothing else happens.
// Otherwise the old name is cleared and the new name is set.
//****************************************************************************

BOOL ccNode::SetName(const char *theName)
{
BOOL retval = FALSE;
size_t  Len;

if(name)
{
delete [] name;  // Get rid of the old one first if any.
name = 0;
}

if(theName)
{
Len = strlen(theName);
name = new char[Len+1];

if(name)
{
strcpy(nametheName);

//--Compute a hash value for the name-------
nameHash = CalcHash(theName);
retval = TRUE;
}
}

return(retval);
}

ccMinList::ccMinList()
{
head = tail = 0;
numElements = 0;
}

ccMinList::~ccMinList()
{
Purge();
}

void ccMinList::AddNode(ccMinNode *insertpoint ccMinNode *node)
{
// Make sure that there is a node.
assert(node != 0);

// Make sure that this node isn‘t already in a list.
assert(node->next == (ccNode *)LIST_MAGIC && node->prev == (ccNode *)LIST_MAGIC);

if(node)
{
if(insertpoint)
{
node->next = insertpoint->next;
if( node->next )
node->next->prev = node;

node->prev = insertpoint;
insertpoint->next = node;
}
else  // If no insert point is being passed it is assumed that you want the head of the list.
{
node->next = head;
if( node->next )
node->next->prev = node;

node->prev = 0;
head = node;
}

if(tail == insertpoint)
tail = node;  // update the tail pointer.


assert(head != (ccNode *)LIST_MAGIC && tail != (ccNode *)LIST_MAGIC);

numElements++;
}
}



BOOL ccMinList::IsInList(ccMinNode *node) const
{
BOOL isthere = FALSE;
ccMinNode *c;

c = GetHead();

while(c)
{
if(c == node)
{
isthere = TRUE;
c = 0;
}
else
c = c->GetNext();
}

return(isthere);
}

long ccMinList::ElementNumber(ccMinNode *node)
{
long  Index = 0;
ccMinNode *c;

c = GetHead();

while(c)
{
if(c == node)
return Index;
else
c = c->GetNext();

Index++;
}

return -1;
}


// This routine should never really be called with a null ‘node‘ pointer. However it deals with this
// case properly.

ccMinNode *ccMinList::RemNode(ccMinNode *node)
{
if(node)
{

assert( (node->next != (ccMinNode *)LIST_MAGIC) && (node->prev != (ccMinNode *)LIST_MAGI

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      12342  2008-12-07 16:10  可执行文件lock synthesis.bmp

     文件      34506  2008-12-15 22:18  可执行文件lock synthesis1.bmp

     文件      68502  2008-12-15 22:19  可执行文件lock synthesis2.bmp

     文件      49206  2008-12-15 22:21  可执行文件lock synthesis3.bmp

     文件      49206  2008-12-15 22:26  可执行文件lock synthesis4.bmp

     文件     110646  2008-12-15 22:27  可执行文件lock synthesis5.bmp

     文件      82134  2008-12-16 17:27  可执行文件lock synthesis7.bmp

     文件     110646  2008-11-19 09:42  可执行文件lock synthesis8.bmp

     文件      49206  2008-12-15 22:47  可执行文件lock synthesis
0.bmp

     文件     137070  2008-12-15 22:19  可执行文件lock synthesis
1.bmp

     文件     273846  2008-12-15 22:25  可执行文件lock synthesis
2.bmp

     文件     196662  2008-12-15 22:23  可执行文件lock synthesis
3.bmp

     文件     196662  2008-12-15 22:27  可执行文件lock synthesis
4.bmp

     文件     442422  2008-12-15 22:30  可执行文件lock synthesis
5.bmp

     文件     327158  2008-12-16 17:28  可执行文件lock synthesis
7.bmp

     文件     442422  2008-12-17 21:54  可执行文件lock synthesis
8.bmp

     文件      61952  2008-12-17 12:17  可执行文件lock synthesisRelease exture Synthesis.exe

    ..A.SH.    125952  2008-12-23 19:56  可执行文件lock synthesisThumbs.db

     文件      12342  2008-12-07 16:10  可执行文件pixel synthesis1.bmp

     文件      49206  2008-12-16 15:40  可执行文件pixel synthesis2.bmp

     文件      49206  2008-12-16 15:36  可执行文件pixel synthesis3.bmp

     文件      49206  2008-12-16 15:42  可执行文件pixel synthesis4.bmp

     文件      49206  2009-01-19 22:34  可执行文件pixel synthesis
0.bmp

     文件      12342  2009-01-19 22:34  可执行文件pixel synthesis
1.bmp

     文件      49206  2008-12-17 21:49  可执行文件pixel synthesis
1e.bmp

     文件      49206  2009-01-19 22:33  可执行文件pixel synthesis
2.1.bmp

     文件       3126  2009-01-19 22:34  可执行文件pixel synthesis
2.bmp

     文件      49206  2008-12-17 11:52  可执行文件pixel synthesis
3.1.bmp

     文件     196662  2008-12-16 15:56  可执行文件pixel synthesis
3.bmp

     文件     196662  2008-12-16 15:54  可执行文件pixel synthesis
4.bmp

............此处省略89个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)