On 05/19/17 05:36, Jean-Philippe André wrote:
> Hi,
>
> You can definitely define global filters and use them by name in any part
> or state you want, but the below documentation looks wrong.
> Thanks for reporting, I'll have a look and fix this asap :)

Thank you!

>
> On 18 May 2017 at 16:47, Viacheslav Reutskiy <reutskiy....@gmail.com> wrote:
>
>> Hello everyone,
>>
>> Can someone explain to me how to work with evas.filter in edc?
>> I try to read the docs, but it unreachable because edcref page is
>> broken. So I gone to see code, and it confuse me.
>> I have past the code because can not use links to documentation pages.
>>
>> The documentation section says:
>> ```
>> /**
>>       @page edcref
>>       @block
>>           filters
>>       @context
>>           // (toplevel)
>>           // collections
>>           // collections.group
>>           filters {
>>               filter.script: "key" "Lua script here";
>>               filter.file: "other" "filename.lua";
>>               ..
>>           }
>>       @description
>>           The "filter" block lets you embed filter scripts into an EDC
>> group,
>>           that can then be referred to in the @ref
>> sec_collections_group_parts_description_filter "Text.Filter"
>>           or @ref sec_collections_group_parts_description_filter
>> "Image.Filter" statements.
>>
>>           In a similar way to the toplevel @ref sec_toplevel_data "Data"
>> section,
>>           it is possible to embed filters from a external file inside the
>> final EDJ.
>>
>>           Please also refer to @ref evasfiltersref "Evas filters reference".
>>       @endblock
>>
>>       @property
>>           inline
>>       @parameters
>>           [name] [Lua script]
>>       @effect
>>           Defines a new Lua script used for filtering.
>>       @endproperty
>>
>>       @property
>>           file
>>       @parameters
>>           [name] [Lua script filename]
>>       @effect
>>           Includes an external file to define a new Lua script used for
>> filtering.
>>       @endproperty
>> */
>> ```
>>
>> Ok, good, follow the docs and write next code:
>>
>> ``
>> collections {
>>      group { name: "blur";
>>         filters {
>>            filter.script: "script_blur" "fat = buffer ('alpha') grow ({ 8,
>> dst = fat }) blur ({ 12, src = fat, color = 'darkblue' }) blur ({ 4, color
>> = 'cyan' }) blend () ";
>>         }
>>         parts {
>>            part { name: "txt";
>>               type: TEXT;
>>               description {
>>                  color: 255 0 0 255;
>>                  text {
>>                     size: 48;
>>                     text: "Blur effect";
>>                     filter: "script_blur";
>>                  }
>>               }
>>            }
>>         }
>>      }
>> }
>> ```
>>
>> and take error:
>> edje_cc: Error. parse error edje_text_filter.edc:5. Name for inline filter
>> must be specified first.
>>
>> Hmmm, return to docs. And what I see in the example we have line:
>> ```
>> filter.script: "key" "Lua script here";
>> ```
>> But in below in docs
>> ```
>> @property
>>           inline
>>       @parameters
>>           [name] [Lua script]
>>       @effect
>>           Defines a new Lua script used for filtering.
>>       @endproperty
>> ```
>> Maybe it mistake, ok make change in the edc code
>> ```
>> filter.script: -> filter.inline:
>> ```
>> and take another error:
>> edje_cc: Error. edje_text_filter.edc:4 unhandled keyword filter.inline
>>
>> Sadly, it's does not work!
>>
>> So try to find in the code keyword 'filter' more. And find in the
>> description
>> subsection:
>> ```
>> /**
>>       @page edcref
>>       @block
>>           filter
>>       @context
>>           part {
>>               type: [IMAGE or TEXT or PROXY or SNAPSHOT];
>>               ..
>>               description {
>>                   ..
>>                   filter {
>>                      code: "blend {}";
>>                      // or:
>>                      code: "filter_name";
>>                      source: "part1" "buf";
>>                      source: "part2" "otherbuf";
>>                      source: "part3";
>>                      ..
>>                      data: "the_answer" "42";
>>                      data: "something" "anything";
>>                      data: "mycc" "color_class('my_color_class')";
>>                      ..
>>                   }
>>                   // or:
>>                   text.filter: "blend {} -- ...";
>>                   ..
>>               }
>>           }
>>       @description
>>           Applies a series of image filters to a TEXT, IMAGE, PROXY or
>> SNAPSHOT part.
>>           For more information, please refer to the page
>>           @ref evasfiltersref "Evas filters reference".
>>       @endblock
>>
>>       @property
>>           filter.code
>>       @parameters
>>           [filter script or filter name]
>>       @effect
>>           The argument to this field is the source code of a Lua script as
>> defined
>>           @ref evasfiltersref "here" or a filter name defined in the
>>           @ref sec_collections_group_filters "Filters" section.
>>       @endproperty
>> */
>> ```
>> This use case is work fine for me.
>>
>> But without section 'group.filter' user can not reuse his filter in anther
>> parts and
>> states. Also I find the next declaration:
>> ```
>> {"filters", NULL},
>> {"filters.filter", ob_filters_filter},
>> {"filters.filter.script", ob_filters_filter_script},
>>
>> {"collections.filters", NULL},
>> {"collections.filters.filter", ob_filters_filter}, /* dup */
>> {"collections.filters.filter.script", ob_filters_filter_script}, /* dup */
>>
>> {"collections.group.filters", NULL},
>> {"collections.group.filters.filter", ob_filters_filter}, /* dup */
>> {"collections.group.filters.filter.script", ob_filters_filter_script}, /*
>> dup */
>> ```
>> So expected that user can define globally, in toplevel blocks, but it does
>> not work
>> too, with the same errors.
>>
>>
>> Actually, this situation very sadly for me, because I can not understand
>> how it should
>> work, what the keywords author what use, and as result I can not fix it.
>>
>> Please fix this bug or describe how it should work.
>>
>> --
>> Viacheslav Reutskiy (rimmed)
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> enlightenment-devel mailing list
>> enlightenment-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>>
>>
>

-- 
Viacheslav Reutskiy (rimmed)


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to