|
|
About > Process
- Find visual representation
- Search through host
- Obtain consent
- Translate visual representation
- Search for occurrences of "yes" (consent) in the translation
- Create new visual representation
- Use found visual representation as fodder for new piece
- The more instances of "yes" occurring, the more the new piece will be different from found visual representation
- Repeat process
- Stop when entire host has been searched
Process with code excerpts:
- Find visual representation
- Search through host
DirectoryInfo dir = new DirectoryInfo(strDir);
FileInfo[] filesInDir = dir.GetFiles();
int findCount;
foreach(FileInfo file in filesInDir)
{
/*...*/
}
DirectoryInfo[] directories = dir.GetDirectories();
foreach(DirectoryInfo newDir in directories)
{
/*...*/
}
- Obtain consent
- Translate visual representation
FileStream fstrm = new FileStream(fileName, FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(fstrm);
byte[] image = new byte[reader.BaseStream.Length];
for (int i=0; i < reader.BaseStream.Length; i++)
{
image[i]=reader.ReadByte();
}
reader.Close();
fstrm.Close();
string bmpAsString = Base64EncodeBytes(image);
- Search for occurrences of "yes" (consent) in the translation
/*...*/
search="yes";
/*...*/
t.entSearch(path,search);
/*...*/
int count, at, end, start, findCount;
count=0;
findCount = 0;
at=0;
end = bmpAsString.Length;
start = 0;
while ((start-1))
{
count = end - start;
at = bmpAsString.IndexOf(strSearch, start, count);
if (at == -1) break;
findCount++;
start = at+1;
}
return findCount;
/*...*/
public void entSearch(string strDir, string strSearch)
{
/*...*/
findCount = this.entArtwork(dir.ToString() + "\\" + fileName,strSearch );
Console.WriteLine( "\n\nfound material to use: " + fileName + "\n\n");
if (findCount > 0)
{
artisticTechnique(findCount, fileName, dir.ToString());
}
else
{
Console.WriteLine( "\n\nconsent not found\n\n");
}
}
else
{
Console.WriteLine( "\n\n" + fileName + " not acceptable\n\n");
}
}
DirectoryInfo[] directories = dir.GetDirectories();
foreach(DirectoryInfo newDir in directories)
{
string newf = dir.ToString() + "\\" + newDir;
Console.Write("moving to search in: " + newf + "\n\n");
entSearch(newf, strSearch);
}
}
- Create new visual representation
- Use found visual representation as fodder for new piece
Bitmap m_Bitmap = (Bitmap)Bitmap.FromFile(folderName + "\\" + fileName, false);
/*...*/
string newFileName = folderName + "\\" + "entDFP_" + Moment() + "_" + fileName;
Console.WriteLine("created artwork at: " + newFileName);
m_Bitmap.Save(newFileName);
- The more instances of "yes" occurring, the more the new piece will be different from found visual representation
if (findCount >= 20)
{
/*...*/
} else if (findCount >=15)
{
/*...*/
}else if (findCount >=10)
{
/*...*/
}else if (findCount >=5)
{
/*...*/
}
else if (findCount >=0)
{
/*...*/
}
- Repeat process
- Stop when entire host has been searched
|