Donate Share

PDF Clown

Subscribe

Extending PDFClown

You are viewing a single message from this topic. View all messages.

  1. 2009-07-16 20:42:50 UTC
    Hi Piotr,
    unfortunately, special color spaces (as you can see here [1]) have currently a low implementation priority, so the best I can do at the moment is to suggest you some hints to accomplish your task.

    PDF Clown's color space model is inside the it.stefanochizzolini.clown.documents.contents.colorSpaces namespace [2]; in accordance with the official PDF specification, there are 2 classes to provide when you intend to support a new color space:
    - a color space, that is the abstract definition of a color system;
    - a color value, that is the abstract definition of a color instance expressed within the domain of a corresponding color space.

    Color value objects are typically used within content streams as the parameters of color operators to describe the current color applied on the page canvas to draw, for example, lines; color space objects are associated to color value objects to describe their actual meaning.

    In order to implement your DeviceN color space you have to inherit your color space class from the abstract ColorSpace class [3] and your color value class from the abstract Color class [4]. To get inspired you may peer through the existing color space implementations (particularly device-based ones).
    Remember that document-level classes (i.e. all those inside the documents.* subnamespace, such as Color- and ColorSpace-based classes) are high-level wrappers (actually extending PdfObjectWrapper class [5]) of base PDF types; this means that your DeviceNColorSpace will wrap a PDF array (PdfArray [6] as modelled by PDF Clown).
    Remember also to add your constructor to the ColorSpace.wrap() factory method.

    If you succeed, please consider donating your implementation to the project trunk: I'll cite you in the source code and project credits.

    Thank you and good luck! :-)
    Stefano

    [1] http://clown.stefanochizzolini.it/devel/status.html#Specification
    [2] http://clown.sourceforge.net/API/it/stefanochizzolini/clown/documents/contents/colorSpaces/package-summary.html
    [3] http://clown.sourceforge.net/API/it/stefanochizzolini/clown/documents/contents/colorSpaces/ColorSpace.html
    [4] http://clown.sourceforge.net/API/it/stefanochizzolini/clown/documents/contents/colorSpaces/Color.html
    [5] http://clown.sourceforge.net/API/it/stefanochizzolini/clown/objects/PdfObjectWrapper.html
    [6] http://clown.sourceforge.net/API/it/stefanochizzolini/clown/objects/PdfArray.html
< Previous | 1 | Next >

Add a Reply

You can use Markdown syntax in your reply.

Preview

Monitor this

Log in to monitor this topic. Not registered? Create an account to receive email updates when replies are posted to this topic. If you do not log in or register, your reply will be added anonymously.