From f2ea36ba4906f006fd452cba5ce4462621f1baa7 Mon Sep 17 00:00:00 2001 From: routersys Date: Sun, 5 Jul 2026 08:27:32 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E8=A8=80=E8=AA=9E=E3=83=89=E3=82=AD?= =?UTF-8?q?=E3=83=A5=E3=83=A1=E3=83=B3=E3=83=88=E3=81=B8=E7=94=BB=E5=83=8F?= =?UTF-8?q?=E5=8A=A0=E5=B7=A55=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript/docs/LuaScript.ar-sa.txt | 46 +++++++++++++++++++++++++++ LuaScript/docs/LuaScript.en-us.txt | 47 +++++++++++++++++++++++++++ LuaScript/docs/LuaScript.es-es.txt | 48 ++++++++++++++++++++++++++++ LuaScript/docs/LuaScript.id-id.txt | 47 +++++++++++++++++++++++++++ LuaScript/docs/LuaScript.ja-jp.txt | 51 ++++++++++++++++++++++++++++-- LuaScript/docs/LuaScript.ko-kr.txt | 47 +++++++++++++++++++++++++++ LuaScript/docs/LuaScript.zh-cn.txt | 42 ++++++++++++++++++++++++ LuaScript/docs/LuaScript.zh-tw.txt | 42 ++++++++++++++++++++++++ 8 files changed, 368 insertions(+), 2 deletions(-) diff --git a/LuaScript/docs/LuaScript.ar-sa.txt b/LuaScript/docs/LuaScript.ar-sa.txt index 7e0f33f..b2f8133 100644 --- a/LuaScript/docs/LuaScript.ar-sa.txt +++ b/LuaScript/docs/LuaScript.ar-sa.txt @@ -612,6 +612,52 @@ * يتخطى الاستدعاء في البيئات التي لا تتوفر فيها وحدة معالجة رسومات صالحة. + ○ obj.fill(r, g, b [, a [, x, y, w, h]]) (امتداد خاص بـ YMM4) + يملأ صورة الكائن بلون محدد. يعطى اللون بصيغة RGBA مباشرة من 0 إلى + 255 (نفس نموذج الألوان في obj.setpixel). + r, g, b : مكونات اللون (0-255). + a : الشفافية (0-255). القيمة الافتراضية 255. + x, y, w, h: المستطيل المراد ملؤه. الافتراضي كامل الصورة، ويقص ما خرج + عن النطاق. + مثال: obj.fill(0, 0, 0, 0) -- مسح الكل إلى شفاف + obj.fill(255, 0, 0, 255, 10, 10, 20, 20) + يعمل على المحركين معا. + + ○ obj.getpixelregion(x, y, w, h) (امتداد خاص بـ YMM4) + يقرأ منطقة مستطيلة من البكسلات إلى مصفوفة RGBA مباشرة. الترتيب هو + r, g, b, a لكل بكسل ويبدأ من 1 (الفهرس (صف*w+عمود)*4+1..+4). البكسلات + خارج الصورة تكون 0,0,0,0. + القيمة المعادة: مصفوفة بطول w*h*4. + مثال: local t = obj.getpixelregion(0, 0, obj.w, obj.h) + + ○ obj.putpixelregion(x, y, w, h, البيانات) (امتداد خاص بـ YMM4) + يكتب مصفوفة بنفس ترتيب obj.getpixelregion إلى منطقة مستطيلة. البكسلات + خارج حدود الصورة لا تكتب. + البيانات : مصفوفة RGBA مباشرة بطول w*h*4 (تبدأ من 1). + مثال: obj.putpixelregion(0, 0, obj.w, obj.h, t) + + ○ obj.convolve(النواة, الحجم [, المقسوم_عليه [, الإزاحة]]) (امتداد خاص بـ YMM4) + يطبق التفاف بحجم الحجم×الحجم على صورة الكائن. مفيد للتمويه والتوضيح + واكتشاف الحواف وغيرها. + النواة : عدد الحجم*الحجم من المعاملات (حسب الصفوف، تبدأ من 1). + الحجم : عدد فردي (3، 5، 7 …). الزوجي أو الأقل من 1 يتجاهل. + المقسوم_عليه : يقسم مجموع كل بكسل على هذه القيمة. الافتراضي مجموع + النواة (1 عندما يكون المجموع 0). + الإزاحة : تضاف إلى كل مكون بعد القسمة. الافتراضي 0. + تمدد بكسلات الحواف بأقرب بكسل. يطبق على r, g, b, a جميعا. + مثال: obj.convolve({1,1,1, 1,1,1, 1,1,1}, 3) -- تمويه متوسط + obj.convolve({0,-1,0, -1,5,-1, 0,-1,0}, 3) -- توضيح + يعمل على المحركين معا. + + ○ obj.resize(العرض, الارتفاع [, الترشيح]) (امتداد خاص بـ YMM4) + يغير حجم صورة الكائن إلى الحجم المحدد. تحدّث أيضا obj.w / obj.h وبقية + الأبعاد. + العرض, الارتفاع : أعداد صحيحة >= 1. + الترشيح : "nearest" لأقرب جار، أو خطي عند الحذف. + مثال: obj.resize(obj.w * 2, obj.h * 2) + يعمل على المحركين معا. يترك التشغيل السريع الصورة دون تغيير عندما + تتجاوز النتيجة أقصى حجم للصورة. + ○ obj.getvalue(الهدف) يحصل على القيمة الحالية لـ obj (مثل obj.x و obj.track0). الهدف : "x","y","z","ox","oy","rx","ry","rz","zoom","aspect", diff --git a/LuaScript/docs/LuaScript.en-us.txt b/LuaScript/docs/LuaScript.en-us.txt index ffbef4e..2345930 100644 --- a/LuaScript/docs/LuaScript.en-us.txt +++ b/LuaScript/docs/LuaScript.en-us.txt @@ -634,6 +634,53 @@ onto a transparent scene-sized area. * The call is skipped in environments without a usable GPU. + o obj.fill(r, g, b [, a [, x, y, w, h]]) (YMM4 extension) + Fills the object image with a color, given as straight RGBA in + 0-255 (same color model as obj.setpixel). + r, g, b : Color components (0-255). + a : Opacity (0-255). Default is 255. + x, y, w, h: Rectangle to fill. Defaults to the whole image; out of + range is clipped. + Example: obj.fill(0, 0, 0, 0) -- clear to transparent + obj.fill(255, 0, 0, 255, 10, 10, 20, 20) + Runs on both engines. + + o obj.getpixelregion(x, y, w, h) (YMM4 extension) + Reads a rectangular region of pixels into a straight RGBA array. + The layout is r, g, b, a per pixel and is 1-based (index + (row*w+col)*4+1..+4). Pixels outside the image are 0,0,0,0. + Returns: an array of length w*h*4. + Example: local t = obj.getpixelregion(0, 0, obj.w, obj.h) + + o obj.putpixelregion(x, y, w, h, data) (YMM4 extension) + Writes an array in the same layout as obj.getpixelregion back into a + rectangular region. Pixels outside the image are not written. + data : straight RGBA array of length w*h*4 (1-based). + Example: obj.putpixelregion(0, 0, obj.w, obj.h, t) + + o obj.convolve(kernel, size [, divisor [, offset]]) (YMM4 extension) + Applies a size x size convolution to the object image. Useful for + blur, sharpen, edge detection and so on. + kernel : size*size coefficients, row-major and 1-based. + size : odd number (3, 5, 7 ...). Even or below 1 is ignored. + divisor : divides each pixel sum. Defaults to the kernel sum (1 when + the sum is 0). + offset : added to each component after the division. Default is 0. + Edge pixels are extended by the nearest pixel. Applies to r, g, b, a. + Example: obj.convolve({1,1,1, 1,1,1, 1,1,1}, 3) -- box blur + obj.convolve({0,-1,0, -1,5,-1, 0,-1,0}, 3) -- sharpen + Runs on both engines. + + o obj.resize(width, height [, filter]) (YMM4 extension) + Scales the object image to the given size. obj.w / obj.h and the + other dimensions are updated too. + width, height : integers >= 1. + filter : "nearest" for nearest-neighbor, or linear when + omitted. + Example: obj.resize(obj.w * 2, obj.h * 2) + Runs on both engines. The fast runtime leaves the image unchanged + when the result exceeds the maximum image size. + o obj.getvalue(target) Gets the current value of obj (same as obj.x, obj.track0, etc.). target : "x","y","z","ox","oy","rx","ry","rz","zoom","aspect", diff --git a/LuaScript/docs/LuaScript.es-es.txt b/LuaScript/docs/LuaScript.es-es.txt index 8d5bfb0..097b8cf 100644 --- a/LuaScript/docs/LuaScript.es-es.txt +++ b/LuaScript/docs/LuaScript.es-es.txt @@ -641,6 +641,54 @@ sobre un area transparente del tamano de la escena. * La llamada se omite en entornos sin una GPU utilizable. + o obj.fill(r, g, b [, a [, x, y, w, h]]) (extension de YMM4) + Rellena la imagen del objeto con un color, dado como RGBA directo en + 0-255 (mismo modelo de color que obj.setpixel). + r, g, b : Componentes de color (0-255). + a : Opacidad (0-255). Por defecto 255. + x, y, w, h: Rectangulo a rellenar. Por defecto toda la imagen; lo que + queda fuera de rango se recorta. + Ejemplo: obj.fill(0, 0, 0, 0) -- borrar a transparente + obj.fill(255, 0, 0, 255, 10, 10, 20, 20) + Funciona en ambos motores. + + o obj.getpixelregion(x, y, w, h) (extension de YMM4) + Lee una region rectangular de pixeles en un arreglo RGBA directo. La + disposicion es r, g, b, a por pixel y empieza en 1 (indice + (fila*w+col)*4+1..+4). Los pixeles fuera de la imagen son 0,0,0,0. + Devuelve: un arreglo de longitud w*h*4. + Ejemplo: local t = obj.getpixelregion(0, 0, obj.w, obj.h) + + o obj.putpixelregion(x, y, w, h, datos) (extension de YMM4) + Escribe un arreglo con la misma disposicion que obj.getpixelregion en + una region rectangular. Los pixeles fuera de la imagen no se escriben. + datos : arreglo RGBA directo de longitud w*h*4 (empieza en 1). + Ejemplo: obj.putpixelregion(0, 0, obj.w, obj.h, t) + + o obj.convolve(kernel, tamano [, divisor [, desplazamiento]]) (extension de YMM4) + Aplica una convolucion de tamano x tamano a la imagen del objeto. + Util para desenfoque, enfoque, deteccion de bordes, etc. + kernel : tamano*tamano coeficientes, por filas y empieza en 1. + tamano : numero impar (3, 5, 7 ...). Par o menor que 1 se ignora. + divisor : divide la suma de cada pixel. Por defecto la suma del + kernel (1 cuando la suma es 0). + desplazamiento: se suma a cada componente tras la division. Por + defecto 0. + Los pixeles de borde se extienden con el pixel mas cercano. Se aplica + a r, g, b, a. + Ejemplo: obj.convolve({1,1,1, 1,1,1, 1,1,1}, 3) -- desenfoque + obj.convolve({0,-1,0, -1,5,-1, 0,-1,0}, 3) -- enfoque + Funciona en ambos motores. + + o obj.resize(ancho, alto [, filtro]) (extension de YMM4) + Escala la imagen del objeto al tamano indicado. obj.w / obj.h y las + demas dimensiones tambien se actualizan. + ancho, alto : enteros >= 1. + filtro : "nearest" para vecino mas cercano, o lineal si se omite. + Ejemplo: obj.resize(obj.w * 2, obj.h * 2) + Funciona en ambos motores. El runtime rapido deja la imagen sin + cambios cuando el resultado supera el tamano maximo de imagen. + o obj.getvalue(target) Obtiene el valor actual de obj (igual que obj.x, obj.track0, etc.). target : "x","y","z","ox","oy","rx","ry","rz","zoom","aspect", diff --git a/LuaScript/docs/LuaScript.id-id.txt b/LuaScript/docs/LuaScript.id-id.txt index b26da12..c5aae62 100644 --- a/LuaScript/docs/LuaScript.id-id.txt +++ b/LuaScript/docs/LuaScript.id-id.txt @@ -637,6 +637,53 @@ area transparan seukuran adegan. * Panggilan dilewati pada lingkungan tanpa GPU yang dapat digunakan. + o obj.fill(r, g, b [, a [, x, y, w, h]]) (ekstensi YMM4) + Mengisi gambar objek dengan warna, diberikan sebagai RGBA lurus dalam + 0-255 (model warna sama dengan obj.setpixel). + r, g, b : Komponen warna (0-255). + a : Opasitas (0-255). Default 255. + x, y, w, h: Persegi panjang yang diisi. Default seluruh gambar; di + luar jangkauan dipangkas. + Contoh: obj.fill(0, 0, 0, 0) -- bersihkan jadi transparan + obj.fill(255, 0, 0, 255, 10, 10, 20, 20) + Berjalan di kedua mesin. + + o obj.getpixelregion(x, y, w, h) (ekstensi YMM4) + Membaca wilayah piksel persegi panjang ke dalam larik RGBA lurus. + Susunannya r, g, b, a per piksel dan berbasis 1 (indeks + (baris*w+kolom)*4+1..+4). Piksel di luar gambar bernilai 0,0,0,0. + Mengembalikan: larik sepanjang w*h*4. + Contoh: local t = obj.getpixelregion(0, 0, obj.w, obj.h) + + o obj.putpixelregion(x, y, w, h, data) (ekstensi YMM4) + Menulis larik dengan susunan sama seperti obj.getpixelregion kembali + ke wilayah persegi panjang. Piksel di luar gambar tidak ditulis. + data : larik RGBA lurus sepanjang w*h*4 (berbasis 1). + Contoh: obj.putpixelregion(0, 0, obj.w, obj.h, t) + + o obj.convolve(kernel, ukuran [, pembagi [, offset]]) (ekstensi YMM4) + Menerapkan konvolusi ukuran x ukuran ke gambar objek. Berguna untuk + blur, penajaman, deteksi tepi, dan sebagainya. + kernel : ukuran*ukuran koefisien, urut baris dan berbasis 1. + ukuran : bilangan ganjil (3, 5, 7 ...). Genap atau di bawah 1 diabaikan. + pembagi : membagi jumlah tiap piksel. Default jumlah kernel (1 bila + jumlahnya 0). + offset : ditambahkan ke tiap komponen setelah pembagian. Default 0. + Piksel tepi diperluas dengan piksel terdekat. Berlaku untuk r, g, b, a. + Contoh: obj.convolve({1,1,1, 1,1,1, 1,1,1}, 3) -- blur rata-rata + obj.convolve({0,-1,0, -1,5,-1, 0,-1,0}, 3) -- penajaman + Berjalan di kedua mesin. + + o obj.resize(lebar, tinggi [, filter]) (ekstensi YMM4) + Menskala gambar objek ke ukuran yang diberikan. obj.w / obj.h dan + dimensi lainnya ikut diperbarui. + lebar, tinggi : bilangan bulat >= 1. + filter : "nearest" untuk tetangga terdekat, atau linear bila + dihilangkan. + Contoh: obj.resize(obj.w * 2, obj.h * 2) + Berjalan di kedua mesin. Runtime cepat membiarkan gambar tanpa + perubahan bila hasilnya melebihi ukuran gambar maksimum. + o obj.getvalue(target) Mengambil nilai saat ini dari obj (sama dengan obj.x, obj.track0, dll.). target : "x","y","z","ox","oy","rx","ry","rz","zoom","aspect", diff --git a/LuaScript/docs/LuaScript.ja-jp.txt b/LuaScript/docs/LuaScript.ja-jp.txt index ce7919d..24ce410 100644 --- a/LuaScript/docs/LuaScript.ja-jp.txt +++ b/LuaScript/docs/LuaScript.ja-jp.txt @@ -616,6 +616,51 @@ シーンサイズ領域へオブジェクトを合成した仮想の画像です。 ※ GPUが使用できない環境では呼び出しはスキップされます。 + ○obj.fill(r, g, b [, a [, x, y, w, h]]) ※YMM4独自拡張 + オブジェクト画像を指定色で塗りつぶします。色は 0~255 のストレート + RGBA で指定します(obj.setpixel と同じ表色)。 + r, g, b : 色成分(0~255)。 + a : 不透明度(0~255)。省略時は 255。 + x, y, w, h : 塗りつぶす矩形。省略時は画像全体。範囲外は切り詰めます。 + 例:obj.fill(0, 0, 0, 0) -- 全体を透明で消去 + obj.fill(255, 0, 0, 255, 10, 10, 20, 20) + 両エンジンで動きます。 + + ○obj.getpixelregion(x, y, w, h) ※YMM4独自拡張 + 矩形領域の画素をストレート RGBA の配列で取得します。並びは画素ごと + に r, g, b, a の順で 1 始まりです(索引 (行*w+列)*4+1~+4)。範囲外の + 画素は 0,0,0,0 になります。 + 戻り値 : 長さ w*h*4 の配列。 + 例:local t = obj.getpixelregion(0, 0, obj.w, obj.h) + + ○obj.putpixelregion(x, y, w, h, データ) ※YMM4独自拡張 + obj.getpixelregion と同じ並びの配列を矩形領域へ書き戻します。画像の + 範囲外へはみ出した画素は書き込みません。 + データ : 長さ w*h*4 のストレート RGBA 配列(1 始まり)。 + 例:obj.putpixelregion(0, 0, obj.w, obj.h, t) + + ○obj.convolve(カーネル, サイズ [, 除数 [, オフセット]]) ※YMM4独自拡張 + オブジェクト画像へ サイズ×サイズ の畳み込みを適用します。ぼかし、 + シャープ、輪郭抽出などに使えます。 + カーネル : サイズ*サイズ 個の係数配列(行優先, 1 始まり)。 + サイズ : 奇数(3, 5, 7 …)。偶数や 1 未満は無視します。 + 除数 : 各画素の合計をこの値で割ります。省略時はカーネルの + 合計(合計が 0 のときは 1)。 + オフセット : 除算後に各成分へ加算します。省略時は 0。 + 端の画素は最も近い画素で補います。r, g, b, a すべてに適用します。 + 例:obj.convolve({1,1,1, 1,1,1, 1,1,1}, 3) -- 平均ぼかし + obj.convolve({0,-1,0, -1,5,-1, 0,-1,0}, 3) -- シャープ + 両エンジンで動きます。 + + ○obj.resize(幅, 高さ [, 補間]) ※YMM4独自拡張 + オブジェクト画像を指定サイズへ拡大縮小します。obj.w / obj.h などの + 寸法も更新されます。 + 幅, 高さ : 1 以上の整数。 + 補間 : "nearest"(最近傍)または省略で線形補間。 + 例:obj.resize(obj.w * 2, obj.h * 2) + 両エンジンで動きます。高速ランタイムでは結果が最大画像サイズを + 超える場合は変更しません。 + ○obj.getvalue(対象) obj の現在値を取得します(obj.x や obj.track0 等と同値)。 対象 : "x","y","z","ox","oy","rx","ry","rz","zoom","aspect", @@ -1016,8 +1061,10 @@ ○描画・合成・読み込み obj.draw / obj.drawpoly による描画合成、obj.copybuffer による - バッファ操作、obj.load("figure"/"text"/"image"/"movie") による生成・ - 読み込み、obj.setfont、obj.effect、obj.getvalue、obj.getaudio、obj.getinfo、obj.setoption / + バッファ操作、obj.fill / obj.getpixelregion / obj.putpixelregion / + obj.convolve / obj.resize による画像加工、obj.load("figure"/"text"/ + "image"/"movie") による生成・読み込み、obj.setfont、obj.effect、 + obj.getvalue、obj.getaudio、obj.getinfo、obj.setoption / obj.getoption / obj.pixeloption に対応します。詳細は「obj テーブル - 関数」を参照してください。 diff --git a/LuaScript/docs/LuaScript.ko-kr.txt b/LuaScript/docs/LuaScript.ko-kr.txt index 8b8358f..42583fb 100644 --- a/LuaScript/docs/LuaScript.ko-kr.txt +++ b/LuaScript/docs/LuaScript.ko-kr.txt @@ -605,6 +605,53 @@ 장면 크기의 투명한 영역에 오브젝트를 합성한 가상 이미지입니다. ※ GPU를 사용할 수 없는 환경에서는 호출이 건너뛰어집니다. + ○ obj.fill(r, g, b [, a [, x, y, w, h]]) (YMM4 전용 확장) + 오브젝트 이미지를 지정한 색으로 채웁니다. 색은 0~255 의 스트레이트 + RGBA 로 지정합니다(obj.setpixel 과 같은 표색). + r, g, b : 색 성분(0~255). + a : 불투명도(0~255). 생략 시 255. + x, y, w, h: 채울 사각형. 생략 시 이미지 전체이며 범위를 벗어나면 + 잘립니다. + 예: obj.fill(0, 0, 0, 0) -- 전체를 투명으로 지움 + obj.fill(255, 0, 0, 255, 10, 10, 20, 20) + 두 엔진 모두에서 동작합니다. + + ○ obj.getpixelregion(x, y, w, h) (YMM4 전용 확장) + 사각형 영역의 픽셀을 스트레이트 RGBA 배열로 가져옵니다. 배열은 + 픽셀마다 r, g, b, a 순이며 1 부터 시작합니다(색인 (행*w+열)*4+1~+4). + 이미지 밖의 픽셀은 0,0,0,0 입니다. + 반환값 : 길이 w*h*4 의 배열. + 예: local t = obj.getpixelregion(0, 0, obj.w, obj.h) + + ○ obj.putpixelregion(x, y, w, h, 데이터) (YMM4 전용 확장) + obj.getpixelregion 과 같은 배열을 사각형 영역에 다시 씁니다. 이미지 + 범위를 벗어난 픽셀은 쓰지 않습니다. + 데이터 : 길이 w*h*4 의 스트레이트 RGBA 배열(1 부터 시작). + 예: obj.putpixelregion(0, 0, obj.w, obj.h, t) + + ○ obj.convolve(커널, 크기 [, 제수 [, 오프셋]]) (YMM4 전용 확장) + 오브젝트 이미지에 크기×크기 의 컨볼루션을 적용합니다. 흐림, 샤픈, + 윤곽 검출 등에 사용할 수 있습니다. + 커널 : 크기*크기 개의 계수 배열(행 우선, 1 부터 시작). + 크기 : 홀수(3, 5, 7 …). 짝수나 1 미만은 무시합니다. + 제수 : 각 픽셀의 합계를 이 값으로 나눕니다. 생략 시 커널의 + 합계(합계가 0 이면 1). + 오프셋 : 나눗셈 후 각 성분에 더합니다. 생략 시 0. + 가장자리 픽셀은 가장 가까운 픽셀로 채웁니다. r, g, b, a 모두에 + 적용됩니다. + 예: obj.convolve({1,1,1, 1,1,1, 1,1,1}, 3) -- 평균 흐림 + obj.convolve({0,-1,0, -1,5,-1, 0,-1,0}, 3) -- 샤픈 + 두 엔진 모두에서 동작합니다. + + ○ obj.resize(너비, 높이 [, 보간]) (YMM4 전용 확장) + 오브젝트 이미지를 지정한 크기로 확대/축소합니다. obj.w / obj.h 등의 + 치수도 갱신됩니다. + 너비, 높이 : 1 이상의 정수. + 보간 : "nearest"(최근접) 또는 생략 시 선형 보간. + 예: obj.resize(obj.w * 2, obj.h * 2) + 두 엔진 모두에서 동작합니다. 고속 런타임에서는 결과가 최대 이미지 + 크기를 넘으면 변경하지 않습니다. + ○ obj.getvalue(대상) obj의 현재 값을 가져옵니다(obj.x, obj.track0 등과 동일). 대상 : "x","y","z","ox","oy","rx","ry","rz","zoom","aspect", diff --git a/LuaScript/docs/LuaScript.zh-cn.txt b/LuaScript/docs/LuaScript.zh-cn.txt index 09ae6ea..0b70865 100644 --- a/LuaScript/docs/LuaScript.zh-cn.txt +++ b/LuaScript/docs/LuaScript.zh-cn.txt @@ -586,6 +586,48 @@ 场景大小透明区域后的虚拟图像。 ※ 在无法使用GPU的环境中会跳过该调用。 + ○ obj.fill(r, g, b [, a [, x, y, w, h]]) (YMM4 独有扩展) + 以指定颜色填充对象图像。颜色以 0~255 的直通 RGBA 指定(与 + obj.setpixel 相同的表色)。 + r, g, b : 颜色分量(0~255)。 + a : 不透明度(0~255)。省略时为 255。 + x, y, w, h: 要填充的矩形。省略时为整幅图像,超出范围会被裁剪。 + 例: obj.fill(0, 0, 0, 0) -- 将整体清为透明 + obj.fill(255, 0, 0, 255, 10, 10, 20, 20) + 在两个引擎中均可使用。 + + ○ obj.getpixelregion(x, y, w, h) (YMM4 独有扩展) + 将矩形区域的像素读入直通 RGBA 数组。排列为每个像素 r, g, b, a, + 从 1 开始(索引 (行*w+列)*4+1~+4)。图像外的像素为 0,0,0,0。 + 返回值: 长度为 w*h*4 的数组。 + 例: local t = obj.getpixelregion(0, 0, obj.w, obj.h) + + ○ obj.putpixelregion(x, y, w, h, 数据) (YMM4 独有扩展) + 将与 obj.getpixelregion 相同排列的数组写回矩形区域。超出图像范围的 + 像素不会被写入。 + 数据 : 长度为 w*h*4 的直通 RGBA 数组(从 1 开始)。 + 例: obj.putpixelregion(0, 0, obj.w, obj.h, t) + + ○ obj.convolve(卷积核, 大小 [, 除数 [, 偏移]]) (YMM4 独有扩展) + 对对象图像应用 大小×大小 的卷积。可用于模糊、锐化、边缘检测等。 + 卷积核 : 大小*大小 个系数数组(行优先,从 1 开始)。 + 大小 : 奇数(3、5、7 …)。偶数或小于 1 会被忽略。 + 除数 : 每个像素的合计除以该值。省略时为卷积核的合计(合计为 0 + 时为 1)。 + 偏移 : 除法后加到各分量上。省略时为 0。 + 边缘像素以最近的像素补充。对 r, g, b, a 全部生效。 + 例: obj.convolve({1,1,1, 1,1,1, 1,1,1}, 3) -- 均值模糊 + obj.convolve({0,-1,0, -1,5,-1, 0,-1,0}, 3) -- 锐化 + 在两个引擎中均可使用。 + + ○ obj.resize(宽, 高 [, 插值]) (YMM4 独有扩展) + 将对象图像缩放到指定尺寸。obj.w / obj.h 等尺寸也会更新。 + 宽, 高 : 大于等于 1 的整数。 + 插值 : "nearest"(最近邻)或省略以进行线性插值。 + 例: obj.resize(obj.w * 2, obj.h * 2) + 在两个引擎中均可使用。在快速运行时中,若结果超过最大图像尺寸 + 则不做更改。 + ○ obj.getvalue(目标) 获取 obj 的当前值(与 obj.x、obj.track0 等相同)。 目标 : "x","y","z","ox","oy","rx","ry","rz","zoom","aspect", diff --git a/LuaScript/docs/LuaScript.zh-tw.txt b/LuaScript/docs/LuaScript.zh-tw.txt index 549109d..bb3fa7a 100644 --- a/LuaScript/docs/LuaScript.zh-tw.txt +++ b/LuaScript/docs/LuaScript.zh-tw.txt @@ -586,6 +586,48 @@ 場景大小透明區域後的虛擬影像。 ※ 在無法使用GPU的環境中會跳過該呼叫。 + ○ obj.fill(r, g, b [, a [, x, y, w, h]]) (YMM4 獨有擴充) + 以指定顏色填滿物件影像。顏色以 0~255 的直通 RGBA 指定(與 + obj.setpixel 相同的表色)。 + r, g, b : 顏色分量(0~255)。 + a : 不透明度(0~255)。省略時為 255。 + x, y, w, h: 要填滿的矩形。省略時為整幅影像,超出範圍會被裁切。 + 例: obj.fill(0, 0, 0, 0) -- 將整體清為透明 + obj.fill(255, 0, 0, 255, 10, 10, 20, 20) + 在兩個引擎中均可使用。 + + ○ obj.getpixelregion(x, y, w, h) (YMM4 獨有擴充) + 將矩形區域的像素讀入直通 RGBA 陣列。排列為每個像素 r, g, b, a, + 從 1 開始(索引 (列*w+行)*4+1~+4)。影像外的像素為 0,0,0,0。 + 回傳值: 長度為 w*h*4 的陣列。 + 例: local t = obj.getpixelregion(0, 0, obj.w, obj.h) + + ○ obj.putpixelregion(x, y, w, h, 資料) (YMM4 獨有擴充) + 將與 obj.getpixelregion 相同排列的陣列寫回矩形區域。超出影像範圍的 + 像素不會被寫入。 + 資料 : 長度為 w*h*4 的直通 RGBA 陣列(從 1 開始)。 + 例: obj.putpixelregion(0, 0, obj.w, obj.h, t) + + ○ obj.convolve(卷積核, 大小 [, 除數 [, 偏移]]) (YMM4 獨有擴充) + 對物件影像套用 大小×大小 的卷積。可用於模糊、銳化、邊緣偵測等。 + 卷積核 : 大小*大小 個係數陣列(列優先,從 1 開始)。 + 大小 : 奇數(3、5、7 …)。偶數或小於 1 會被忽略。 + 除數 : 每個像素的合計除以該值。省略時為卷積核的合計(合計為 0 + 時為 1)。 + 偏移 : 除法後加到各分量上。省略時為 0。 + 邊緣像素以最近的像素補足。對 r, g, b, a 全部生效。 + 例: obj.convolve({1,1,1, 1,1,1, 1,1,1}, 3) -- 平均模糊 + obj.convolve({0,-1,0, -1,5,-1, 0,-1,0}, 3) -- 銳化 + 在兩個引擎中均可使用。 + + ○ obj.resize(寬, 高 [, 內插]) (YMM4 獨有擴充) + 將物件影像縮放到指定尺寸。obj.w / obj.h 等尺寸也會更新。 + 寬, 高 : 大於等於 1 的整數。 + 內插 : "nearest"(最近鄰)或省略以進行線性內插。 + 例: obj.resize(obj.w * 2, obj.h * 2) + 在兩個引擎中均可使用。在快速執行環境中,若結果超過最大影像尺寸 + 則不做變更。 + ○ obj.getvalue(目標) 取得 obj 的目前值(與 obj.x、obj.track0 等相同)。 目標 : "x","y","z","ox","oy","rx","ry","rz","zoom","aspect",