Initial Commit. Added all the source files. Enjoy ;)
This commit is contained in:
parent
de0ad57063
commit
d6f7eb9591
8 changed files with 877 additions and 0 deletions
51
src/DepthMapNeedle.java
Normal file
51
src/DepthMapNeedle.java
Normal file
|
@ -0,0 +1,51 @@
|
|||
|
||||
|
||||
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.");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue