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_DYNAMICIMAGE_ANY_IMAGE_HPP #define GIL_DYNAMICIMAGE_ANY_IMAGE_HPP //////////////////////////////////////////////////////////////////////////////////////// /// \file /// \brief Support for run-time instantiated images and image views /// \author Lubomir Bourdev and Hailin Jin \n /// Adobe Systems Incorporated /// /// //////////////////////////////////////////////////////////////////////////////////////// #include "any_image_view.hpp" #include "../../image.hpp" //#ifdef _MSC_VER //#pragma warning(push) //#pragma warning(disable : 4244) // conversion from 'std::ptrdiff_t' to 'int', possible loss of data. even if we static-assert the two types are the same (on visual studio 8) //#endif namespace boost { namespace gil { namespace detail { template
struct get_view_t { typedef typename T::view_t type; }; template
struct images_get_views_t : public mpl::transform
> {}; template
struct get_const_view_t { typedef typename T::const_view_t type; }; template
struct images_get_const_views_t : public mpl::transform
> {}; struct recreate_image_fnobj { typedef void result_type; const point2
& _dimensions; unsigned _alignment; recreate_image_fnobj(const point2
& dims, unsigned alignment) : _dimensions(dims), _alignment(alignment) {} template
result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); } }; template
// Models AnyViewConcept struct any_image_get_view { typedef AnyView result_type; template
result_type operator()( Image& img) const { return result_type(view(img)); } }; template
// Models AnyConstViewConcept struct any_image_get_const_view { typedef AnyConstView result_type; template
result_type operator()(const Image& img) const { return result_type(const_view(img)); } }; } //////////////////////////////////////////////////////////////////////////////////////// /// \ingroup ImageModel /// \brief Represents a run-time specified image. Note it does NOT model ImageConcept /// /// Represents an image whose type (color space, layout, planar/interleaved organization, etc) can be specified at run time. /// It is the runtime equivalent of \p image. /// Some of the requirements of ImageConcept, such as the \p value_type typedef cannot be fulfilled, since the language does not allow runtime type specification. /// Other requirements, such as access to the pixels, would be inefficient to provide. Thus \p any_image does not fully model ImageConcept. /// In particular, its \p view and \p const_view methods return \p any_image_view, which does not fully model ImageViewConcept. See \p any_image_view for more. //////////////////////////////////////////////////////////////////////////////////////// template
class any_image : public variant
{ typedef variant
parent_t; public: typedef any_image_view
::type> const_view_t; typedef any_image_view
::type> view_t; typedef std::ptrdiff_t x_coord_t; typedef std::ptrdiff_t y_coord_t; typedef point2
point_t; any_image() : parent_t() {} template
explicit any_image(const T& obj) : parent_t(obj) {} template
explicit any_image(T& obj, bool do_swap) : parent_t(obj,do_swap) {} any_image(const any_image& v) : parent_t((const parent_t&)v) {} template
any_image& operator=(const T& obj) { parent_t::operator=(obj); return *this; } any_image& operator=(const any_image& v) { parent_t::operator=((const parent_t&)v); return *this;} void recreate(const point_t& dims, unsigned alignment=1) { apply_operation(*this,detail::recreate_image_fnobj(dims,alignment)); } void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1) { recreate(point2
(width,height),alignment); } std::size_t num_channels() const { return apply_operation(*this, detail::any_type_get_num_channels()); } point_t dimensions() const { return apply_operation(*this, detail::any_type_get_dimensions()); } x_coord_t width() const { return dimensions().x; } y_coord_t height() const { return dimensions().y; } }; ///@{ /// \name view, const_view /// \brief Get an image view from a run-time instantiated image /// \ingroup ImageModel /// \brief Returns the non-constant-pixel view of any image. The returned view is any view. template
GIL_FORCEINLINE // Models ImageVectorConcept typename any_image
::view_t view(any_image
& anyImage) { return apply_operation(anyImage, detail::any_image_get_view
::view_t>()); } /// \brief Returns the constant-pixel view of any image. The returned view is any view. template
GIL_FORCEINLINE // Models ImageVectorConcept typename any_image
::const_view_t const_view(const any_image
& anyImage) { return apply_operation(anyImage, detail::any_image_get_const_view
::const_view_t>()); } ///@} } } // namespace boost::gil //#ifdef _MSC_VER //#pragma warning(pop) //#endif #endif
any_image.hpp
Page URL
File URL
Prev
2/10
Next
Download
( 6 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.