Process images using GD Graphics Library.
status:=imagefrompicture(image;format)
format 形式の画像をgd2に変換してstatus.imageに返します。成否はstatus.successに返されます。format は正確でなければなりません。
プラグインにはPHPのGdImageクラスに相当するものがないため,GDライブラリの内部的なフォーマットをそのままピクチャー型として扱います。このフォーマットは固定長のチャンクサイズに画像データが配列されているため,アクセスが高速であるとされています。なお,プラグインのチャンクサイズは標準のGD2_CHUNKSIZEそして無圧縮のGD2_FMT_RAWフォーマットです。
Parameter
Type
Description
image
Picture
format
Integer
status
Object
status:=imagetopicture(image;format{;options})
gd2形式の画像をformat に変換してstatus.imageに返します。成否はstatus.successに返されます。IMG_WBMPとIMG_WEBPは4Dで表示できないピクチャー形式なので,gd2 と同じく内部的にBLOB TO PICTUREを呼び出してピクチャーに変換しています。ファイルとして書き出す場合,WRITE PICTURE FILEのようなピクチャーコマンドではなく,PICTURE TO BLOBでデータに変換した上でBlobとして扱う必要があります。
Image Format
| Constant | Type | Description |
|---|---|---|
| IMG_PNG | Integer | 0 |
| IMG_BMP | Integer | 1 |
| IMG_GIF | Integer | 2 |
| IMG_JPEG | Integer | 3 |
| IMG_TIFF | Integer | 4 |
| IMG_WBMP | Integer | 5 |
| IMG_WEBP | Integer | 6 |
Options for imagetopicture
| Property | Type | Description |
|---|---|---|
| resolutionX | Integer | |
| resolutionY | Integer | |
| compression | Integer | BMP |
| quality | Integer | JPEG |
| saveAlpha | Boolean | PNG |
| interlace | Boolean | GIF |
| transparent | Integer | 旧式ブラウザ向け・saveAlphaと相互に排他的 |
| antiAliased | Boolean | |
| dontBlend | Boolean | antiAliasedと併用 |
color:=imagecolorclosest(image;r;g;b)
color:=imagecolorclosestalpha(image;r;g;b;a)
color:=imagecolorclosesthwb(image;r;g;b)
color:=imagecolorexact(image;r;g;b)
color:=imagecolorexactalpha(image;r;g;b;a)
color:=imagecolorresolve(image;r;g;b)
color:=imagecolorresolvealpha(image;r;g;b;a)
color:=imagegetpixel(image;x;y)
status:=imagesetpixel(image;x;y;color{;options})
Options for imagesetpixel
| Property | Type | Description |
|---|---|---|
| alphaBlending | Boolean |
status:=imagegammacorrect(image;options)
Parameter
Type
Description
image
Picture
options
Object
status
Object
| Property | Type | Description |
|---|---|---|
| inputGamma | Real | |
| outputGamma | Real |
PHPからの移植です。すべてのピクセルをループ処理で書き換えます。
status:=imageflip(image;options)
Options for imageflip
| Property | Type | Description |
|---|---|---|
| flipMode | Integer |
Image Flip Mode
| Constant | Type | Description |
|---|---|---|
| IMG_FLIP_HORIZONTAL | Integer | 0 |
| IMG_FLIP_VERTICAL | Integer | 1 |
| IMG_FLIP_BOTH | Integer | 2 |
status:=imagecrop(image;options)
Options for imagecrop
| Property | Type | Description |
|---|---|---|
| x | Integer | |
| y | Integer | |
| width | Integer | |
| height | Integer |
status:=imagecropauto(image;options)
Options for imagecropauto
| Property | Type | Description |
|---|---|---|
| mode | Integer | |
| threshold | Integer | |
| color | Integer |
Image crop Mode
| Constant | Type | Description |
|---|---|---|
| IMG_CROP_DEFAULT | Integer | 0 |
| IMG_CROP_TRANSPARENT | Integer | 1 |
| IMG_CROP_BLACK | Integer | 2 |
| IMG_CROP_WHITE | Integer | 3 |
| IMG_CROP_SIDES | Integer | 4 |
| IMG_CROP_THRESHOLD | Integer | 5 |
status:=imagerotate(image;options)
Options for imagerotate
| Property | Type | Description |
|---|---|---|
| degrees | Real | |
| color | Integer |
status:=imagefilter(image;options)
Image Filters
| Constant | Type | Description |
|---|---|---|
| IMG_FILTER_NONE | LONGINT | 0 |
| IMG_FILTER_NEGATE | LONGINT | 1 |
| IMG_FILTER_GRAYSCALE | LONGINT | 2 |
| IMG_FILTER_EDGEDETECT | LONGINT | 3 |
| IMG_FILTER_EMBOSS | LONGINT | 4 |
| IMG_FILTER_GAUSSIAN_BLUR | LONGINT | 5 |
| IMG_FILTER_SELECTIVE_BLUR | LONGINT | 6 |
| IMG_FILTER_MEAN_REMOVAL | LONGINT | 7 |
| IMG_FILTER_SMOOTH | LONGINT | 8 |
| IMG_FILTER_CONTRAST | LONGINT | 9 |
| IMG_FILTER_BRIGHTNESS | LONGINT | 10 |
| IMG_FILTER_SCATTER | LONGINT | 11 |
| IMG_FILTER_PIXELATE | LONGINT | 12 |
| IMG_FILTER_COLORIZE | LONGINT | 13 |
| IMG_FILTER_CONVOLUTION | LONGINT | 14 |
注記: PHPはgdImageGaussianBlurを使用しているのに対し,プラグインはgdImageCopyGaussianBlurredを呼び出しています。
Options for imagefilter
| Property | Type | Description |
|---|---|---|
| filter | Integer | |
| radius | Integer | GAUSSIAN_BLUR |
| sigma | Real | GAUSSIAN_BLUR |
| weight | Real | SMOOTH |
| contrast | Real | CONTRAST |
| brightness | Integer | BRIGHTNESS |
| sub | Integer | SCATTER |
| plus | Integer | SCATTER |
| size | Integer | PIXELATE |
| mode | Integer | PIXELATE |
| red | Integer | COLORIZE |
| green | Integer | COLORIZE |
| blue | Integer | COLORIZE |
| alpha | Integer | COLORIZE |
| div | Real | CONVOLUTION |
| offset | Real | CONVOLUTION |
| matrix[] | Collection | CONVOLUTION |
PREVIOUSText Input Service v2