Hi Emad,

Thanks for the patch! I commited it with one change and one addition.
The change is, I chose the name that was suggested by Leonard. Additionally, I 
added a fourth parameter that allows to specify a range of colors to be 
unmasked, as I needed this before.

So, the code is now:
void PdfImage::SetImageChromaKeyMask(pdf_int64 r, pdf_int64 g, pdf_int64 b, 
pdf_int64 threshold)
{
    PdfArray array;
    array.push_back(r - threshold);
    array.push_back(r + threshold);
    array.push_back(g - threshold);
    array.push_back(g + threshold);
    array.push_back(b - threshold);
    array.push_back(b + threshold);

    this->GetObject()->GetDictionary().AddKey( "Mask", array);
}

Cheers,
        Dominik

Am Montag 13 September 2010 schrieb Leonard Rosenthol:
> Should probably name it SetImageChromaKeyMask since that's what it is
>  doing...
> 
> Leonard
> 
> -----Original Message-----
> From: Emad Steitieh [mailto:[email protected]]
> Sent: Monday, September 13, 2010 11:59 AM
> To: [email protected]; Dominik Seichter
> Subject: Re: [Podofo-users] RightToLeft
> 
> Hi,
> 
> Ok, I will try. I also wrote a function that can set the image transparent
>  color. You just need to specify the transparent color pixels before
>  drawing the image. Here it is:
> 
> 
> void PdfImage::SetImageColorMask(pdf_int64 r, pdf_int64 g, pdf_int64 b)
> {
>       PdfArray array;
>       array.push_back(r);
>       array.push_back(r);
>       array.push_back(g);
>       array.push_back(g);
>       array.push_back(b);
>       array.push_back(b);
>       GetObjectX()->GetDictionary().AddKey( "Mask", array);
> }
> 
> Best Regards,
> Emad Steitieh
> 
> --- On Mon, 9/13/10, Dominik Seichter <[email protected]> wrote:
> > From: Dominik Seichter <[email protected]>
> > Subject: Re: [Podofo-users] RightToLeft
> > To: [email protected]
> > Cc: "Emad Steitieh" <[email protected]>
> > Date: Monday, September 13, 2010, 1:18 PM
> > Hi Emad,
> >
> > This is a very interesting problem. As far as I know, no
> > one tried this before
> > using PoDoFo.
> > I think you should take a look at the PdfPainter::DrawText
> > method. It should
> > be pretty easy to adapt and I think you should be able to
> > provide a
> > PdfPainter::DrawTextRTL method, Maybe you could share it on
> > this list?
> >
> > Cheers,
> >     Dominik
> >
> > Am Samstag 11 September 2010 schrieb Emad Steitieh:
> > > Hi,
> > >
> > > Is there an example to show how to write a
> >
> > right-to-left text such as
> >
> > >  Arabic or Hebrew. I tried writing a text in
> >
> > arabic and the letters came
> >
> > >  reversed and separated.
> > >
> > > Best Regards,
> > > Emad Steitieh
> >
> > -------------------------------------------------------------------------
> >--
> >
> > > --- Start uncovering the many advantages of virtual
> >
> > appliances
> >
> > > and start using them to simplify application
> >
> > deployment and
> >
> > > accelerate your shift to cloud computing
> > > http://p.sf.net/sfu/novell-sfdev2dev
> > > _______________________________________________
> > > Podofo-users mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/podofo-users
> 
> ---------------------------------------------------------------------------
> --- Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Podofo-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/podofo-users
> 


-- 
**********************************************************************
Dominik Seichter - [email protected]
KRename  - http://www.krename.net  - Powerful batch renamer for KDE
KBarcode - http://www.kbarcode.net - Barcode and label printing
PoDoFo - http://podofo.sf.net - PDF generation and parsing library
SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,  for KDE
Alan - http://alan.sf.net - A Turing Machine in Java
**********************************************************************

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to