Hi,
I checked the code related to the shading and studied the pdf spec
related
to the type 6. As I see it is going same as the type 4
From what I feel this is need to be done correct me if I'm wrong
first need to get the 12 control points and colors related to each unit
from stream
Yes
create the 4 cubic Bézier curves which are boundaries of each patch (
to
find a Bézier curve it need 4 control points, two points are part of the
curve )
Yes, although they are not painted as a curve, the curve is part of a
formula to find out whether a point is inside or outside the patch.
given point need to find the point which patch (I think this can be
done[1]<http://en.wikipedia.org/wiki/Plane_%28geometry%29>but need
research on that)
find the color of the point using bi linear interpolation
Probably. Although I'm not sure if the bilinear interpolation is the
same
as used for a rectangle.
http://www.particleincell.com/blog/2012/quad-interpolation/
I also don't know if the curves needs to be taken into account.
This has the same structure as the other shading types but need to
structure to keep Bézier curves and patches
and patches are connected as in the type4
Yes, the data structure is similar. You can use existing code and do
lot
of copy & paste there, although there is some rearrangement needed as
there
are more points.
I have to study the type 7 but I think its similar to this
According to the spec, type 6 is a special case of type 7. I cannot
tell
whether it is enough to implement type 7 only and derive type 6 from it,
i.e. I don't know if the performance would be worse.
Tilman
please give feedback on my approach
[1]http://en.wikipedia.org/wiki/Plane_%28geometry%29<http
://en.wikipedia.org/wiki/Plane_%28geometry%29>
On Sun, Mar 2, 2014 at 11:18 AM, Thimal Kempitiya <[email protected]
wrote:
yeah I'm using trunk code(2.0) and I wanted to render the image got
it,
thanks. I'm currently studying the 1 to 5 shading implementations and
the
pdf spec related to 6 and 7 type shading and i'll buzz you if i got
issue.
Once again thanks for quick reply
On Sat, Mar 1, 2014 at 2:38 AM, John Hewson <[email protected]> wrote:
You'll need to use the latest 2.0.0 snapshot jar, which is the
unstable
version from trunk
and the place where new development occurs.
-- John
On 28 Feb 2014, at 05:04, Thimal Kempitiya <[email protected]>
wrote:
Hi,
I'm Thimal Kempitiya, third year computer science and engineering
undergraduate at university of moratuwa. I'm interested in the
project
idea
"implement shading with Coons and tensor-product patch meshes". I
have
the
basic knowledge about the cubic Bézier curves", , "bilinear
interpolation",
" and "Bernstein polynomials and i think can manage rest of the
mathematics
needed for this project. Also I have the java knowledge to do the
implementation part.
I clone the PDFBOX repository and checked the code regarding to the
shading
and I tried some examples in pdfbox cook book.
Also I tried code to work with the type 1 shading type.
File f=new File("C:\\asy-latticeshading.pdf");
try {
PDDocument doc=PDDocument.load(f);
PDPage p;
p=(PDPage)doc.getDocumentCatalog().getAllPages().get(0);
PDShadingType1 pdst1=new PDShadingType1(p.
getCOSDictionary());
PDRectangle pdr=p.findCropBox();
PDGraphicsState pdg=new PDGraphicsState(pdr);
Matrix m=pdg.getCurrentTransformationMatrix();
Type1ShadingPaint t1sp=new Type1ShadingPaint(pdst1, m,
(int)p.findCropBox().getHeight());
But this give me error saying unknown shading type 0
java.io.IOException: Error: Unknown shading type 0
can you please tell me what I'm doing wrong here and how can i solve
this.
--
*Thimal Kempitiya <http://www.facebook.com/thimalk>
UndergraduateDepartment
of Computer Science and Engineering University of Moratuwa.*
--
*Thimal Kempitiya <http://www.facebook.com/thimalk>
UndergraduateDepartment of Computer Science and Engineering University
of
Moratuwa.*