From db8017a8ced6a7e092df82d7f11eb5edae095bec Mon Sep 17 00:00:00 2001 From: routersys Date: Sat, 4 Jul 2026 17:28:13 +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=AE=E3=82=AB=E3=83=BC?= =?UTF-8?q?=E3=83=8D=E3=83=AB=E5=AF=BE=E8=B1=A1=E6=A7=8B=E6=96=87=E3=82=92?= =?UTF-8?q?=E6=94=B9=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript/docs/LuaScript.ar-sa.txt | 26 ++++++++++++++++++++------ LuaScript/docs/LuaScript.en-us.txt | 26 ++++++++++++++++++++------ LuaScript/docs/LuaScript.es-es.txt | 29 +++++++++++++++++++++++------ LuaScript/docs/LuaScript.id-id.txt | 27 +++++++++++++++++++++------ LuaScript/docs/LuaScript.ja-jp.txt | 27 +++++++++++++++++++++------ LuaScript/docs/LuaScript.ko-kr.txt | 27 +++++++++++++++++++++------ LuaScript/docs/LuaScript.zh-cn.txt | 25 +++++++++++++++++++------ LuaScript/docs/LuaScript.zh-tw.txt | 25 +++++++++++++++++++------ 8 files changed, 164 insertions(+), 48 deletions(-) diff --git a/LuaScript/docs/LuaScript.ar-sa.txt b/LuaScript/docs/LuaScript.ar-sa.txt index c7538bb..6ca2057 100644 --- a/LuaScript/docs/LuaScript.ar-sa.txt +++ b/LuaScript/docs/LuaScript.ar-sa.txt @@ -58,14 +58,28 @@ obj.setpixel(x, y, r2, g2, b2 [, a2]) end end + الشكل التالي الذي يستخدم getpixeldata يتحول إلى نواة أيضاً. + local data = obj.getpixeldata() + for y = 0, data.height - 1 do + for x = 0, data.width - 1 do + local i = (y * data.width + x) * 4 + local r = data:get(i + 1) + data:set(i + 1, r2) + data:set(i + 2, g2) + data:set(i + 3, b2) + end + end + obj.putpixeldata(data) · يجوز في الجسم استخدام العمليات الحسابية و math.* والمقارنات - وصيغة العتبة "cond and value1 or value2" ومتغيرات local فقط. - · يجوز الإشارة فقط إلى البكسل الجاري معالجته (getpixel(x, y)) - وقيم مثل obj/scene/time. + وصيغة العتبة "cond and value1 or value2" والإسناد الشرطي إلى + متغيرات local عبر if/elseif/else ومتغيرات local فقط. + · يجوز أيضاً استخدام أسماء بديلة لحدود الحلقة مثل local w = obj.w. + · يجوز الإشارة فقط إلى البكسل الجاري معالجته وقيم مثل + obj/scene/time. · أي استخدام لأخذ عينات الجوار (التمويه، إلخ) أو الكتابة إلى - إحداثيات أخرى أو getpixeldata أو getobject أو عمليات - الجداول/السلاسل أو جُمَل if لا يتحول إلى نواة ويُنفَّذ تلقائياً - على المحرك التقليدي. + إحداثيات أخرى أو استدعاء setpixel أو set داخل جملة if أو + getobject أو عمليات الجداول/السلاسل لا يتحول إلى نواة + ويُنفَّذ تلقائياً على المحرك التقليدي. مثال (يجعل شكلاً أبيض أحمر): --!gpu diff --git a/LuaScript/docs/LuaScript.en-us.txt b/LuaScript/docs/LuaScript.en-us.txt index b8c5db1..0fb11ac 100644 --- a/LuaScript/docs/LuaScript.en-us.txt +++ b/LuaScript/docs/LuaScript.en-us.txt @@ -60,15 +60,29 @@ obj.setpixel(x, y, r2, g2, b2 [, a2]) end end + The following form using getpixeldata becomes a kernel as well. + local data = obj.getpixeldata() + for y = 0, data.height - 1 do + for x = 0, data.width - 1 do + local i = (y * data.width + x) * 4 + local r = data:get(i + 1) + data:set(i + 1, r2) + data:set(i + 2, g2) + data:set(i + 3, b2) + end + end + obj.putpixeldata(data) - The body may use only arithmetic, math.*, comparisons, the - threshold idiom "cond and value1 or value2", and local + threshold idiom "cond and value1 or value2", conditional + assignment to local variables via if/elseif/else, and local variables. - - It may reference only the current pixel being processed - (getpixel(x, y)) and values such as obj/scene/time. + - Loop bounds may also use aliases such as local w = obj.w. + - It may reference only the current pixel being processed and + values such as obj/scene/time. - Anything using neighbor sampling (blur, etc.), writes to other - coordinates, getpixeldata, getobject, table/string operations, - or if statements is not turned into a kernel and automatically - runs on the classic engine. + coordinates, setpixel or set calls inside an if statement, + getobject, or table/string operations is not turned into a + kernel and automatically runs on the classic engine. Example (turns a white figure red): --!gpu diff --git a/LuaScript/docs/LuaScript.es-es.txt b/LuaScript/docs/LuaScript.es-es.txt index 2adde58..3b9ef9e 100644 --- a/LuaScript/docs/LuaScript.es-es.txt +++ b/LuaScript/docs/LuaScript.es-es.txt @@ -61,14 +61,31 @@ obj.setpixel(x, y, r2, g2, b2 [, a2]) end end + La siguiente forma con getpixeldata también se convierte en núcleo. + local data = obj.getpixeldata() + for y = 0, data.height - 1 do + for x = 0, data.width - 1 do + local i = (y * data.width + x) * 4 + local r = data:get(i + 1) + data:set(i + 1, r2) + data:set(i + 2, g2) + data:set(i + 3, b2) + end + end + obj.putpixeldata(data) - El cuerpo solo puede usar aritmética, math.*, comparaciones, el - modismo de umbral "cond and valor1 or valor2" y variables local. - - Solo puede referenciar el píxel actual en proceso - (getpixel(x, y)) y valores como obj/scene/time. + modismo de umbral "cond and valor1 or valor2", la asignación + condicional a variables local mediante if/elseif/else y + variables local. + - Los límites del bucle también pueden usar alias como + local w = obj.w. + - Solo puede referenciar el píxel actual en proceso y valores + como obj/scene/time. - Todo lo que use muestreo de vecinos (desenfoque, etc.), - escrituras en otras coordenadas, getpixeldata, getobject, - operaciones de tabla/cadena o sentencias if no se convierte en - núcleo y se ejecuta automáticamente en el motor clásico. + escrituras en otras coordenadas, llamadas a setpixel o set + dentro de una sentencia if, getobject u operaciones de + tabla/cadena no se convierte en núcleo y se ejecuta + automáticamente en el motor clásico. Ejemplo (vuelve roja una figura blanca): --!gpu diff --git a/LuaScript/docs/LuaScript.id-id.txt b/LuaScript/docs/LuaScript.id-id.txt index 7a78b62..3466ed2 100644 --- a/LuaScript/docs/LuaScript.id-id.txt +++ b/LuaScript/docs/LuaScript.id-id.txt @@ -62,14 +62,29 @@ obj.setpixel(x, y, r2, g2, b2 [, a2]) end end + Bentuk berikut yang memakai getpixeldata juga menjadi kernel. + local data = obj.getpixeldata() + for y = 0, data.height - 1 do + for x = 0, data.width - 1 do + local i = (y * data.width + x) * 4 + local r = data:get(i + 1) + data:set(i + 1, r2) + data:set(i + 2, g2) + data:set(i + 3, b2) + end + end + obj.putpixeldata(data) - Badan hanya boleh memakai aritmetika, math.*, perbandingan, - idiom ambang "cond and nilai1 or nilai2", dan variabel local. - - Hanya boleh mereferensikan piksel yang sedang diproses - (getpixel(x, y)) dan nilai seperti obj/scene/time. + idiom ambang "cond and nilai1 or nilai2", penugasan bersyarat + ke variabel local melalui if/elseif/else, dan variabel local. + - Batas perulangan juga boleh memakai alias seperti + local w = obj.w. + - Hanya boleh mereferensikan piksel yang sedang diproses dan + nilai seperti obj/scene/time. - Apa pun yang memakai sampling tetangga (blur, dll.), penulisan - ke koordinat lain, getpixeldata, getobject, operasi - tabel/string, atau pernyataan if tidak diubah menjadi kernel dan - otomatis berjalan di mesin klasik. + ke koordinat lain, pemanggilan setpixel atau set di dalam + pernyataan if, getobject, atau operasi tabel/string tidak + diubah menjadi kernel dan otomatis berjalan di mesin klasik. Contoh (membuat figur putih menjadi merah): --!gpu diff --git a/LuaScript/docs/LuaScript.ja-jp.txt b/LuaScript/docs/LuaScript.ja-jp.txt index edcfe5a..0e0a738 100644 --- a/LuaScript/docs/LuaScript.ja-jp.txt +++ b/LuaScript/docs/LuaScript.ja-jp.txt @@ -57,13 +57,28 @@ obj.setpixel(x, y, r2, g2, b2 [, a2]) end end + getpixeldata を使う次の形も同様にカーネル化されます。 + local data = obj.getpixeldata() + for y = 0, data.height - 1 do + for x = 0, data.width - 1 do + local i = (y * data.width + x) * 4 + local r = data:get(i + 1) + data:set(i + 1, r2) + data:set(i + 2, g2) + data:set(i + 3, b2) + end + end + obj.putpixeldata(data) ・本体で使えるのは四則演算・math.*・比較・しきい値の - 「条件 and 値1 or 値2」・local 変数のみです。 - ・参照できるのは処理中の自ピクセル(getpixel(x, y))と - obj/scene/time 等の値だけです。 - ・近傍参照(ぼかし等)、別座標への書き込み、getpixeldata、 - getobject、テーブル/文字列操作、if 文などを含む場合は - カーネル化されず、自動的に従来エンジンで実行されます。 + 「条件 and 値1 or 値2」・if/elseif/else による local 変数への + 条件代入・local 変数のみです。 + ・ループの上限には local w = obj.w のような別名も使えます。 + ・参照できるのは処理中の自ピクセルと obj/scene/time 等の + 値だけです。 + ・近傍参照(ぼかし等)、別座標への書き込み、if 文の中での + setpixel や set の呼び出し、getobject、テーブル/文字列操作 + などを含む場合はカーネル化されず、自動的に従来エンジンで + 実行されます。 例(白い図形が赤くなる): --!gpu diff --git a/LuaScript/docs/LuaScript.ko-kr.txt b/LuaScript/docs/LuaScript.ko-kr.txt index d87976b..8d65cff 100644 --- a/LuaScript/docs/LuaScript.ko-kr.txt +++ b/LuaScript/docs/LuaScript.ko-kr.txt @@ -57,13 +57,28 @@ obj.setpixel(x, y, r2, g2, b2 [, a2]) end end + getpixeldata를 사용하는 다음 형태도 마찬가지로 커널화됩니다. + local data = obj.getpixeldata() + for y = 0, data.height - 1 do + for x = 0, data.width - 1 do + local i = (y * data.width + x) * 4 + local r = data:get(i + 1) + data:set(i + 1, r2) + data:set(i + 2, g2) + data:set(i + 3, b2) + end + end + obj.putpixeldata(data) · 본문에서 사용할 수 있는 것은 사칙연산・math.*・비교・임계값 - 「조건 and 값1 or 값2」・local 변수뿐입니다. - · 참조할 수 있는 것은 처리 중인 자기 픽셀(getpixel(x, y))과 - obj/scene/time 등의 값뿐입니다. - · 이웃 참조(블러 등), 다른 좌표로의 쓰기, getpixeldata, - getobject, 테이블/문자열 조작, if 문 등을 포함하는 경우에는 - 커널화되지 않고 자동으로 기존 엔진에서 실행됩니다. + 「조건 and 값1 or 값2」・if/elseif/else에 의한 local 변수에 + 대한 조건 대입・local 변수뿐입니다. + · 루프의 상한에는 local w = obj.w 같은 별칭도 사용할 수 있습니다. + · 참조할 수 있는 것은 처리 중인 자기 픽셀과 obj/scene/time + 등의 값뿐입니다. + · 이웃 참조(블러 등), 다른 좌표로의 쓰기, if 문 안에서의 + setpixel이나 set 호출, getobject, 테이블/문자열 조작 등을 + 포함하는 경우에는 커널화되지 않고 자동으로 기존 엔진에서 + 실행됩니다. 예(흰색 도형이 빨갛게 됨): --!gpu diff --git a/LuaScript/docs/LuaScript.zh-cn.txt b/LuaScript/docs/LuaScript.zh-cn.txt index eec4b4e..4708c76 100644 --- a/LuaScript/docs/LuaScript.zh-cn.txt +++ b/LuaScript/docs/LuaScript.zh-cn.txt @@ -57,13 +57,26 @@ obj.setpixel(x, y, r2, g2, b2 [, a2]) end end + 使用 getpixeldata 的下列形式同样会被内核化。 + local data = obj.getpixeldata() + for y = 0, data.height - 1 do + for x = 0, data.width - 1 do + local i = (y * data.width + x) * 4 + local r = data:get(i + 1) + data:set(i + 1, r2) + data:set(i + 2, g2) + data:set(i + 3, b2) + end + end + obj.putpixeldata(data) · 主体中仅可使用四则运算、math.*、比较、阈值写法 - “条件 and 值1 or 值2”以及 local 变量。 - · 仅可引用正在处理的自像素(getpixel(x, y)) - 以及 obj/scene/time 等值。 - · 含有邻域参照(模糊等)、写入其他坐标、getpixeldata、 - getobject、表/字符串操作、if 语句等的脚本不会被内核化, - 会自动由传统引擎执行。 + “条件 and 值1 or 值2”、通过 if/elseif/else 对 local 变量的 + 条件赋值以及 local 变量。 + · 循环上限也可以使用 local w = obj.w 这样的别名。 + · 仅可引用正在处理的自像素以及 obj/scene/time 等值。 + · 含有邻域参照(模糊等)、写入其他坐标、在 if 语句中调用 + setpixel 或 set、getobject、表/字符串操作等的脚本不会被 + 内核化,会自动由传统引擎执行。 示例(让白色图形变红): --!gpu diff --git a/LuaScript/docs/LuaScript.zh-tw.txt b/LuaScript/docs/LuaScript.zh-tw.txt index 4a91d5b..638a654 100644 --- a/LuaScript/docs/LuaScript.zh-tw.txt +++ b/LuaScript/docs/LuaScript.zh-tw.txt @@ -57,13 +57,26 @@ obj.setpixel(x, y, r2, g2, b2 [, a2]) end end + 使用 getpixeldata 的下列形式同樣會被核心化。 + local data = obj.getpixeldata() + for y = 0, data.height - 1 do + for x = 0, data.width - 1 do + local i = (y * data.width + x) * 4 + local r = data:get(i + 1) + data:set(i + 1, r2) + data:set(i + 2, g2) + data:set(i + 3, b2) + end + end + obj.putpixeldata(data) · 主體中僅可使用四則運算、math.*、比較、閾值寫法 - 「條件 and 值1 or 值2」以及 local 變數。 - · 僅可參照正在處理的自像素(getpixel(x, y)) - 以及 obj/scene/time 等值。 - · 含有鄰域參照(模糊等)、寫入其他座標、getpixeldata、 - getobject、表/字串操作、if 陳述式等的腳本不會被核心化, - 會自動由傳統引擎執行。 + 「條件 and 值1 or 值2」、透過 if/elseif/else 對 local 變數的 + 條件賦值以及 local 變數。 + · 迴圈上限也可以使用 local w = obj.w 這樣的別名。 + · 僅可參照正在處理的自像素以及 obj/scene/time 等值。 + · 含有鄰域參照(模糊等)、寫入其他座標、在 if 陳述式中呼叫 + setpixel 或 set、getobject、表/字串操作等的腳本不會被 + 核心化,會自動由傳統引擎執行。 範例(讓白色圖形變紅): --!gpu