Tilman Hausherr created PDFBOX-1915:
---------------------------------------

             Summary: Implement shading with Coons and tensor-product patch 
meshes
                 Key: PDFBOX-1915
                 URL: https://issues.apache.org/jira/browse/PDFBOX-1915
             Project: PDFBox
          Issue Type: Improvement
          Components: Rendering
    Affects Versions: 2.0.0
            Reporter: Tilman Hausherr


Of the seven shading methods described in the PDF specification, type 6 (Coons 
patch meshes) and type 7 (Tensor-product patch meshes) haven't been 
implemented. I have done type 4 and 5, but I don't know the math for type 6 and 
7. My math days are decades away.

Knowledge prerequisites: 
- java, although you don't have to be a java ace, just feel confortable
- math: you should know what "cubic Bézier curves", "Degenerate Bézier curves, 
"bilinear interpolation", "tensor-product", "affine transform matrix" and 
"Bernstein polynomials" are, or be able to learn it
- maven (basic)
- svn (basic)
- an IDE like Netbeans or Eclipse or IntelliJ (basic)
- ideally, you are either a math student who likes to program, or a computer 
science student who is specializing in graphics.

You are not starting from scratch. The implementation of type 4 and 5 shows you 
how to do the basics (read the parameters from the PDF, set the graphics), 
except for the math. You don't have to learn the complete PDF spec, only 15 
pages related to the two shading types, and 6 pages about shading in general. 
The PDF specification is here:
http://www.adobe.com/devnet/pdf/pdf_reference.html

The tricky parts are:
- decide whether a point(x,y) is inside or outside a patch
- decide the color of a point within the patch

To get an idea about the code, look at the classes GouraudTriangle, 
GouraudShadingContext, Type4ShadingContext and Vertex here
https://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/
or download the whole project from the repository.

Testing:
I will attach several example PDFs. To see which one has which shading, open 
them with an editor like NOTEPAD++, and search for "/ShadingType" (without the 
quotes). If your images are rendering like the example PDFs, then you were 
successful.

Optional:
Review and optimize the complete shading package

Mentor: Tilman Hausherr (European timezone, languages: german, english, french)




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to