$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
image/props.hh
1 // Copyright (C) 2007, 2008, 2009, 2012 EPITA Research and Development
2 // Laboratory (LRDE)
3 //
4 // This file is part of Olena.
5 //
6 // Olena is free software: you can redistribute it and/or modify it under
7 // the terms of the GNU General Public License as published by the Free
8 // Software Foundation, version 2 of the License.
9 //
10 // Olena is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // As a special exception, you may use this file as part of a free
19 // software project without restriction. Specifically, if other files
20 // instantiate templates or use macros or inline functions from this
21 // file, or you compile this file and link it with other files to produce
22 // an executable, this file does not by itself cause the resulting
23 // executable to be covered by the GNU General Public License. This
24 // exception does not however invalidate any other reasons why the
25 // executable file might be covered by the GNU General Public License.
26 
27 #ifndef MLN_TRAIT_IMAGE_PROPS_HH
28 # define MLN_TRAIT_IMAGE_PROPS_HH
29 
37 # include <string>
38 # include <mln/trait/undef.hh>
39 # include <mln/trait/value/kind.hh>
40 
41 # include <mln/core/def/coord.hh> // Move along with space_from_point...
42 
43 
44 
45 // Properties of images.
46 // =====================
47 
48 // * misc
49 
50 // category: /any/
51 // |
52 // + -- primary
53 // |
54 // + -- /morpher/
55 // |
56 // + -- domain_morpher
57 // |
58 // + -- value_morpher
59 // |
60 // + -- identity_morpher
61 //
62 // Interface related to the category property:
63 // morpher
64 // => .delegatee_(): returns a pointer on the reference image.
65 // => .unmorph() : returns the reference image.
66 // => .rw() : States that the morpher is writable.
67 
68 
69 
70 
71 
72 // * value access
73 
74 // pw_io: /any/
75 // |
76 // +-- read
77 // |
78 // +-- read_write
79 //
80 // Interface related to the pw_io property
81 // read_write
82 // => .operator(p : psite) : lvalue, writes access to the value localized at
83 // p.
84 
85 // speed: /any/
86 // |
87 // + -- slow
88 // |
89 // + -- fast
90 // |
91 // + -- fastest
92 //
93 // Note that:
94 // fastest value implies value_storage::one_block and ext_domain::some
95 
96 // vw_io: /any/
97 // |
98 // +-- read
99 // |
100 // +-- read_write
101 
102 // vw_set: /any/
103 // |
104 // +-- /some/
105 // | |
106 // | +-- uni
107 // | |
108 // | +-- multi
109 // |
110 // +-- none
111 //
112 // Interface related to vw_io and vw_set properties
113 // multi and vw_io::read
114 // => .cells_() : const vset, returns the image cell lists.
115 // multi and vw_io::read_write
116 // => .cells_() : vset, returns the image cell lists.
117 // uni and vw_io::read
118 // => .values_taken_() : const vset, returns the value_taken set.
119 // => .cells_(): const vset, same as .values_taken_().
120 // uni (and vw_io::read_write)
121 // => .values_taken() : vset, returns the value_taken set.
122 // => .cells_() : vset, same as .values_taken_().
123 
124 
125 
126 
127 
128 // * organization in memory
129 
130 // value_access: /any/
131 // |
132 // +-- direct
133 // |
134 // +-- indirect
135 // |
136 // +-- computed
137 
138 // value_storage:/any/
139 // |
140 // + -- /organized/
141 // | |
142 // | + -- singleton
143 // | |
144 // | + -- one_block
145 // | |
146 // | + -- piecewise
147 // |
148 // + -- disrupted
149 //
150 // Interface related to the value_storage and value_access properties
151 // singleton and value_access::direct
152 // => .value_() : lvalue, returns the flat value
153 // => .value_() : rvalue, returns the flat value
154 // one_block
155 // => .nelements_() : unsigned, number of buffer elements
156 // => .point_at_offset_(unsigned offset) : point,
157 // point corresponding to the offset offset
158 // => .delta_offset_(deltapoint dp) : unsigned
159 // Return the delta offset associated to dp
160 // one_block and value_access::direct
161 // => element_(unsigned index) : rvalue, returns the element at index.
162 // => element_(unsigned index) : lvalue, returns the element at index.
163 // => buffer_() : const value*: Give a hook to the value buffer
164 // => buffer_() : value*: Give a hook to the value buffer
165 // piecewise
166 // => npieces_() const : unsigned, returns the number of memory pieces
167 // piecewise and value_access::direct
168 // => piece_size_(i) : unsigned, returns the size of piece memory i
169 // => piece_(i) : value*: Give a hook to the i memory piece
170 // => piece_(i) : const value*: Give a hook to the i memory piece
171 
172 // size: /any/
173 // |
174 // + -- regular
175 // |
176 // + -- huge
177 
178 
179 
180 
181 
182 
183 // * image geometry
184 
185 // value_alignment:/any/
186 // |
187 // +-- with_grid
188 // |
189 // +-- not_aligned
190 // |
191 // +-- irrelevant
192 
193 // localization: /any/
194 // |
195 // + -- none
196 // |
197 // + -- space
198 // |
199 // + -- /grid/
200 // |
201 // + -- isotropic_grid
202 // | |
203 // | + -- basic_grid
204 // |
205 // + -- anisotropic_grid
206 
207 // dimension: /any/
208 // |
209 // + -- none
210 // |
211 // + -- /some/
212 // |
213 // + -- one_d
214 // |
215 // + -- two_d
216 // |
217 // + -- three_d
218 //
219 // Interface related to the dimension and pw_iw properties
220 // one_d
221 // => .at_(unsigned index) : rvalue
222 // one_d and pw_io::read_write
223 // => .at_(unsigned index) : lvalue
224 // two_d
225 // => .at_(unsigned row, unsigned col) : rvalue
226 // two_d and pw_io::read_write
227 // => .at_(unsigned row, unsigned col) : lvalue
228 // three_d
229 // => .at_(unsigned slice, unsigned row, unsigned col) : rvalue
230 // three_d and pw_io::read_write
231 // => .at_(unsigned slice, unsigned row, unsigned col) : lvalue
232 
233 
234 
235 
236 
237 // * extended domain
238 
239 // ext_domain: /any/
240 // |
241 // + -- none
242 // |
243 // + -- /some/
244 // |
245 // + -- fixed
246 // | |
247 // | + -- infinite
248 // |
249 // + -- extendable
250 // Interface related to the border property:
251 // some
252 // => .border_() : unsigned, returns the border thickness.
253 
254 // ext_io: /any/
255 // |
256 // + -- irrelevant
257 // |
258 // + -- read_only
259 // |
260 // + -- read_write
261 
262 // ext_value: /any/
263 // |
264 // + -- irrelevant
265 // |
266 // + -- single
267 // |
268 // + -- multiple
269 // Interface related to ext_io and ext_value properties:
270 // single
271 // => extension() : const mln_value(I)&
272 // single and ext_io::read_write
273 // => extension() : const mln_value(I)&
274 // => extension() : mln_value(I)&
275 
276 
277 
278 
279 
280 // * data (related to I::value)
281 
282 // kind: /any/
283 // |
284 // + -- color
285 // |
286 // + -- gray
287 // |
288 // + ----------- label
289 // | |
290 // | +-- named
291 // + -- /logic/ |
292 // | | |
293 // | + -- /mvlogic/
294 // | | |
295 // | | + -- binary
296 // | | |
297 // | | + -- ternary
298 // | |
299 // | + -- fuzzy
300 // |
301 // + -- data
302 // |
303 // |
304 // + -- /map/
305 // |
306 // + -- distance
307 
308 // nature: /any/
309 // |
310 // + -- scalar
311 // |
312 // + -- vectorial
313 // |
314 // + -- structed
315 // |
316 // + -- pointer
317 
318 // quant: /any/
319 // |
320 // + -- low
321 // |
322 // + -- high
323 
324 
325 
326 
327 
328 
329 // DEPRECATED
330 // value_browsing:/any/
331 // |
332 // + -- site_wise_only
333 // |
334 // + -------- cell_wise
335 // | |
336 // + -- value_wise |
337 // \ |
338 // -- + -- cell_and_value_wise
339 
340 // DEPRECATED
341 // value_io: /any/
342 // |
343 // + -- read_only
344 // |
345 // + -- read_write
346 
347 
348 namespace mln
349 {
350 
351  namespace trait
352  {
353 
354  namespace image
355  {
356 
357 // category: /any/
358 // |
359 // + -- primary
360 // |
361 // + -- /morpher/
362 // |
363 // + -- domain_morpher
364 // |
365 // + -- value_morpher
366 // |
367 // + -- identity_morpher
368 
369  struct category
370  {
371  struct any { protected: any() {} };
372  struct primary : any { std::string name() const { return "category::primary"; } };
373  struct morpher : any { protected: morpher() {} };
374  struct domain_morpher
375  : morpher { std::string name() const { return "category::domain_morpher"; } };
376  struct value_morpher
377  : morpher { std::string name() const { return "category::value_morpher"; } };
378  struct identity_morpher
379  : morpher { std::string name() const { return "category::identity_morpher"; } };
380  };
381 
382 
383 // speed: /any/
384 // |
385 // + -- slow
386 // |
387 // + -- fast
388 // |
389 // + -- fastest
390 
391  struct speed
392  {
393  struct any { protected: any() {} };
394  struct slow : any { std::string name() const { return "speed::slow"; } };
395  struct fast : any { std::string name() const { return "speed::fast"; } };
396  struct fastest
397  : fast { std::string name() const { return "speed::fastest"; } };
398  };
399 
400 
401 // size: /any/
402 // |
403 // + -- regular
404 // |
405 // + -- huge
406 
407  struct size
408  {
409  struct any { protected: any() {} };
410  struct huge : any { std::string name() const { return "size::huge"; } };
411  struct regular : any { std::string name() const { return "size::regular"; } };
412  };
413 
414 
415 // value_access: /any/
416 // |
417 // +-- direct
418 // |
419 // +-- indirect
420 // |
421 // +-- computed
422 
423  struct value_access
424  {
425  struct any { protected: any() {} };
426  struct direct : any { std::string name() const { return "value_access::direct"; } };
427  struct indirect : any { std::string name() const { return "value_access::indirect"; } };
428  struct computed : any { std::string name() const { return "value_access::computed"; } };
429  };
430 
431 
432 
433 
434 // value_storage:/any/
435 // |
436 // + -- /organized/
437 // | |
438 // | + -- singleton
439 // | |
440 // | + -- one_block
441 // | |
442 // | + -- piecewise
443 // |
444 // + -- disrupted
445 
446  struct value_storage
447  {
448  struct any { protected: any() {} };
449  struct organized
450  : any { protected: organized() {} };
451  struct singleton
452  : organized { std::string name() const { return "value_storage::singleton"; } };
453  struct one_block
454  : organized { std::string name() const { return "value_storage::one_block"; } };
455  struct piecewise
456  : organized { std::string name() const { return "value_storage::piecewise"; } };
457  struct disrupted : any { std::string name() const { return "value_storage::disrupted"; } };
458  };
459 
460 // value_alignment:/any/
461 // |
462 // +-- with_grid
463 // |
464 // +-- not_aligned
465 // |
466 // +-- irrelevant
467  struct value_alignment
468  {
469  struct any { protected: any() {} };
470  struct with_grid
471  : any { std::string name() const { return "value_alignment::with_grid"; } };
472  struct not_aligned
473  : any { std::string name() const { return "value_alignment::not_aligned"; } };
474  struct irrelevant
475  : any { std::string name() const { return "value_alignment::irrelevant"; } };
476  };
477 
478 // pw_io: /any/
479 // |
480 // +-- read
481 // |
482 // +-- read_write
483 
484  struct pw_io
485  {
486  struct any { protected: any() {} };
487  struct read
488  : any { std::string name() const { return "pw_io::read"; } };
489  struct read_write
490  : any { std::string name() const { return "pw_io::read_write"; } };
491  };
492 
493 // vw_io: /any/
494 // |
495 // +-- read
496 // |
497 // +-- read_write
498 
499  struct vw_io
500  {
501  struct any { protected: any() {} };
502  struct some : any { protected: some() {} };
503  struct read
504  : some { std::string name() const { return "vw_io::read"; } };
505  struct read_write
506  : some { std::string name() const { return "vw_io::read_write"; } };
507  struct none
508  : any { std::string name() const { return "vw_io::none"; } };
509  };
510 
511 // vw_set: /any/
512 // |
513 // +-- /some/
514 // | |
515 // | +-- uni
516 // | |
517 // | +-- multi
518 // |
519 // +-- none
520 
521  struct vw_set
522  {
523  struct any { protected: any() {} };
524  struct some : any { protected: some() {} };
525  struct none
526  : any { std::string name() const { return "vw_set::none";} };
527  struct uni
528  : some { std::string name() const { return "vw_set::uni";} };
529  struct multi
530  : some { std::string name() const { return "vw_set::multi";} };
531  };
532 
533 
534 // DEPRECATED PROPERTY
535 // value_browsing:/any/
536 // |
537 // + -- site_wise_only
538 // |
539 // + -------- cell_wise
540 // | |
541 // + -- value_wise |
542 // \ |
543 // -- + -- cell_and_value_wise
544 
545  struct value_browsing
546  {
547  struct any { protected: any() {} };
548  struct site_wise_only
549  : any { std::string name() const { return "value_browsing::site_wise_only"; } };
550  struct cell_wise
551  : virtual any { std::string name() const { return "value_browsing::cell_wise"; } };
552  struct value_wise
553  : virtual any { std::string name() const { return "value_browsing::value_wise"; } };
554  struct cell_and_value_wise
555  : cell_wise,
556  value_wise
557  { std::string name() const { return "value_browsing::cell_and_value_wise"; } };
558  };
559 
560 
561 // DEPRECATED PROPERTY
562 // value_io: /any/
563 // |
564 // + -- read_only
565 // |
566 // + -- read_write
567 
568  struct value_io
569  {
570  struct any { protected: any() {} };
571  struct read_only
572  : any { std::string name() const { return "value_io::read_only"; } };
573  struct read_write
574  : any { std::string name() const { return "value_io::read_write"; } };
575  };
576 
577 
578 // localization: /any/
579 // |
580 // + -- none
581 // |
582 // + -- space
583 // |
584 // + -- /grid/
585 // |
586 // + -- isotropic_grid
587 // | |
588 // | + -- basic_grid
589 // |
590 // + -- anisotropic_grid
591 
592  struct localization
593  {
594  struct any { protected: any() {} };
595  struct none : any { std::string name() const { return "localization::none"; } };
596  struct space : any { std::string name() const { return "localization::space"; } };
597  struct grid : space { protected: grid() {} };
598  struct isotropic_grid
599  : grid { std::string name() const { return "localization::isotropic_grid"; } };
600  struct basic_grid
601  : isotropic_grid { std::string name() const { return "localization::basic_grid"; } };
602  struct anisotropic_grid
603  : grid { std::string name() const { return "localization::anisotropic_grid"; } };
604  };
605 
606 
607 // dimension: /any/
608 // |
609 // + -- none
610 // |
611 // + -- /some/
612 // |
613 // + -- one_d
614 // |
615 // + -- two_d
616 // |
617 // + -- three_d
618 
619  struct dimension
620  {
621  struct any { protected: any() {} };
622  struct none : any { std::string name() const { return "dimension::none"; } };
623  struct some
624  : any { protected: some() {} };
625  struct one_d : some { std::string name() const { return "dimension::one_d"; } };
626  struct two_d : some { std::string name() const { return "dimension::two_d"; } };
627  struct three_d : some { std::string name() const { return "dimension::three_d"; } };
628  };
629 
630 
631 // ext_domain: /any/
632 // |
633 // + -- none
634 // |
635 // + -- /some/
636 // |
637 // + -- fixed
638 // | |
639 // | + -- infinite
640 // |
641 // + -- extendable
642 
643  struct ext_domain
644  {
645  struct any { protected: any() {} };
646  struct none : any { std::string name() const { return "ext_domain::none"; } };
647  struct some
648  : any { protected: some() {} };
649  struct extendable : some { std::string name() const { return "ext_domain::extendable"; } };
650  struct fixed : some { std::string name() const { return "ext_domain::fixed"; } };
651  struct infinite : fixed { std::string name() const { return "ext_domain::infinite"; } };
652  };
653 
654 
655 // ext_value: /any/
656 // |
657 // + -- irrelevant
658 // |
659 // + -- single
660 // |
661 // + -- multiple
662 
663  struct ext_value
664  {
665  struct any { protected: any() {} };
666  struct irrelevant : any { std::string name() const { return "ext_value::irrelevant"; } };
667  struct single : any { std::string name() const { return "ext_value::single"; } };
668  struct multiple : any { std::string name() const { return "ext_value::multiple"; } };
669  };
670 
671 
672 // ext_io: /any/
673 // |
674 // + -- irrelevant
675 // |
676 // + -- read_only
677 // |
678 // + -- read_write
679 
680  struct ext_io
681  {
682  struct any { protected: any() {} };
683  struct irrelevant
684  : any { std::string name() const { return "ext_io::irrelevant"; } };
685  struct read_only
686  : any { std::string name() const { return "ext_io::read_only"; } };
687  struct read_write
688  : any { std::string name() const { return "ext_io::read_write"; } };
689  };
690 
691 
692 // kind: /any/
693 // |
694 // + -- color
695 // |
696 // + -- gray
697 // |
698 // + ----------- label
699 // | |
700 // | +-- named
701 // + -- /logic/ |
702 // | | |
703 // | + -- /mvlogic/
704 // | | |
705 // | | + -- binary
706 // | | |
707 // | | + -- ternary
708 // | |
709 // | + -- fuzzy
710 // |
711 // + -- data
712 // |
713 // |
714 // + -- /map/
715 // |
716 // + -- distance
717 
718  typedef mln::trait::value::kind kind; // Fetch the 'kind' structure from value traits.
719 
720 
721 // nature: /any/
722 // |
723 // + -- scalar
724 // |
725 // + -- vectorial
726 // |
727 // + -- structed
728 // |
729 // + -- pointer
730 
731  struct nature
732  {
733  struct any { protected: any() {} };
734  struct scalar : any { std::string name() const { return "nature::scalar"; } };
735  struct vectorial : any { std::string name() const { return "nature::vectorial"; } };
736  struct structed : any { std::string name() const { return "nature::structed"; } };
737  struct pointer : any { std::string name() const { return "nature::pointer"; } };
738  };
739 
740 
741 // quant: /any/
742 // |
743 // + -- low
744 // |
745 // + -- high
746 
747  struct quant
748  {
749  struct any { protected: any() {} };
750  struct low : any { std::string name() const { return "quant::low"; } };
751  struct high : any { std::string name() const { return "quant::high"; } };
752  };
753 
754 
755  } // end of namespace mln::trait::image
756 
757  } // end of namespace mln::trait
758 
759 
760 
761  // FIXME: To be moved elsewhere?
762 
767 
768 
769  // Fwd decl. (used by trait::image::space_from_point).
770  namespace grid
771  {
772  struct tick;
773  struct square;
774  struct hexa;
775  struct cube;
776  }
777 
778  template <typename M, typename C> struct point;
783 
784  namespace trait
785  {
786  namespace image
787  {
788 
793 
794  template <typename P>
795  struct space_from_point
796  { typedef undef ret; };
797 
798  template <>
799  struct space_from_point<point1d>
800  { typedef trait::image::dimension::one_d ret; };
801 
802  template <>
803  struct space_from_point<point2d>
804  { typedef trait::image::dimension::two_d ret; };
805 
806  template <>
807  struct space_from_point<point3d>
808  { typedef trait::image::dimension::three_d ret; };
810 
811  } // end of namespace mln::trait::image
812 
813  } // end of namespace mln::trait
814 
815 } // end of namespace mln
816 
817 
818 #endif // ! MLN_TRAIT_IMAGE_PROPS_HH