#include "emulator_common.h"
#include "maru_display_processing.h"
-#include "hw/pci/maru_brightness.h"
#include "debug_ch.h"
MULTI_DEBUG_CHANNEL(tizen, dpy_op);
-
-/* Image processing functions using the pixman library */
-void composite_brightness_image(pixman_image_t *dst_image)
-{
- /* apply the brightness level */
- if (brightness_level < BRIGHTNESS_MAX) {
- pixman_image_composite(PIXMAN_OP_OVER,
- brightness_image, NULL, dst_image,
- 0, 0, 0, 0, 0, 0,
- pixman_image_get_width(dst_image),
- pixman_image_get_height(dst_image));
- }
-}
-
/* libpng library */
png_bytep read_png_file(const char *file_name,
unsigned int *width_out, unsigned int *height_out)
#define MARU_DISPLAY_PROCESSING_H_
#include <png.h>
-#include "ui/qemu-pixman.h"
-
-void composite_brightness_image(pixman_image_t *dst);
png_bytep read_png_file(const char *file_name,
unsigned int *width_out, unsigned int *height_out);
*
*/
-#include <png.h>
#include "ui/console.h"
#include "emul_state.h"
#include "maru_display.h"
#include "qt5_supplement.h"
-#include "maru_display_processing.h"
+#include "hw/pci/maru_brightness.h"
extern QemuMutex sdl_mutex;
extern QemuCond sdl_cond;
QEMUBH *display_bh;
+/* Image processing functions using the pixman library */
+void composite_brightness_image(pixman_image_t *dst_image)
+{
+ /* apply the brightness level */
+ if (brightness_level < BRIGHTNESS_MAX) {
+ pixman_image_composite(PIXMAN_OP_OVER,
+ brightness_image, NULL, dst_image,
+ 0, 0, 0, 0, 0, 0,
+ pixman_image_get_width(dst_image),
+ pixman_image_get_height(dst_image));
+ }
+}
+
+void composite_brightness_image_to_pixel(void *pixels,
+ uint32_t width,
+ uint32_t height)
+{
+ pixman_image_t *image = NULL;
+
+ /* apply the brightness level */
+ if (brightness_level < BRIGHTNESS_MAX) {
+ image = pixman_image_create_bits(PIXMAN_a8r8g8b8,
+ width, height,
+ pixels, width * 4);
+ pixman_image_composite(PIXMAN_OP_OVER,
+ brightness_image, NULL, image,
+ 0, 0, 0, 0, 0, 0, width, height);
+ pixman_image_unref(image);
+ }
+}
+
static uint64_t brightness_reg_read(void *opaque,
hwaddr addr,
unsigned size)
extern uint8_t brightness_tbl[];
extern pixman_image_t *brightness_image;
+void composite_brightness_image(pixman_image_t *dst_image);
+void composite_brightness_image_to_pixel(void *pixels,
+ uint32_t width,
+ uint32_t height);
+
#endif /* MARU_BRIGHTNESS_H_ */