51 lines
1.5 KiB
Java
51 lines
1.5 KiB
Java
|
|
|
|
public class DepthMapNeedle
|
|
{
|
|
public static void main(String[] args)
|
|
{
|
|
if(args.length==0 || args[0].equals("-h")) help();
|
|
if(args.length >= 2 && args[0].equals("-e"))
|
|
{
|
|
for(int i=1; i<args.length; i++)
|
|
{
|
|
JPEG image = new JPEG(args[i]);
|
|
image.exportDepthMap();
|
|
}
|
|
}
|
|
else if(args.length >=2 && args[0].equals("-s"))
|
|
{
|
|
for(int i=1; i<args.length; i++)
|
|
{
|
|
JPEG image = new JPEG(args[i]);
|
|
image.exportSourceImage();
|
|
}
|
|
}
|
|
else if(args.length >= 3 && args[0].equals("-i"))
|
|
{
|
|
String depthmap = args[1];
|
|
for(int i=2; i<args.length; i++)
|
|
{
|
|
JPEG image = new JPEG(args[i]);
|
|
image.injectDepthMap(depthmap);
|
|
image.save();
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void help()
|
|
{
|
|
System.out.println("Welcome to DepthMapNeedle!"
|
|
+ "\nDepthMapNeedle is a tool to inject or extract depth information in form of depthmaps from photos shot using Google Cameras Blur function."
|
|
+ "\n"
|
|
+ "\nAvailable Options:"
|
|
+ "\n'-e <file1>.jpg ... <fileN>.jpg':"
|
|
+ "\n Extract the depthmap from the specified photo(s). The depthmaps will be stored with the suffix \"_d.png\"."
|
|
+ "\n'-s <file1>.jpg ... <fileN>.jpg':"
|
|
+ "\n Extract the unblurred source image from the photo(s). These files will be stored with the suffix \"_s.jpg\"."
|
|
+ "\n'-i <depthmap>.png <file1>.jpg <fileN>.jpg':"
|
|
+ "\n Inject a png file as Depthmap into the following specified jpg files."
|
|
+ "\n'-h':"
|
|
+ "\n Show this help text.");
|
|
}
|
|
}
|