pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Filter's new API and text variables


From: jemarch
Subject: Re: [pdf-devel] Filter's new API and text variables
Date: Mon, 22 Sep 2008 20:32:47 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hello Gerel.

   I've just started adapting the run length filter.
   So the initialization function would be as follows,
   ##
   pdf_status_t pdf_stm_f_rl_init (pdf_hash_t params, pdf_hash_t state);
   ###

Note that now we are using a void pointer for the internal state.

   Now, suppose that I want to use that filter in 'decode mode'. So the params
   argument should have a "mode" -> pdf_stm_f_rl_mode_t (enum). The question is,
   should I add that parameter to the state hash ? I think I shouldn't since the
   params is also given to the apply function anyways, and it's not
   'state'.

You want to write _two_ different filters: a RunLength Encoding filter
and a RunLength Decoding filter.

Of course the best option would be to have a lot of generic code
working for both cases, but each filter should provide the init/apply
pair.

   OTOH, regarding,
   ##
   pdf_status_t
   pdf_text_new_from_host (const pdf_char_t *str,
                           const pdf_size_t size,
                           const pdf_text_host_encoding_t enc,
                           pdf_text_t *text);
   ###

   Do we need to give the host encoding as argument ? I thought that
   the function itself would get it doing
   "pdf_text_get_host_encoding()". Am I wrong ?

Just use pdf_text_get_host_encoding() as the third parameter. See
'pdf-fsys-disk.c' to find some examples of its use.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]