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

stegano

parent 24ab992d
...@@ -114,6 +114,8 @@ namespace S04_Projet ...@@ -114,6 +114,8 @@ namespace S04_Projet
return (Operation)choosenItem; return (Operation)choosenItem;
} }
#region Operations
public static MyImage PerformOperation(Operation ope, MyImage img) public static MyImage PerformOperation(Operation ope, MyImage img)
{ {
MyImage output = null; MyImage output = null;
...@@ -344,6 +346,8 @@ namespace S04_Projet ...@@ -344,6 +346,8 @@ namespace S04_Projet
return null; return null;
} }
#endregion
public unsafe static MyImage CreateImageOperation() public unsafe static MyImage CreateImageOperation()
{ {
Options opt = new Options Options opt = new Options
......
...@@ -652,6 +652,33 @@ namespace S04_Projet ...@@ -652,6 +652,33 @@ namespace S04_Projet
return new MyImage(opt, newRPixel, newGPixel, newBPixel); 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) private byte ToByte(int i)
{ {
if (i > 255) return 255; if (i > 255) return 255;
......
...@@ -6,7 +6,6 @@ namespace S04_Projet ...@@ -6,7 +6,6 @@ namespace S04_Projet
{ {
class Program class Program
{ {
//public static bool MULTITHREADING_LOAD = false;
public static bool MULTITHREADING = false; public static bool MULTITHREADING = false;
public static int MAX_THREADS = Environment.ProcessorCount; public static int MAX_THREADS = Environment.ProcessorCount;
public static bool DEBUG = false; public static bool DEBUG = false;
...@@ -20,6 +19,10 @@ namespace S04_Projet ...@@ -20,6 +19,10 @@ namespace S04_Projet
static void Main(string[] args) static void Main(string[] args)
{ {
MyImage img = new MyImage("img/coco.bmp");
img.Steganography("message");
Console.Read();
/*
#region Arguments #region Arguments
if (args.Length > 0) if (args.Length > 0)
{ {
...@@ -62,7 +65,7 @@ namespace S04_Projet ...@@ -62,7 +65,7 @@ namespace S04_Projet
Console.WriteLine("Image sauvegardée en {0}ms!", Display.elapsedTime); Console.WriteLine("Image sauvegardée en {0}ms!", Display.elapsedTime);
Console.Read(); Console.Read();
} }
#endregion #endregion */
} }
private static void Arguments(string[] args, int i) 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