mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-28 12:36:30 +00:00
Add support of the 0RGB1555 pixel format
This commit is contained in:
parent
72e846894e
commit
43d3f84993
4 changed files with 6 additions and 3 deletions
|
|
@ -97,6 +97,8 @@ func (v *Video) SetPixFormat(f uint32) {
|
|||
}
|
||||
|
||||
switch f {
|
||||
case 0:
|
||||
v.pf = yuv.PixFmt(yuv.FourccRgb0)
|
||||
case 1:
|
||||
v.pf = yuv.PixFmt(yuv.FourccArgb)
|
||||
case 2:
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ enum FourCC {
|
|||
FOURCC_I420 = FOURCC('I', '4', '2', '0'),
|
||||
FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
|
||||
FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
|
||||
FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'),
|
||||
FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE.
|
||||
FOURCC_ANY = -1,
|
||||
};
|
||||
|
|
@ -102,6 +103,7 @@ import "fmt"
|
|||
const FourccRgbp uint32 = C.FOURCC_RGBP
|
||||
const FourccArgb uint32 = C.FOURCC_ARGB
|
||||
const FourccAbgr uint32 = C.FOURCC_ABGR
|
||||
const FourccRgb0 uint32 = C.FOURCC_RGBO
|
||||
|
||||
func Y420(src []byte, dst []byte, _, h, stride int, dw, dh int, rot uint, pix uint32, cx, cy int) {
|
||||
cw := (dw + 1) / 2
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ type PixFmt uint32
|
|||
const FourccRgbp = libyuv.FourccRgbp
|
||||
const FourccArgb = libyuv.FourccArgb
|
||||
const FourccAbgr = libyuv.FourccAbgr
|
||||
const FourccRgb0 = libyuv.FourccRgb0
|
||||
|
||||
func NewYuvConv(w, h int, scale float64) Conv {
|
||||
if scale < 1 {
|
||||
|
|
@ -47,7 +48,7 @@ func (c *Conv) Process(frame RawFrame, rot uint, pf PixFmt) []byte {
|
|||
}
|
||||
|
||||
stride := frame.Stride >> 2
|
||||
if pf == PixFmt(libyuv.FourccRgbp) {
|
||||
if pf == PixFmt(libyuv.FourccRgbp) || pf == PixFmt(libyuv.FourccRgb0) {
|
||||
stride = frame.Stride >> 1
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -378,8 +378,6 @@ func videoSetPixelFormat(format uint32) (C.bool, error) {
|
|||
if err := graphics.SetPixelFormat(graphics.UnsignedShort5551); err != nil {
|
||||
return false, fmt.Errorf("unknown pixel format %v", Nan0.Video.PixFmt)
|
||||
}
|
||||
// format is not implemented
|
||||
return false, fmt.Errorf("unsupported pixel type %v converter", format)
|
||||
case C.RETRO_PIXEL_FORMAT_XRGB8888:
|
||||
Nan0.Video.PixFmt = RGBA8888Rev
|
||||
if err := graphics.SetPixelFormat(graphics.UnsignedInt8888Rev); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue