我對Swift非常陌生。我正在嘗試使用均值方法創建灰度濾鏡。 這是我使用的RGBAImage.swift文件: import UIKit
public struct Pixel {
public var value: UInt32
public var red: UInt8 {
get {
return UInt8(value & 0xFF)
我似乎在從Blender中的PNG圖像(使用python)中讀取像素RGBA值(特別是alpha值)時出現問題。 我做到以下幾點: for i in range(0, len(bpy.data.images["name_of_my_png"].pixels), 4):
print(bpy.data.images["name_of_my_png"].pixels[i:i+4]);
,