资源简介
包括两种合成方式,像块合成及像素合成。一种是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 可执行文件\block synthesis\0.bmp
文件 34506 2008-12-15 22:18 可执行文件\block synthesis\1.bmp
文件 68502 2008-12-15 22:19 可执行文件\block synthesis\2.bmp
文件 49206 2008-12-15 22:21 可执行文件\block synthesis\3.bmp
文件 49206 2008-12-15 22:26 可执行文件\block synthesis\4.bmp
文件 110646 2008-12-15 22:27 可执行文件\block synthesis\5.bmp
文件 82134 2008-12-16 17:27 可执行文件\block synthesis\7.bmp
文件 110646 2008-11-19 09:42 可执行文件\block synthesis\8.bmp
文件 49206 2008-12-15 22:47 可执行文件\block synthesis\r0.bmp
文件 137070 2008-12-15 22:19 可执行文件\block synthesis\r1.bmp
文件 273846 2008-12-15 22:25 可执行文件\block synthesis\r2.bmp
文件 196662 2008-12-15 22:23 可执行文件\block synthesis\r3.bmp
文件 196662 2008-12-15 22:27 可执行文件\block synthesis\r4.bmp
文件 442422 2008-12-15 22:30 可执行文件\block synthesis\r5.bmp
文件 327158 2008-12-16 17:28 可执行文件\block synthesis\r7.bmp
文件 442422 2008-12-17 21:54 可执行文件\block synthesis\r8.bmp
文件 61952 2008-12-17 12:17 可执行文件\block synthesis\Release\texture Synthesis.exe
..A.SH. 125952 2008-12-23 19:56 可执行文件\block synthesis\Thumbs.db
文件 12342 2008-12-07 16:10 可执行文件\pixel synthesis\1.bmp
文件 49206 2008-12-16 15:40 可执行文件\pixel synthesis\2.bmp
文件 49206 2008-12-16 15:36 可执行文件\pixel synthesis\3.bmp
文件 49206 2008-12-16 15:42 可执行文件\pixel synthesis\4.bmp
文件 49206 2009-01-19 22:34 可执行文件\pixel synthesis\r0.bmp
文件 12342 2009-01-19 22:34 可执行文件\pixel synthesis\r1.bmp
文件 49206 2008-12-17 21:49 可执行文件\pixel synthesis\r1e.bmp
文件 49206 2009-01-19 22:33 可执行文件\pixel synthesis\r2.1.bmp
文件 3126 2009-01-19 22:34 可执行文件\pixel synthesis\r2.bmp
文件 49206 2008-12-17 11:52 可执行文件\pixel synthesis\r3.1.bmp
文件 196662 2008-12-16 15:56 可执行文件\pixel synthesis\r3.bmp
文件 196662 2008-12-16 15:54 可执行文件\pixel synthesis\r4.bmp
............此处省略89个文件信息
评论
共有 条评论