Commit ceb25754 authored by BORNON Théophile's avatar BORNON Théophile

stegano

parent 24ab992d
......@@ -114,6 +114,8 @@ namespace S04_Projet
return (Operation)choosenItem;
}
#region Operations
public static MyImage PerformOperation(Operation ope, MyImage img)
{
MyImage output = null;
......@@ -343,6 +345,8 @@ namespace S04_Projet
return null;
}
#endregion
public unsafe static MyImage CreateImageOperation()
{
......
......@@ -652,6 +652,33 @@ namespace S04_Projet
return new MyImage(opt, newRPixel, newGPixel, newBPixel);
}
public unsafe MyImage Steganography(string sentence)
{
Options options = opt.Copy();
int size = opt.height * opt.width;
byte _temp;
byte[] newRPixel = new byte[size];
byte[] newGPixel = new byte[size];
byte[] newBPixel = new byte[size];
fixed (byte* newRPixePtr = newRPixel, newGPixePtr = newGPixel, newBPixePtr = newBPixel)
{
fixed (byte* rPtr = rPixels, gPtr = gPixels, bPtr = bPixels)
{
for (int i = 0; i < sentence.Length; i++)
{
_temp = (byte)sentence[i];
for (int j = 0; j < 8; j++)
{
}
Console.Write(" ");
}
}
}
return null;
}
private byte ToByte(int i)
{
if (i > 255) return 255;
......
......@@ -6,7 +6,6 @@ namespace S04_Projet
{
class Program
{
//public static bool MULTITHREADING_LOAD = false;
public static bool MULTITHREADING = false;
public static int MAX_THREADS = Environment.ProcessorCount;
public static bool DEBUG = false;
......@@ -20,6 +19,10 @@ namespace S04_Projet
static void Main(string[] args)
{
MyImage img = new MyImage("img/coco.bmp");
img.Steganography("message");
Console.Read();
/*
#region Arguments
if (args.Length > 0)
{
......@@ -62,7 +65,7 @@ namespace S04_Projet
Console.WriteLine("Image sauvegardée en {0}ms!", Display.elapsedTime);
Console.Read();
}
#endregion
#endregion */
}
private static void Arguments(string[] args, int i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment