mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-27 22:11:39 +00:00
delete ManagedImage_Texture2D_conversions test
This commit is contained in:
committed by
alexiscatnip
parent
21bee35367
commit
3308e2d410
@@ -74,63 +74,5 @@ namespace Tests.Raindrop
|
||||
Debug.Log($"read : in StreamingAssets, - {_inputImageSubPath} ");
|
||||
|
||||
}
|
||||
|
||||
|
||||
// [UnityTest]
|
||||
// // managedimage -> texture2d -> managed image test
|
||||
// /* 1. create managedimage 2x2 red-blue-green- black image by code.
|
||||
// * 2. call convert to texture2d.
|
||||
// * 3. print to screen.
|
||||
// * 4. convert back to managed image.
|
||||
// * 5. print to disk.
|
||||
// */ //weird ass test
|
||||
// public IEnumerator ManagedImage_Texture2D_conversions()
|
||||
// {
|
||||
// //1 load the image using unity's texture 2d (known to be correct.).
|
||||
// var tex = new Texture2D(1024,1024);
|
||||
// var b = File.ReadAllBytes("C:\\Users\\Alexis\\Pictures\\menhara.jpg");
|
||||
// tex.LoadImage(b);
|
||||
// // OpenMetaverse.Imaging.LoadTGAClass.LoadTGA(
|
||||
// // "C:\\Users\\Alexis\\Pictures\\menhara.tga");
|
||||
//
|
||||
//
|
||||
//
|
||||
// //1b. check image loading integrity.
|
||||
// // var bytesa = tex.EncodeToJPG(100);
|
||||
// // System.IO.File.WriteAllBytes(Path.Combine(Application.persistentDataPath, "menhara_from_t2d.jpg"), bytesa);
|
||||
// // mi.Blue[2] = 0xFF;
|
||||
// // mi.Red[0] = 0xFF;
|
||||
// // mi.Green[1] = 0xFF;
|
||||
// // // mi.Blue = new byte[]{0x00,0x00,0xFF,0x00};
|
||||
// // mi.Red = new byte[]{0xFF,0x00,0x00,0x00};
|
||||
// // mi.Green = new byte[]{0x00,0xFF,0x00,0x00};
|
||||
//
|
||||
// //2 print mi to disk in some easy to read format.
|
||||
// // error! this image is written to disk upside down!.
|
||||
// ManagedImage mi = new ManagedImage(tex);
|
||||
// var tgaBytes = mi.ExportTGA();
|
||||
// Debug.Log("writing to "+ Path.Combine(Application.persistentDataPath, "exportTGA_managed_image1.tga").ToString());
|
||||
// System.IO.File.WriteAllBytes(Path.Combine(Application.persistentDataPath, "exportTGA_managed_image1.tga"), tgaBytes);
|
||||
//
|
||||
// //3. convert to t2d and show on screen.
|
||||
// Texture2D t2d = mi.ExportTex2D();
|
||||
// // plane.make
|
||||
// // plane.show(t2d)
|
||||
//
|
||||
// var bytes = t2d.EncodeToJPG(100);
|
||||
// System.IO.File.WriteAllBytes(Path.Combine(Application.persistentDataPath, "EncodeToJPG_Texture2d.jpg"), bytes);
|
||||
//
|
||||
// yield return new WaitForSeconds(1);
|
||||
//
|
||||
// //4. convert back to tga, save it as a 2nd file.
|
||||
// ManagedImage mi2 = new ManagedImage(t2d);
|
||||
// // error:this method writes a up-side down image.
|
||||
// var tgaBytes2 = mi2.ExportTGA();
|
||||
// System.IO.File.WriteAllBytes(Path.Combine(Application.persistentDataPath, "exportTGA_managedimage2.tga"), tgaBytes2);
|
||||
//
|
||||
// Assert.Pass();
|
||||
// yield break;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user