JeVoisBase  1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Loading...
Searching...
No Matches
env_pyr.h
Go to the documentation of this file.
1/*!@file env_pyr.h */
2
3// //////////////////////////////////////////////////////////////////// //
4// The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the //
5// University of Southern California (USC) and the iLab at USC. //
6// See http://iLab.usc.edu for information about this project. //
7// //////////////////////////////////////////////////////////////////// //
8// Major portions of the iLab Neuromorphic Vision Toolkit are protected //
9// under the U.S. patent ``Computation of Intrinsic Perceptual Saliency //
10// in Visual Environments, and Applications'' by Christof Koch and //
11// Laurent Itti, California Institute of Technology, 2001 (patent //
12// pending; application number 09/912,225 filed July 23, 2001; see //
13// http://pair.uspto.gov/cgi-bin/final/home.pl for current status). //
14// //////////////////////////////////////////////////////////////////// //
15// This file is part of the iLab Neuromorphic Vision C++ Toolkit. //
16// //
17// The iLab Neuromorphic Vision C++ Toolkit is free software; you can //
18// redistribute it and/or modify it under the terms of the GNU General //
19// Public License as published by the Free Software Foundation; either //
20// version 2 of the License, or (at your option) any later version. //
21// //
22// The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope //
23// that it will be useful, but WITHOUT ANY WARRANTY; without even the //
24// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
25// PURPOSE. See the GNU General Public License for more details. //
26// //
27// You should have received a copy of the GNU General Public License //
28// along with the iLab Neuromorphic Vision C++ Toolkit; if not, write //
29// to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, //
30// Boston, MA 02111-1307 USA. //
31// //////////////////////////////////////////////////////////////////// //
32//
33// Primary maintainer for this file: Rob Peters <rjpeters at usc dot edu>
34// $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Envision/env_pyr.h $
35// $Id: env_pyr.h 7628 2007-01-03 04:07:21Z rjpeters $
36//
37
38#pragma once
39
42
43// ######################################################################
44//! This class implements a set of images, often used as a dyadic pyramid.
45struct env_pyr
46{
49};
50
51#define env_pyr_initializer { 0, 0 }
52
53#ifdef __cplusplus
54extern "C"
55{
56#endif
57
58 //! Construct an empty pyramid
59 static inline void env_pyr_init_empty(struct env_pyr* pyr);
60
61 //! Construct with a given number of empty images.
62 void env_pyr_init(struct env_pyr* pyr, const env_size_t n);
63
64 void env_pyr_make_empty(struct env_pyr* dst);
65
66 void env_pyr_copy_src_dst(const struct env_pyr* src,
67 struct env_pyr* dst);
68
69 //! Swap contents with another env_pyr
70 void env_pyr_swap(struct env_pyr* pyr1,
71 struct env_pyr* pyr2);
72
73 //! Return number of images in image set.
74 static inline env_size_t env_pyr_depth(const struct env_pyr* pyr);
75
76 //! Get image from a given level.
77 static inline const struct env_image* env_pyr_img(const struct env_pyr* pyr,
78 const env_size_t lev);
79
80 //! Get mutable image from a given level.
81 static inline struct env_image* env_pyr_imgw(struct env_pyr* pyr,
82 const env_size_t lev);
83
84#ifdef __cplusplus
85}
86#endif
87
88
89
90// ######################################################################
91static inline void env_pyr_init_empty(struct env_pyr* pyr)
92{
93 pyr->images = 0;
94 pyr->depth = 0;
95}
96
97// ######################################################################
98static inline env_size_t env_pyr_depth(const struct env_pyr* pyr)
99{
100 return pyr->depth;
101}
102
103// ######################################################################
104static inline const struct env_image* env_pyr_img(const struct env_pyr* pyr,
105 const env_size_t lev)
106{
107 return &pyr->images[lev];
108}
109
110// ######################################################################
111static inline struct env_image* env_pyr_imgw(struct env_pyr* pyr,
112 const env_size_t lev)
113{
114 return &pyr->images[lev];
115}
void env_pyr_init(struct env_pyr *pyr, const env_size_t n)
Construct with a given number of empty images.
Definition env_pyr.c:41
void env_pyr_swap(struct env_pyr *pyr1, struct env_pyr *pyr2)
Swap contents with another env_pyr.
Definition env_pyr.c:60
void env_pyr_copy_src_dst(const struct env_pyr *src, struct env_pyr *dst)
Definition env_pyr.c:68
void env_pyr_make_empty(struct env_pyr *dst)
Definition env_pyr.c:51
unsigned long env_size_t
Definition env_types.h:71
Basic image class.
Definition env_image.h:44
This class implements a set of images, often used as a dyadic pyramid.
Definition env_pyr.h:46
env_size_t depth
Definition env_pyr.h:48
struct env_image * images
Definition env_pyr.h:47