PHP ImageJPEG method but for Java - java

I'm looking for a Java solution to this. I need a Java method that behave exactly the same as php IMAGEJPEG method does.
Thanks in advance.

Here is a really good tutorial on saving images in Java http://download.oracle.com/javase/tutorial/2d/images/examples/.
The specific class you want to look at is ImageIO http://download.oracle.com/javase/1.4.2/docs/api/javax/imageio/ImageIO.html
Finally, to adjust quality, take a look at this article http://www.universalwebservices.net/web-programming-resources/java/adjust-jpeg-image-compression-quality-when-saving-images-in-java

Related

`Get List of all PLC Data block by MOKA

I try snap7 project and i find very useful functions. but in java version of snap7 (moka library) some methods is missing.
for example, now, I want to get list of all data block (DB). in c, there is a method (Cli_ListBlocksOfTyp) but I don't know how to do it in moka.
anybody can help me?
The reason is, that not all functions are ported in moka. As you can see in the MOKA overview.
The overview also contains all functions providet by MOKA.
Hope it was helpfull.

Java library for creating 3d-objects for 3d printing

I am looking for a java library to create 3d-geometries and then convert that to .stl files so I can 3d print my object using a 3d printer.
I can imagine using a 3d-graphics object where one can draw the same like on a graphics2d object:
Buffered3DObject obj = new Buffered3DObject(200,200,200, Unit.MM);
Graphics3D g3 = obj.getGraphics();
Stroke3d stroke = new Stroke(3);
g3.setStroke(stroke);
g3.drawpipe(x1,y1,z1,x2,y2,z2);
obj.exportToSTL("filename.stl");
Ok, I am just making up code :). But something like this.
Anybody know how I could pull something like this off? Any opensource libs that does stuff like this?
Would be nice to be able to generate a customized object through user input from a website.
Rob.
Edit:
Even though the question is closed (and nobody cared to answer my question on why) I found my answer (I post it so others with the same question can find it):
There is a java library on its way as a wrapper around OpenScad. The java wrapper is called JavaScad. Can be found here JavaScad
There is a java library which works as a wrapper around OpenScad. The java wrapper is called JavaScad. Can be found here JavaScad. It works fine and I actually contributed to the library already.
JCSG - Java implementation of BSP based CSG (Constructive Solid Geometry)
jsolid - wrapper around JCSG providing fluent API
Another option is: abfab3d.com This is opensourced code from Shapeways. Its is more complex and uses voxels as a base, but can convert to mesh aswell.
The code is at github: abfab3d # github
I have not tried it, but will as the openscad route is slow and difficult to integrate in a webserver, so I will try it once I have time.

Java implementation for LDPC codes

Is there any open source Java implementation for LDPC (Low Density Parity Check) codes, I found only MATLAB codes.
My scenario is I will take text file and divide into block and I will delete some data in text file, and by using LDPC codes I need to recover data from text files.
Thanks.
I haven't tried this but the code here should get you started
http://www.cs.utoronto.ca/~radford/ftp/LDPC-2006-02-08/install.html
http://www.cs.utoronto.ca/~radford/ftp/LDPC-2006-02-08/examples.html
It's in C though. Might be easy to port. Or not.
I'd suggest looking into ways of calling matlab functions in java. I know there are a couple. Also why LDPC? While its one of the best FEC, it involves lots of matrix manipulation if I recall correctly. This is stuff much better suited for mat[rix]lab. The right tool for the right job...
There are also these two pure Java implementations:
https://github.com/a4a881d4/ldpc-java
https://github.com/pierroweb/LDPC-correcting-codes
I haven't tested them and would appreciate feedback from anyone else that has.
There's also a Java wrapper around a C++ library: http://cpham.perso.univ-pau.fr/MULTICAST/Java_wrapper_for_LDPC.html
Not the most promising results, but something to start from, at the very least.

How to print documents using Java?

I have a requirement to print data exactly in a particular position in paper. How can these kind of formatting be done using Java?
Jasper, iText will work for you.
Which kind of data ?
If it's form, the use of reporting library can help you:
http://jasperforge.org/projects/jasperreports
If it's graphic you can try using 'raw' java api:
http://download.oracle.com/javase/tutorial/2d/printing/printable.html
Or use the Java print API:
http://www.ibm.com/developerworks/java/library/j-mer0322/index.html
http://www.ibm.com/developerworks/java/library/j-mer0424.html
If you really need full control, you can print Graphics2D objects directly. See http://java.sun.com/developer/onlineTraining/Programming/JDCBook/render.html and the next page.
Another possibility would be printing PDF, e.g. using iText. I think exact positioning is possible, but probably harder than using Graphics2D.

Java XML Tool using method chaining/builder pattern

I remember that a while ago I found a truly great utility here on StackOverflow for manipulating XML documents with an interface like:
new XMLTool(document)
.goTo("xpath")
.addNode("name")
.addChild()
.addContent("xxx")
.parent()
.remove("oldNode);
Could anybody tell me what tool that was?
Maybe the java-xmlbuilder at Google code? It's indeed great in use.
You've got to be kidding me. It's actually called XMLTool.
I must've had a brainfart while searching for it!
This is the URL: http://code.google.com/p/xmltool/
At least the next time someone searches for method chaining XML tool he'll find this post ...

Categories

Resources