DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
/* Copyright 2005-2007 Adobe Systems Incorporated Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). See http://opensource.adobe.com/gil for most recent version including documentation. */ /*************************************************************************************************/ #ifndef GIL_PIXEL_ITERATOR_ADAPTOR_H #define GIL_PIXEL_ITERATOR_ADAPTOR_H //////////////////////////////////////////////////////////////////////////////////////// /// \file /// \brief pixel step iterator, pixel image iterator and pixel dereference iterator /// \author Lubomir Bourdev and Hailin Jin \n /// Adobe Systems Incorporated /// \date 2005-2007 \n Last updated on February 16, 2007 /// //////////////////////////////////////////////////////////////////////////////////////// #include
#include
#include "gil_config.hpp" #include "gil_concept.hpp" #include "pixel_iterator.hpp" namespace boost { namespace gil { /// \defgroup PixelIteratorModelDerefPtr dereference_iterator_adaptor /// \ingroup PixelIteratorModel /// \brief An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept /// \ingroup PixelIteratorModelDerefPtr PixelBasedModel /// \brief An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept template
// Models Returns the result of dereferencing a given iterator of type Iterator class dereference_iterator_adaptor : public iterator_adaptor
, Iterator, typename DFn::value_type, use_default, typename DFn::reference, use_default> { DFn _deref_fn; public: typedef iterator_adaptor
, Iterator, typename DFn::value_type, use_default, typename DFn::reference, use_default> parent_t; typedef typename DFn::result_type reference; typedef typename std::iterator_traits
::difference_type difference_type; typedef DFn dereference_fn; dereference_iterator_adaptor() {} template
dereference_iterator_adaptor(const dereference_iterator_adaptor
& dit) : parent_t(dit.base()), _deref_fn(dit._deref_fn) {} dereference_iterator_adaptor(Iterator it, DFn deref_fn=DFn()) : parent_t(it), _deref_fn(deref_fn) {} template
dereference_iterator_adaptor(const dereference_iterator_adaptor
& it) : parent_t(it.base()), _deref_fn(it._deref_fn) {} /// For some reason operator[] provided by iterator_facade returns a custom class that is convertible to reference /// We require our own reference because it is registered in iterator_traits reference operator[](difference_type d) const { return *(*this+d);} // although iterator_adaptor defines these, the default implementation computes distance and compares for zero. // it is often faster to just apply the relation operator to the base bool operator> (const dereference_iterator_adaptor& p) const { return this->base_reference()> p.base_reference(); } bool operator< (const dereference_iterator_adaptor& p) const { return this->base_reference()< p.base_reference(); } bool operator>=(const dereference_iterator_adaptor& p) const { return this->base_reference()>=p.base_reference(); } bool operator<=(const dereference_iterator_adaptor& p) const { return this->base_reference()<=p.base_reference(); } bool operator==(const dereference_iterator_adaptor& p) const { return this->base_reference()==p.base_reference(); } bool operator!=(const dereference_iterator_adaptor& p) const { return this->base_reference()!=p.base_reference(); } Iterator& base() { return this->base_reference(); } const Iterator& base() const { return this->base_reference(); } const DFn& deref_fn() const { return _deref_fn; } private: template
friend class dereference_iterator_adaptor; friend class boost::iterator_core_access; reference dereference() const { return _deref_fn(*(this->base_reference())); } }; template
struct const_iterator_type
> { typedef dereference_iterator_adaptor
::type,typename DFn::const_t> type; }; template
struct iterator_is_mutable
> : public mpl::bool_
{}; template
struct is_iterator_adaptor
> : public mpl::true_{}; template
struct iterator_adaptor_get_base
> { typedef I type; }; template
struct iterator_adaptor_rebind
,NewBaseIterator> { typedef dereference_iterator_adaptor
type; }; ///////////////////////////// // PixelBasedConcept ///////////////////////////// template
struct color_space_type
> : public color_space_type
{}; template
struct channel_mapping_type
> : public channel_mapping_type
{}; template
struct is_planar
> : public is_planar
{}; template
struct channel_type
> : public channel_type
{}; ///////////////////////////// // MemoryBasedIteratorConcept ///////////////////////////// template
struct byte_to_memunit
> : public byte_to_memunit
{}; template
inline typename std::iterator_traits
::difference_type memunit_step(const dereference_iterator_adaptor
& p) { return memunit_step(p.base()); } template
inline typename std::iterator_traits
::difference_type memunit_distance(const dereference_iterator_adaptor
& p1, const dereference_iterator_adaptor
& p2) { return memunit_distance(p1.base(),p2.base()); } template
inline void memunit_advance(dereference_iterator_adaptor
& p, typename std::iterator_traits
::difference_type diff) { memunit_advance(p.base(), diff); } template
inline dereference_iterator_adaptor
memunit_advanced(const dereference_iterator_adaptor
& p, typename std::iterator_traits
::difference_type diff) { return dereference_iterator_adaptor
(memunit_advanced(p.base(), diff), p.deref_fn()); } template
inline typename std::iterator_traits
>::reference memunit_advanced_ref(const dereference_iterator_adaptor
& p, typename std::iterator_traits
::difference_type diff) { return *memunit_advanced(p, diff); } ///////////////////////////// // HasDynamicXStepTypeConcept ///////////////////////////// template
struct dynamic_x_step_type
> { typedef dereference_iterator_adaptor
::type,DFn> type; }; /// \brief Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor upon dereferencing /// \ingroup PixelIteratorModelDerefPtr template
struct iterator_add_deref { GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept) typedef dereference_iterator_adaptor
type; static type make(const Iterator& it, const Deref& d) { return type(it,d); } }; /// \ingroup PixelIteratorModelDerefPtr /// \brief For dereference iterator adaptors, compose the new function object after the old one template
struct iterator_add_deref
,Deref> { // GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept) typedef dereference_iterator_adaptor
> type; static type make(const dereference_iterator_adaptor
& it, const Deref& d) { return type(it.base(),deref_compose
(d,it.deref_fn())); } }; } } // namespace boost::gil #endif
pixel_iterator_adaptor.hpp
Page URL
File URL
Prev
25/34
Next
Download
( 9 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.