Menu

#1 Derive Domains from Masks

0.8.0
closed
None
2017-01-01
2013-06-27
No

Allow automatic deriving of a Domain from a Mask, e.g.
const float filter_mask[] = {0.25f, 0.5f, 0, 0.5f, 0.25f};
Mask<float> mask(5, 1);
mask = filter_mask;</float>

// old, verbose syntax
Domain dom(5, 1);
const uchar domain[] = {1, 1, 0, 1, 1};
dom = domain;

// new, concise syntax
Domain dom(mask);
dom = mask;

Discussion

  • Richard Membarth

    • status: open --> closed
     
  • Richard Membarth

    The new syntax allows to initialize/assign is as follows:
    float data[3][3] = { { 1, 2, 1 }, { 2, 4, 2 }, { 1, 2, 1 } };

    // mask is directly initialized using 2-dim array:
    Mask<float> mask(data);</float>

    // domain is either derived from Mask
    Domain domain(mask);

    // or from the 2-dim array
    Domain domain(data);

     

Log in to post a comment.

MongoDB Logo MongoDB