osd.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <string.h>
#include "mvp_osd.h"
#include "osd.h"
#include "font.h"

Go to the source code of this file.

Defines

#define PRINTF(x...)

Functions

int osd_draw_pixel (osd_surface_t *surface, int x, int y, unsigned int c)
 Draw a single pixel on a drawing surface.
int osd_draw_pixel_ayuv (osd_surface_t *surface, int x, int y, unsigned char a, unsigned char Y, unsigned char U, unsigned char V)
 Draw a single pixel on a drawing surface.
int osd_draw_pixel_list (osd_surface_t *surface, int *x, int *y, int n, unsigned int c)
int osd_draw_line (osd_surface_t *surface, int x1, int y1, int x2, int y2, unsigned int c)
 Draw a line on a drawing surface.
int osd_draw_polygon (osd_surface_t *surface, int *x, int *y, int n, unsigned long c)
int osd_draw_circle (osd_surface_t *surface, int xc, int yc, int radius, int filled, unsigned long c)
unsigned int osd_read_pixel (osd_surface_t *surface, int x, int y)
 Return the color of a specified pixel.
int osd_draw_horz_line (osd_surface_t *surface, int x1, int x2, int y, unsigned int c)
 Draw a horizontal line on a drawing surface.
int osd_draw_vert_line (osd_surface_t *surface, int x, int y1, int y2, unsigned int c)
 Draw a vertical line on a drawing surface.
int osd_fill_rect (osd_surface_t *surface, int x, int y, int w, int h, unsigned int c)
 Fill a rectangle on a drawing surface.
int osd_draw_rect (osd_surface_t *surface, int x, int y, int w, int h, unsigned int c, int fill)
static int blit_copy (osd_surface_t *dstsfc, int dstx, int dsty, osd_surface_t *srcsfc, int srcx, int srcy, int w, int h)
int osd_blit (osd_surface_t *dstsfc, int dstx, int dsty, osd_surface_t *srcsfc, int srcx, int srcy, int w, int h)
 Bit blast a rectangle from one drawing surface to another.
int osd_drawtext (osd_surface_t *surface, int x, int y, const char *str, unsigned int fg, unsigned int bg, int background, void *FONT)
 Draw a text string on a drawing surface.
osd_surface_tosd_create_surface (int w, int h, unsigned long color, osd_type_t type)
 Create a new drawing surface.
int osd_set_screen_size (int w, int h)
 Set the full size of the screen.
int osd_get_surface_size (osd_surface_t *surface, int *w, int *h)
 Return the size of the drawing surface.
int osd_display_surface (osd_surface_t *surface)
 Display a drawing surface.
int osd_draw_indexed_image (osd_surface_t *surface, osd_indexed_image_t *image, int x, int y)
int osd_destroy_surface (osd_surface_t *surface)
 Destroy a drawing surface.
void osd_destroy_all_surfaces (void)
 Destroy all existing drawing surfaces.
osd_surface_tosd_get_visible_surface (void)
int osd_palette_add_color (osd_surface_t *surface, unsigned int c)
int osd_blend (osd_surface_t *surface, int x, int y, int w, int h, osd_surface_t *surface2, int x2, int y2, int w2, int h2, unsigned long colour)
int osd_afillblt (osd_surface_t *surface, int x, int y, int w, int h, unsigned long colour)
int osd_clip (osd_surface_t *surface, int left, int top, int right, int bottom)
int osd_get_visual_device_control (osd_surface_t *surface)
int osd_cur_set_attr (osd_surface_t *surface, int x, int y)
int osd_move (osd_surface_t *surface, int x, int y)
int osd_get_engine_mode (osd_surface_t *surface)
int osd_set_engine_mode (osd_surface_t *surface, int mode)
int osd_reset_engine (osd_surface_t *surface)
int osd_set_display_control (osd_surface_t *surface, int type, int value)
int osd_get_display_control (osd_surface_t *surface, int type)
int osd_get_display_options (osd_surface_t *surface)
int osd_set_display_options (osd_surface_t *surface, unsigned char option)
int osd_memcpy (osd_surface_t *surface, int base, int destOffset, unsigned char *Data, int sourceOffset, int frameWidth)
 Fast copy directly from memory to surface.

Variables

osd_font_t font_CaslonRoman_1_25
osd_font_tosd_default_font = &font_CaslonRoman_1_25
int full_width = 720
int full_height = 480
osd_surface_tall [OSD_MAX_SURFACES]
osd_surface_tvisible = NULL


Define Documentation

#define PRINTF x...   ) 
 

Definition at line 36 of file osd.c.


Function Documentation

static int blit_copy osd_surface_t dstsfc,
int  dstx,
int  dsty,
osd_surface_t srcsfc,
int  srcx,
int  srcy,
int  w,
int  h
[static]
 

Definition at line 289 of file osd.c.

References osd_func_s::draw_pixel, osd_surface_s::fp, osd_surface_s::height, osd_func_s::palette_add_color, osd_func_s::read_pixel, osd_surface_s::width, x, and y.

Referenced by osd_blit().

int osd_afillblt osd_surface_t surface,
int  x,
int  y,
int  w,
int  h,
unsigned long  colour
 

Definition at line 548 of file osd.c.

References osd_func_s::afillblt, osd_surface_s::fp, and surface.

int osd_blend osd_surface_t surface,
int  x,
int  y,
int  w,
int  h,
osd_surface_t surface2,
int  x2,
int  y2,
int  w2,
int  h2,
unsigned long  colour
 

Definition at line 530 of file osd.c.

References osd_func_s::blend, osd_surface_s::fp, surface, surface2, and osd_surface_s::type.

int osd_blit osd_surface_t dstsfc,
int  dstx,
int  dsty,
osd_surface_t srcsfc,
int  srcx,
int  srcy,
int  w,
int  h
 

Bit blast a rectangle from one drawing surface to another.

Parameters:
dstsfc handle to the destination drawing surface
dstx destination horizontal coordinate
dsty destination vertical coordinate
srcsfc handle to the source drawing surface
srcx source horizontal coordinate
srcy source vertical coordinate
w width of rectangle
h height of rectangle
Return values:
0 success
-1 error

Definition at line 324 of file osd.c.

References osd_func_s::blit, blit_copy(), osd_surface_s::fp, and osd_surface_s::type.

Referenced by displayOSDFile(), HandleRDCMessage(), media_read_message(), PauseDisplayState(), RestoreSurface(), SetDisplayState(), SetSurface(), test_blit2(), and UpdateFinished().

int osd_clip osd_surface_t surface,
int  left,
int  top,
int  right,
int  bottom
 

Definition at line 561 of file osd.c.

References osd_func_s::clip, osd_surface_s::fp, and surface.

osd_surface_t* osd_create_surface int  w,
int  h,
unsigned long  color,
osd_type_t  type
 

Create a new drawing surface.

Parameters:
w surface width (-1 for full width)
h surface height (-1 for full height)
color background color
Returns:
handle to the new surface

Definition at line 405 of file osd.c.

References cursor_create(), fb_create, gfx_create(), OSD_CURSOR, OSD_FB, and OSD_GFX.

Referenced by fb_clear(), mvp_server_init(), splash_main(), test_blit(), test_blit2(), test_circles(), test_color(), test_create_surfaces(), test_cursor(), test_display_control(), test_fb(), test_lines(), test_polygons(), test_rectangles(), test_sanity(), and test_text().

int osd_cur_set_attr osd_surface_t surface,
int  x,
int  y
 

Definition at line 585 of file osd.c.

References osd_surface_s::fp, osd_func_s::set_attr, and surface.

void osd_destroy_all_surfaces void   ) 
 

Destroy all existing drawing surfaces.

Definition at line 499 of file osd.c.

References all, osd_destroy_surface(), and OSD_MAX_SURFACES.

Referenced by main().

int osd_destroy_surface osd_surface_t surface  ) 
 

Destroy a drawing surface.

Parameters:
surface handle to a drawing surface
Return values:
0 success
-1 error

Definition at line 474 of file osd.c.

References all, osd_func_s::destroy, osd_surface_s::fp, OSD_MAX_SURFACES, surface, and visible.

Referenced by mvp_server_cleanup(), mvp_server_init(), and osd_destroy_all_surfaces().

int osd_display_surface osd_surface_t surface  ) 
 

Display a drawing surface.

Parameters:
surface drawing surface to display
Return values:
0 success
-1 error

Definition at line 449 of file osd.c.

References osd_func_s::display, osd_surface_s::fp, and surface.

Referenced by mvp_server_init(), test_blit(), test_blit2(), test_circles(), test_create_surfaces(), test_display_control(), test_fb(), test_lines(), test_polygons(), and test_rectangles().

int osd_draw_circle osd_surface_t surface,
int  xc,
int  yc,
int  radius,
int  filled,
unsigned long  c
 

Definition at line 175 of file osd.c.

References osd_draw_pixel(), osd_fill_rect(), surface, x, and y.

Referenced by test_circles().

int osd_draw_horz_line osd_surface_t surface,
int  x1,
int  x2,
int  y,
unsigned int  c
 

Draw a horizontal line on a drawing surface.

Parameters:
surface handle to a drawing surface
x1 horizontal coordinate of start of line
x2 horizontal coordinate of end of line
y vertical coordinate
c color
Return values:
0 success
-1 error

Definition at line 231 of file osd.c.

References osd_func_s::draw_horz_line, osd_surface_s::fp, osd_draw_line(), and surface.

int osd_draw_indexed_image osd_surface_t surface,
osd_indexed_image_t image,
int  x,
int  y
 

Definition at line 461 of file osd.c.

References osd_func_s::draw_indexed_image, osd_surface_s::fp, and surface.

Referenced by test_blit2(), and test_fb().

int osd_draw_line osd_surface_t surface,
int  x1,
int  y1,
int  x2,
int  y2,
unsigned int  c
 

Draw a line on a drawing surface.

Parameters:
surface handle to a drawing surface
x1 horizontal coordinate of start of line
y1 vertical coordinate of start of line
x2 horizontal coordinate of end of line
y2 vertical coordinate of end of line
c color
Return values:
0 success
-1 error

Definition at line 104 of file osd.c.

References osd_draw_pixel(), and surface.

Referenced by osd_draw_horz_line(), osd_draw_rect(), osd_draw_vert_line(), test_blit(), and test_lines().

int osd_draw_pixel osd_surface_t surface,
int  x,
int  y,
unsigned int  c
 

Draw a single pixel on a drawing surface.

Parameters:
surface handle to a drawing surface
x horizontal coordinate
y vertical coordinate
c color
Return values:
0 success
-1 error

Definition at line 57 of file osd.c.

References osd_func_s::draw_pixel, osd_surface_s::fp, and surface.

Referenced by ClearSurface(), osd_draw_circle(), osd_draw_line(), osd_draw_pixel_ayuv(), osd_draw_pixel_list(), and RectangleUpdateARGB().

int osd_draw_pixel_ayuv osd_surface_t surface,
int  x,
int  y,
unsigned char  a,
unsigned char  Y,
unsigned char  U,
unsigned char  V
 

Draw a single pixel on a drawing surface.

Parameters:
surface handle to a drawing surface
x horizontal coordinate
y vertical coordinate
a alpha channel
Y y channel
U u channel
V v channel
Return values:
0 success
-1 error

Definition at line 69 of file osd.c.

References osd_func_s::draw_pixel_ayuv, osd_surface_s::fp, osd_draw_pixel(), rgba2c(), surface, and yuv2rgb().

Referenced by gfx_draw_pixel(), RectangleUpdateAYVU(), RectangleUpdateHauppaugeAYVU(), and RectangleUpdateYUV().

int osd_draw_pixel_list osd_surface_t surface,
int *  x,
int *  y,
int  n,
unsigned int  c
 

Definition at line 87 of file osd.c.

References osd_draw_pixel(), and surface.

int osd_draw_polygon osd_surface_t surface,
int *  x,
int *  y,
int  n,
unsigned long  c
 

Definition at line 144 of file osd.c.

References surface.

int osd_draw_rect osd_surface_t surface,
int  x,
int  y,
int  w,
int  h,
unsigned int  c,
int  fill
 

Definition at line 270 of file osd.c.

References osd_draw_line(), osd_fill_rect(), and surface.

int osd_draw_vert_line osd_surface_t surface,
int  x,
int  y1,
int  y2,
unsigned int  c
 

Draw a vertical line on a drawing surface.

Parameters:
surface handle to a drawing surface
x horizontal coordinate
y1 vertical coordinate of start of line
y2 vertical coordinate of end of line
c color
Return values:
0 success
-1 error

Definition at line 244 of file osd.c.

References osd_func_s::draw_vert_line, osd_surface_s::fp, osd_draw_line(), and surface.

int osd_drawtext osd_surface_t surface,
int  x,
int  y,
const char *  str,
unsigned int  fg,
unsigned int  bg,
int  background,
void *  FONT
 

Draw a text string on a drawing surface.

Parameters:
surface handle to a drawing surface
x horizontal coordinate
y vertical coordinate
str text string to draw
fg foreground text color
bg background text color
background 0 if background should not be drawn, 1 if it should
FONT font to use
Return values:
0 success
-1 error

Definition at line 346 of file osd.c.

References bogl_font::height, osd_default_font, surface, and bogl_font::width.

Referenced by arping_ip(), connect_to_servers(), main(), media_read_message(), mvp_server_init(), query_host_parameters(), test_color(), test_create_surfaces(), test_sanity(), and test_text().

int osd_fill_rect osd_surface_t surface,
int  x,
int  y,
int  w,
int  h,
unsigned int  c
 

Fill a rectangle on a drawing surface.

Parameters:
surface handle to a drawing surface
x horizontal coordinate
y vertical coordinate
w width of rectangle
h height of rectangle
c color
Return values:
0 success
-1 error

Definition at line 257 of file osd.c.

References osd_func_s::fill_rect, osd_surface_s::fp, and surface.

Referenced by blank(), cursor_create(), draw_progress(), media_read_message(), mvp_timer_callback(), osd_draw_circle(), osd_draw_rect(), SetDisplayState(), test_color(), test_cursor(), test_rectangles(), and UpdateFinished().

int osd_get_display_control osd_surface_t surface,
int  type
 

Definition at line 657 of file osd.c.

References osd_surface_s::fp, osd_func_s::get_display_control, and surface.

Referenced by test_display_control().

int osd_get_display_options osd_surface_t surface  ) 
 

Definition at line 669 of file osd.c.

References osd_surface_s::fp, osd_func_s::get_display_options, and surface.

Referenced by test_display_control().

int osd_get_engine_mode osd_surface_t surface  ) 
 

Definition at line 609 of file osd.c.

References osd_surface_s::fp, osd_func_s::get_engine_mode, and surface.

int osd_get_surface_size osd_surface_t surface,
int *  w,
int *  h
 

Return the size of the drawing surface.

Parameters:
surface handle to a drawing surface
[out] w surface width
[out] h surface height
Return values:
0 success
-1 error

Definition at line 435 of file osd.c.

References osd_surface_s::height, surface, and osd_surface_s::width.

osd_surface_t* osd_get_visible_surface void   ) 
 

Definition at line 512 of file osd.c.

References visible.

Referenced by main().

int osd_get_visual_device_control osd_surface_t surface  ) 
 

Definition at line 573 of file osd.c.

References osd_surface_s::fp, osd_func_s::get_dev_control, and surface.

int osd_memcpy osd_surface_t surface,
int  base,
int  destOffset,
unsigned char *  Data,
int  sourceOffset,
int  frameWidth
 

Fast copy directly from memory to surface.

Definition at line 693 of file osd.c.

References osd_surface_s::fp, osd_func_s::memcpy, and surface.

Referenced by RectangleUpdateYUV2().

int osd_move osd_surface_t surface,
int  x,
int  y
 

Definition at line 597 of file osd.c.

References osd_surface_s::fp, osd_func_s::move, and surface.

int osd_palette_add_color osd_surface_t surface,
unsigned int  c
 

Definition at line 518 of file osd.c.

References osd_surface_s::fp, osd_func_s::palette_add_color, and surface.

Referenced by draw_progress(), test_cursor(), and test_fb().

unsigned int osd_read_pixel osd_surface_t surface,
int  x,
int  y
 

Return the color of a specified pixel.

Parameters:
surface handle to a drawing surface
x horizontal coordinate
y vertical coordinate
Returns:
pixel color

Definition at line 219 of file osd.c.

References osd_surface_s::fp, osd_func_s::read_pixel, and surface.

int osd_reset_engine osd_surface_t surface  ) 
 

Definition at line 633 of file osd.c.

References osd_surface_s::fp, osd_func_s::reset_engine, and surface.

int osd_set_display_control osd_surface_t surface,
int  type,
int  value
 

Definition at line 645 of file osd.c.

References osd_surface_s::fp, osd_func_s::set_display_control, and surface.

int osd_set_display_options osd_surface_t surface,
unsigned char  option
 

Definition at line 681 of file osd.c.

References osd_surface_s::fp, osd_func_s::set_display_options, and surface.

Referenced by mvp_server_init().

int osd_set_engine_mode osd_surface_t surface,
int  mode
 

Definition at line 621 of file osd.c.

References osd_surface_s::fp, osd_func_s::set_engine_mode, and surface.

Referenced by test_display_control().

int osd_set_screen_size int  w,
int  h
 

Set the full size of the screen.

Parameters:
w screen width
h screen height
Return values:
0 success
-1 error

Definition at line 423 of file osd.c.

References full_height, and full_width.


Variable Documentation

osd_surface_t* all[OSD_MAX_SURFACES]
 

Definition at line 52 of file osd.c.

osd_font_t font_CaslonRoman_1_25
 

int full_height = 480
 

Definition at line 50 of file osd.c.

int full_width = 720
 

Definition at line 50 of file osd.c.

osd_font_t* osd_default_font = &font_CaslonRoman_1_25
 

Definition at line 47 of file osd.c.

Referenced by osd_drawtext().

osd_surface_t* visible = NULL
 

Definition at line 54 of file osd.c.


Generated on Wed Sep 8 03:13:22 2010 for mvpmc by  doxygen 1.4.6