From: Foster B. <fos...@us...> - 2006-02-27 20:42:09
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/extension/argb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/gil/extension/argb Added Files: argb.hpp Log Message: image_t (icons and pictures) support for Mac and Win32, along with a GIL image factory and a (sample) Targa file format importing module for that factory. Also added alert.adm/eve as a sample for the icon support. Added the notion of a working directory to the modal dialog interface to reference external resources. Also added an alert API that leverages modal_dialog_interface. Other misc. bug fixes and changes. --- NEW FILE: argb.hpp --- #ifndef GIL_ARGB_HPP #define GIL_ARGB_HPP #include <adobe/gil/core/rgba.hpp> #include <adobe/gil/core/typedefs.hpp> ADOBE_GIL_NAMESPACE_BEGIN /// \brief ARGB color space identifier /// \ingroup RGBA struct argb_tag : public rgba_tag {}; namespace detail { /// \ingroup ColorBase /// \ingroup RGBA /// \brief alpha, red, green, and blue channel values /// /// Represents a ARGB unit of channel values defined in this specific ordering in memory. Also provides channel accessors /// v0(), v1(), v2(), v3() agnostic of color space, which allow uniform operations on channels of different color spaces. The accessors also have /// consistent mapping between color bases representing order variations of the same color space. For example, v0() returns the red /// channel value/reference/pointer in both an rgba color base and in a argb color base. template <typename T> struct color_base<T,argb_tag> { typedef argb_tag color_space_type; typedef T channel_type; typedef typename boost::add_const<channel_type>::type channel_const_type; typedef typename boost::add_reference<channel_type>::type channel_reference; typedef typename boost::add_reference<channel_const_type>::type channel_const_reference; T a,r,g,b; color_base() {} color_base(channel_type v0, channel_type v1, channel_type v2, channel_type v3) : a(v3),r(v0),g(v1),b(v2) {} template <typename T1, typename C1> color_base(const color_base<T1,C1>& c) : a(c.a),r(c.r),g(c.g),b(c.b) {} template <typename T1, typename C1> color_base( color_base<T1,C1>& c) : a(c.a),r(c.r),g(c.g),b(c.b) {} }; } namespace detail { template <typename CS,int N> struct logical_channel_accessor; /// \ingroup ChannelAccessor template <> struct logical_channel_accessor<argb_tag,0> { template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,argb_tag>& p) const {return p.r;} template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,argb_tag>& p) const {return p.r;} }; /// \ingroup ChannelAccessor template <> struct logical_channel_accessor<argb_tag,1> { template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,argb_tag>& p) const {return p.g;} template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,argb_tag>& p) const {return p.g;} }; /// \ingroup ChannelAccessor template <> struct logical_channel_accessor<argb_tag,2> { template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,argb_tag>& p) const {return p.b;} template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,argb_tag>& p) const {return p.b;} }; /// \ingroup ChannelAccessor template <> struct logical_channel_accessor<argb_tag,3> { template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,argb_tag>& p) const {return p.a;} template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,argb_tag>& p) const {return p.a;} }; } typedef pixel<bits8 ,argb_tag> argb8_pixel; typedef pixel<bits16,argb_tag> argb16_pixel; typedef pixel<bits32,argb_tag> argb32_pixel; typedef pixel<const bits8 ,argb_tag> argb8c_pixel; typedef pixel<const bits16,argb_tag> argb16c_pixel; typedef pixel<const bits32,argb_tag> argb32c_pixel; typedef pixel<bits8 ,argb_tag>& argb8_ref; typedef pixel<bits16,argb_tag>& argb16_ref; typedef pixel<bits32,argb_tag>& argb32_ref; typedef pixel<const bits8 ,argb_tag>& argb8c_ref; typedef pixel<const bits16,argb_tag>& argb16c_ref; typedef pixel<const bits32,argb_tag>& argb32c_ref; typedef argb8_pixel* argb8_ptr; typedef argb16_pixel* argb16_ptr; typedef argb32_pixel* argb32_ptr; typedef const_interleaved_pixel_iterator<bits8 , argb_tag> argb8c_ptr; typedef const_interleaved_pixel_iterator<bits16, argb_tag> argb16c_ptr; typedef const_interleaved_pixel_iterator<bits32, argb_tag> argb32c_ptr; typedef pixel_step_iterator<argb8_ptr> argb8_step_ptr; typedef pixel_step_iterator<argb16_ptr> argb16_step_ptr; typedef pixel_step_iterator<argb32_ptr> argb32_step_ptr; typedef pixel_step_iterator<argb8c_ptr> argb8c_step_ptr; typedef pixel_step_iterator<argb16c_ptr> argb16c_step_ptr; typedef pixel_step_iterator<argb32c_ptr> argb32c_step_ptr; typedef pixel_xy_locator<pixel_step_iterator<argb8_ptr> > argb8_loc; typedef pixel_xy_locator<pixel_step_iterator<argb16_ptr> > argb16_loc; typedef pixel_xy_locator<pixel_step_iterator<argb32_ptr> > argb32_loc; typedef pixel_xy_locator<pixel_step_iterator<argb8c_ptr> > argb8c_loc; typedef pixel_xy_locator<pixel_step_iterator<argb16c_ptr> > argb16c_loc; typedef pixel_xy_locator<pixel_step_iterator<argb32c_ptr> > argb32c_loc; typedef pixel_xy_locator<pixel_step_iterator<argb8_step_ptr> > argb8_step_loc; typedef pixel_xy_locator<pixel_step_iterator<argb16_step_ptr> > argb16_step_loc; typedef pixel_xy_locator<pixel_step_iterator<argb32_step_ptr> > argb32_step_loc; typedef pixel_xy_locator<pixel_step_iterator<argb8c_step_ptr> > argb8c_step_loc; typedef pixel_xy_locator<pixel_step_iterator<argb16c_step_ptr> > argb16c_step_loc; typedef pixel_xy_locator<pixel_step_iterator<argb32c_step_ptr> > argb32c_step_loc; typedef image_view<argb8_loc> argb8_view; typedef image_view<argb16_loc> argb16_view; typedef image_view<argb32_loc> argb32_view; typedef image_view<argb8c_loc> argb8c_view; typedef image_view<argb16c_loc> argb16c_view; typedef image_view<argb32c_loc> argb32c_view; typedef image_view<argb8_step_loc> argb8_step_view; typedef image_view<argb16_step_loc> argb16_step_view; typedef image_view<argb32_step_loc> argb32_step_view; typedef image_view<argb8c_step_loc> argb8c_step_view; typedef image_view<argb16c_step_loc> argb16c_step_view; typedef image_view<argb32c_step_loc> argb32c_step_view; typedef image<argb8_view,std::allocator<unsigned char> > argb8_image; typedef image<argb16_view,std::allocator<unsigned char> > argb16_image; typedef image<argb32_view,std::allocator<unsigned char> > argb32_image; ADOBE_GIL_NAMESPACE_END #endif |