C 로 PHP 확장 이미지 구현Tool 그림 상용 처리 도구 클래스 사용
class Image_Tool{
/**
* Image_Tool
* @param string|array $img_data
* $img_data
*/
function __construct($img_data="");
/**
* ,
* @access public
* @param string $txt UTF8
* @param float $opacity
* @param constant $gravity
* :
* NorthWest,North,NorthEast,West, Center,East,SouthWest,South,SouthEast,Static
* @param array $font :
* name, , , , , 。
* :SimSun( , )、SimKai( )、SimHei( )、MicroHei( )、Arial
* weight, ,int
* size, ,int
* color, , :"blue", "#0000ff", "rgb(0,0,255)" , "black";
* @return boolean
*/
function annotate($txt, $opacity, $gravity, array $font);
/**
* , Image_Tool
* @access public
* @return void
*/
function clean();
*
* , ,
* @access public
* @param int $src_img , ImageTool
* @param int $x X
* @param string $y Y
* @return boolean
*
function composite($src_img, $x, $y);
/**
*
* @access public
* @return string
*/
function errmsg();
/**
*
* @access public
* @return int
*/
function errcode();
/**
*
* @access public
* @param string $format
* @param boolean $display
* @return boolean|string $display true, void, 。 false
*/
function exec($format, $display=false);
/**
*
* @access public
* @return boolean
*/
function flipH();
/**
*
* @access public
* @return boolean
*/
function flipV();
/**
*
* @access public
* @return array|boolean false
*/
function getImageAttr();
/**
* , , exec
* @access public
* @return boolean
*/
function improve();
/**
* , width height ,
* @access public
* @param int $width
* @param int $height
* @param boolean $thumbnail
* @return boolean
*/
function resize($width, $height, $thumbnail=true);
/**
* .1
* @access public
* @param float $ratio
* @param boolean $thumbnail
* @return boolean
*/
function resizeRatio($ratio, $thumbnail=true);
/**
*
* @access public
* @param int $degree (0 - 360)
* @return boolean
*/
function rotate($degree=90);
/**
*
* @access public
* @param string $img_blob
* @return boolean
*/
function setData($img_blob);
}
3.확장 1.phopfetch_url.h
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_IMAGE_TOOL_H
#define PHP_IMAGE_TOOL_H
extern zend_module_entry image_tool_module_entry;
#define phpext_image_tool_ptr &image_tool_module_entry
#ifdef PHP_WIN32
# define PHP_IMAGE_TOOL_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_IMAGE_TOOL_API __attribute__ ((visibility("default")))
#else
# define PHP_IMAGE_TOOL_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
#define FETCH_THIS Z_OBJCE_P(getThis()), getThis()
#define IMAGETOOL_MAGICKWAND_RSRC_NAME "MagickWand"
#define IMAGETOOL_PIXELWAND_RSRC_NAME "PixelWand"
#define IMAGETOOL_NORTHWEST 1
#define IMAGETOOL_NORTH 2
#define IMAGETOOL_NORTHEAST 3
#define IMAGETOOL_WEST 4
#define IMAGETOOL_CENTER 5
#define IMAGETOOL_EAST 6
#define IMAGETOOL_SOUTHWEST 7
#define IMAGETOOL_SOUTH 8
#define IMAGETOOL_SOUTHEAST 9
#define IMAGETOOL_STATIC 10
#define IMAGETOOL_TOP_LEFT 1
#define IMAGETOOL_TOP_CENTER 2
#define IMAGETOOL_TOP_RIGHT 3
#define IMAGETOOL_CENTER_LEFT 4
#define IMAGETOOL_CENTER_CENTER 5
#define IMAGETOOL_CENTER_RIGHT 6
#define IMAGETOOL_BOTTOM_LEFT 7
#define IMAGETOOL_BOTTOM_CENTER 8
#define IMAGETOOL_BOTTOM_RIGHT 9
#define GET_MAGICK_WAND(zval, magick_wand) zval = zend_read_property(FETCH_THIS, ZEND_STRL("magick_wand"), 0 TSRMLS_CC);\
ZEND_FETCH_RESOURCE_NO_RETURN(magick_wand, MagickWand*, &zval, -1, IMAGETOOL_MAGICKWAND_RSRC_NAME, le_image_wand);
PHP_MINIT_FUNCTION(image_tool);
PHP_MSHUTDOWN_FUNCTION(image_tool);
PHP_RINIT_FUNCTION(image_tool);
PHP_RSHUTDOWN_FUNCTION(image_tool);
PHP_MINFO_FUNCTION(image_tool);
#ifdef ZTS
#define IMAGE_TOOL_G(v) TSRMG(image_tool_globals_id, zend_image_tool_globals *, v)
#else
#define IMAGE_TOOL_G(v) (image_tool_globals.v)
#endif
#endif /* PHP_IMAGE_TOOL_H */
원본 다운로드 주소:http://l9.yunpan.cn/lk/QEcqyYY6zy9YR
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Is Eclipse IDE dying?In 2014 the Eclipse IDE is the leading development environment for Java with a market share of approximately 65%. but ac...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.