⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 image.h

📁 下载来的一个看图软件的源代码
💻 H
📖 第 1 页 / 共 4 页
字号:
// This may look like C code, but it is really -*- C++ -*-//// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003, 2004//// Definition of Image, the representation of a single image in Magick++//#if !defined(Magick_Image_header)#define Magick_Image_header#include "Magick++/Include.h"#include <string>#include <list>#include "Magick++/Blob.h"#include "Magick++/Color.h"#include "Magick++/Drawable.h"#include "Magick++/Exception.h"#include "Magick++/Geometry.h"#include "Magick++/TypeMetric.h"namespace Magick{  // Forward declarations  class Options;  class ImageRef;//   extern MagickDLLDecl const std::string borderGeometryDefault;//   extern MagickDLLDecl const std::string frameGeometryDefault;//   extern MagickDLLDecl const std::string raiseGeometryDefault;  extern MagickDLLDecl const char *borderGeometryDefault;  extern MagickDLLDecl const char *frameGeometryDefault;  extern MagickDLLDecl const char *raiseGeometryDefault;  // Compare two Image objects regardless of LHS/RHS  // Image sizes and signatures are used as basis of comparison  int MagickDLLDecl operator == ( const Magick::Image& left_,                                  const Magick::Image& right_ );  int MagickDLLDecl operator != ( const Magick::Image& left_,                                  const Magick::Image& right_ );  int MagickDLLDecl operator >  ( const Magick::Image& left_,                                  const Magick::Image& right_ );  int MagickDLLDecl operator <  ( const Magick::Image& left_,                                  const Magick::Image& right_ );  int MagickDLLDecl operator >= ( const Magick::Image& left_,                                  const Magick::Image& right_ );  int MagickDLLDecl operator <= ( const Magick::Image& left_,                                  const Magick::Image& right_ );  // C library initialization routine  void MagickDLLDecl InitializeMagick(const char *path_);  //  // Image is the representation of an image.  In reality, it actually  // a handle object which contains a pointer to a shared reference  // object (ImageRef). As such, this object is extremely space efficient.  //  class MagickDLLDecl Image  {  public:    // Construct from image file or image specification    Image( const std::string &imageSpec_ );        // Construct a blank image canvas of specified size and color    Image( const Geometry &size_, const Color &color_ );    // Construct Image from in-memory BLOB    Image ( const Blob &blob_ );    // Construct Image of specified size from in-memory BLOB    Image ( const Blob &blob_, const Geometry &size_ );    // Construct Image of specified size and depth from in-memory BLOB    Image ( const Blob &blob_, const Geometry &size,            const unsigned int depth );    // Construct Image of specified size, depth, and format from    // in-memory BLOB    Image ( const Blob &blob_, const Geometry &size,            const unsigned int depth_,	    const std::string &magick_ );    // Construct Image of specified size, and format from in-memory    // BLOB    Image ( const Blob &blob_, const Geometry &size,            const std::string &magick_ );    // Construct an image based on an array of raw pixels, of    // specified type and mapping, in memory    Image ( const unsigned int width_,            const unsigned int height_,            const std::string &map_,            const StorageType type_,            const void *pixels_ );    // Default constructor    Image( void );        // Destructor    virtual ~Image();        /// Copy constructor    Image ( const Image & image_ );        // Assignment operator    Image& operator= ( const Image &image_ );    //////////////////////////////////////////////////////////////////////    //    // Image operations    //    //////////////////////////////////////////////////////////////////////    // Local adaptive threshold image    // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm    // Width x height define the size of the pixel neighborhood    // offset = constant to subtract from pixel neighborhood mean    void            adaptiveThreshold ( const unsigned int width,                                        const unsigned int height,                                        const unsigned offset = 0 );    // Add noise to image with specified noise type    void            addNoise ( const NoiseType noiseType_ );    // Transform image by specified affine (or free transform) matrix.    void            affineTransform ( const DrawableAffine &affine );    //    // Annotate image (draw text on image)    //    // Gravity effects text placement in bounding area according to rules:    //  NorthWestGravity  text bottom-left corner placed at top-left    //  NorthGravity      text bottom-center placed at top-center    //  NorthEastGravity  text bottom-right corner placed at top-right    //  WestGravity       text left-center placed at left-center    //  CenterGravity     text center placed at center    //  EastGravity       text right-center placed at right-center    //  SouthWestGravity  text top-left placed at bottom-left    //  SouthGravity      text top-center placed at bottom-center    //  SouthEastGravity  text top-right placed at bottom-right    // Annotate using specified text, and placement location    void            annotate ( const std::string &text_,			       const Geometry &location_ );    // Annotate using specified text, bounding area, and placement    // gravity    void            annotate ( const std::string &text_,			       const Geometry &boundingArea_,			       const GravityType gravity_ );    // Annotate with text using specified text, bounding area,    // placement gravity, and rotation.    void            annotate ( const std::string &text_,			       const Geometry &boundingArea_,			       const GravityType gravity_,			       const double degrees_ );    // Annotate with text (bounding area is entire image) and placement    // gravity.    void            annotate ( const std::string &text_,			       const GravityType gravity_ );        // Blur image with specified blur factor    // The radius_ parameter specifies the radius of the Gaussian, in    // pixels, not counting the center pixel.  The sigma_ parameter    // specifies the standard deviation of the Laplacian, in pixels.    void            blur ( const double radius_ = 0.0,                           const double sigma_ = 1.0  );        // Border image (add border to image)    void            border ( const Geometry &geometry_                             = borderGeometryDefault );    // Extract channel from image    void            channel ( const ChannelType channel_ );    // Set or obtain modulus channel depth    void            channelDepth ( const ChannelType channel_,                                   const unsigned int depth_ );    unsigned int    channelDepth ( const ChannelType channel_ );    // Charcoal effect image (looks like charcoal sketch)    // The radius_ parameter specifies the radius of the Gaussian, in    // pixels, not counting the center pixel.  The sigma_ parameter    // specifies the standard deviation of the Laplacian, in pixels.    void            charcoal ( const double radius_ = 0.0,                               const double sigma_ = 1.0 );    // Chop image (remove vertical or horizontal subregion of image)    // FIXME: describe how geometry argument is used to select either    // horizontal or vertical subregion of image.    void            chop ( const Geometry &geometry_ );        // Colorize image with pen color, using specified percent opacity    // for red, green, and blue quantums    void            colorize ( const unsigned int opacityRed_,                               const unsigned int opacityGreen_,                               const unsigned int opacityBlue_,			       const Color &penColor_ );    // Colorize image with pen color, using specified percent opacity.    void            colorize ( const unsigned int opacity_,			       const Color &penColor_ );        // Comment image (add comment string to image)    void            comment ( const std::string &comment_ );    // Compare current image with another image    // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError    // in the current image. False is returned if the images are identical.    bool            compare ( const Image &reference_ );    // Compose an image onto another at specified offset and using    // specified algorithm    void            composite ( const Image &compositeImage_,				const int xOffset_,				const int yOffset_,				const CompositeOperator compose_                                = InCompositeOp );    void            composite ( const Image &compositeImage_,				const Geometry &offset_,				const CompositeOperator compose_                                = InCompositeOp );    void            composite ( const Image &compositeImage_,				const GravityType gravity_,				const CompositeOperator compose_                                = InCompositeOp );        // Contrast image (enhance intensity differences in image)    void            contrast ( const unsigned int sharpen_ );    // Convolve image.  Applies a user-specified convolution to the image.    //  order_ represents the number of columns and rows in the filter kernel.    //  kernel_ is an array of doubles representing the convolution kernel.    void            convolve ( const unsigned int order_,                               const double *kernel_ );    // Crop image (subregion of original image)    void            crop ( const Geometry &geometry_ );        // Cycle image colormap    void            cycleColormap ( const int amount_ );        // Despeckle image (reduce speckle noise)    void            despeckle ( void );        // Display image on screen    void            display ( void );        // Draw on image using a single drawable    void            draw ( const Drawable &drawable_ );    // Draw on image using a drawable list    void            draw ( const std::list<Magick::Drawable> &drawable_ );        // Edge image (hilight edges in image)    void            edge ( const double radius_ = 0.0 );        // Emboss image (hilight edges with 3D effect)    // The radius_ parameter specifies the radius of the Gaussian, in    // pixels, not counting the center pixel.  The sigma_ parameter    // specifies the standard deviation of the Laplacian, in pixels.    void            emboss ( const double radius_ = 0.0,                             const double sigma_ = 1.0);        // Enhance image (minimize noise)    void            enhance ( void );        // Equalize image (histogram equalization)    void            equalize ( void );    // Erase image to current "background color"    void            erase ( void );        // Flip image (reflect each scanline in the vertical direction)    void            flip ( void );    // Flood-fill color across pixels that match the color of the    // target pixel and are neighbors of the target pixel.    // Uses current fuzz setting when determining color match.    void            floodFillColor( const unsigned int x_,                                    const unsigned int y_,				    const Color &fillColor_ );    void            floodFillColor( const Geometry &point_,				    const Color &fillColor_ );    // Flood-fill color across pixels starting at target-pixel and    // stopping at pixels matching specified border color.    // Uses current fuzz setting when determining color match.    void            floodFillColor( const unsigned int x_,                                    const unsigned int y_,				    const Color &fillColor_,				    const Color &borderColor_ );    void            floodFillColor( const Geometry &point_,				    const Color &fillColor_,				    const Color &borderColor_ );    // Floodfill pixels matching color (within fuzz factor) of target    // pixel(x,y) with replacement opacity value using method.    void            floodFillOpacity ( const unsigned int x_,                                       const unsigned int y_,                                       const unsigned int opacity_,                                       const PaintMethod method_ );    // Flood-fill texture across pixels that match the color of the    // target pixel and are neighbors of the target pixel.    // Uses current fuzz setting when determining color match.    void            floodFillTexture( const unsigned int x_,                                      const unsigned int y_,				      const Image &texture_ );    void            floodFillTexture( const Geometry &point_,				      const Image &texture_ );    // Flood-fill texture across pixels starting at target-pixel and    // stopping at pixels matching specified border color.    // Uses current fuzz setting when determining color match.    void            floodFillTexture( const unsigned int x_,                                      const unsigned int y_,				      const Image &texture_,				      const Color &borderColor_ );    void            floodFillTexture( const Geometry &point_,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -