/*
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* Copyright (C) 2012-2013 Kay Sievers <kay@vrfy.org>
* Copyright (C) 2012 Harald Hoyer <harald@redhat.com>
*/
#include <efi.h>
#include <efilib.h>
#include "graphics.h"
#include "splash.h"
#include "util.h"
struct bmp_file {
} __attribute__((packed));
/* we require at least BITMAPINFOHEADER, later versions are
accepted, but their features ignored */
struct bmp_dib {
UINT32 x;
UINT32 y;
} __attribute__((packed));
struct bmp_map {
} __attribute__((packed));
return EFI_INVALID_PARAMETER;
/* check file header */
return EFI_INVALID_PARAMETER;
return EFI_INVALID_PARAMETER;
return EFI_INVALID_PARAMETER;
/* check device-independent bitmap */
return EFI_UNSUPPORTED;
case 1:
case 4:
case 8:
case 24:
if (dib->compression != 0)
return EFI_UNSUPPORTED;
break;
case 16:
case 32:
return EFI_UNSUPPORTED;
break;
default:
return EFI_UNSUPPORTED;
}
return EFI_INVALID_PARAMETER;
return EFI_INVALID_PARAMETER;
/* check color table */
return EFI_INVALID_PARAMETER;
if (dib->colors_used)
else {
case 1:
case 4:
case 8:
break;
default:
map_count = 0;
break;
}
}
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
/* convert src from RGBA to XRGB */
/* decompose into RB and G components */
/* blend */
}
UINTN y;
/* transform and copy pixels */
for (y = 0; y < dib->y; y++) {
UINTN x;
case 1: {
UINTN i;
for (i = 0; i < 8 && x < dib->x; i++) {
out++;
x++;
}
out--;
x--;
break;
}
case 4: {
UINTN i;
i = (*in) >> 4;
if (x < (dib->x - 1)) {
out++;
x++;
i = (*in) & 0x0f;
}
break;
}
case 8:
break;
case 16: {
in += 1;
break;
}
case 24:
in += 2;
break;
case 32: {
in += 3;
break;
}
}
}
/* add row padding; new lines always start at 32 bit boundary */
}
return EFI_SUCCESS;
}
EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background) {
if (!background) {
}
background = &pixel;
}
return err;
goto err;
EfiBltVideoFill, 0, 0, 0, 0,
/* EFI buffer */
if (!blt)
return EFI_OUT_OF_RESOURCES;
goto err;
goto err;
goto err;
err:
return err;
}