Autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et dolore feugait.
local WebService = {}
function WebService.Run()
local client = os.getenv("REMOTE_ADDR")
local GET = os.getenv("QUERY_STRING")
local POST = nil
local POSTLength = tonumber(os.getenv("CONTENT_LENGTH")) or 0
if (POSTLength > 0) then
POST = io.read(POSTLength)
--POST = io.read("*a")
end
-- Fast-CGI+HTTP require HEADER
-- enable cache
--io.write("Content-type: text/html\n\n")
-- disable cache, especially for Internet Explorer
io.write("Content-type: text/html\nPragma: no-cache\n\n")
local reply = string.format("Client %s said: url: [%s], data: [%s]\n", client or '-', GET or '-', POST or '-')
io.write(reply)
end
return WebService
function WebService.uartWrite(msg)
local uartConfig = 'stty -F /dev/ttyS0 raw speed 9600\n'
os.execute(uartConfig)
local cmd = string.format("echo '%s' > /dev/ttyS0\n", msg or '')
os.execute(cmd)
end
Y Y Y Y Y Y
Y Y Y Y Y Y
Y Y Y Y Y Y
Y Y Y Y Y Y
U U U U U U Y U Y V Y U Y V Y U Y V
U U U U U U Y U Y V Y U Y V Y U Y V
V V V V V V Y U Y V Y U Y V Y U Y V
V V V V V V Y U Y V Y U Y V Y U Y V
- Planar - - Packed -
YUV420:I420(YU12)、YV12、NV12、NV21
YUV420p: I420、YV12
YUV420sp: NV12、NV21
同样,对于一个6*4的图像,这四种像素格式的存储方式如下:
Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
U U U U U U V V V V V V U V U V U V V U V U V U
V V V V V V U U U U U U U V U V U V V U V U V U
- I420 - - YV12 - - NV12 - - NV21 -
I420、YV12 三个分量均为平面格式,即分别存在三个数组中;
NV12、NV21 的存储格式为 Y 平面,UV 打包,即 Y 信息存储在一个数组中,UV 信息存储在一个另一个数组中。