if (query_str) LogNT::getInstance()->info(TAG, query_str);
else LogNT::getInstance()->warn(TAG, "Could not query display {:#x}", vgGetError());
- aspect_correction = ((float)BACKBUFFER_HEIGHT) / 576.f / (((float)BACKBUFFER_WIDTH) / 720.f);
+ aspect_correction = BACKBUFFER_HEIGHT / 576.f / (BACKBUFFER_WIDTH / 720.f);
initPaths();
if (!fontnames.size())
uint32_t image_ptr;
VC_RECT_T rect;
- res = vc_dispmanx_resource_create(VC_IMAGE_RGBA32, width, height, &image_ptr);
+ res = vc_dispmanx_resource_create(VC_IMAGE_RGBA32, tou4(width), tou4(height), &image_ptr);
display = vc_dispmanx_display_open(0);
if (!includeOSD)
static_cast<DISPMANX_TRANSFORM_T>(DISPMANX_SNAPSHOT_FILL));
}
- vc_dispmanx_rect_set(&rect, 0, 0, width, height);
+ vc_dispmanx_rect_set(&rect, 0, 0, tou4(width), tou4(height));
vc_dispmanx_resource_read_data(res, &rect, buffer, width * 4);
vc_dispmanx_resource_delete(res);
vc_dispmanx_display_close(display);
{
*names = const_cast<const char**>(&(fontnames[0]));
*names_keys = const_cast<const char**>(&(fontnames_keys[0]));
- return fontnames.size();
+ return toi4(fontnames.size());
}
void OsdOpenVG::setFont(const char* fontname)
if (!(last_tag & 0x1))
{
segments.push_back(VG_QUAD_TO);
- int coord_size = coord.size();
+ u4 coord_size = coord.size();
VGfloat x = (coord[coord_size - 2] + ((float)fpoint.x) / 256.f) * 0.5f * aspect_correction;
VGfloat y = (coord[coord_size - 1] + (font_size - ((float)fpoint.y) / 256.f)) * 0.5f;
coord.push_back(x);
cur_char = FT_Get_Next_Char(ft_face, cur_char, &glyph);
}
- for (int i = 0; i < 256; i++)
+ for (u4 i = 0; i < 256; i++)
{
- unsigned int glyph_index = FT_Get_Char_Index(ft_face, i);
+ u4 glyph_index = FT_Get_Char_Index(ft_face, i);
byte_char_width[i] = font_exp_x[glyph_index];
}
{
vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
vgLoadIdentity();
- vgScale(((float)BACKBUFFER_WIDTH) / 720.f, -((float)BACKBUFFER_HEIGHT) / 576.f);
+ vgScale(BACKBUFFER_WIDTH / 720.f, -BACKBUFFER_HEIGHT / 576.f);
vgTranslate(0.f + sc.x, -576.f + sc.y);
vgSeti(VG_MATRIX_MODE, VG_MATRIX_GLYPH_USER_TO_SURFACE);
vgLoadIdentity();
- vgScale(((float)BACKBUFFER_WIDTH) / 720.f, -((float)BACKBUFFER_HEIGHT) / 576.f);
+ vgScale(BACKBUFFER_WIDTH / 720.f, -BACKBUFFER_HEIGHT / 576.f);
vgTranslate(0.f + sc.x, -576.f + sc.y);
vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
vgLoadIdentity();
- vgScale(((float)BACKBUFFER_WIDTH) / 720.f, -((float)BACKBUFFER_HEIGHT) / 576.f);
+ vgScale(BACKBUFFER_WIDTH / 720.f, -BACKBUFFER_HEIGHT / 576.f);
vgTranslate(0.f + sc.x, -576.f + sc.y);
- clip_shift_x = sc.x;
- clip_shift_y = sc.y;
+ clip_shift_x = static_cast<i4>(sc.x);
+ clip_shift_y = static_cast<i4>(sc.y);
//vgTranslate(0.f+sc.x,576.f-sc.y);
//LogNT::getInstance()->debug(TAG, "Draw Translate {} {}",sc.x,sc.y);
case DrawBitmap:
{
VGImage vgimage;
- if (command.instr == DrawBitmap) vgimage = static_cast<VGImage>(command.target.bitmap);
- else if (command.instr == DrawImage)
+ if (command.instr == DrawBitmap)
+ {
+ vgimage = static_cast<VGImage>(command.target.bitmap);
+ }
+ else // command.instr == DrawImage
{
// FIXME use shared_ptr for OsdImageOpenVG objects?
// -or-
vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
vgGetMatrix(save_matrix);
- VGfloat imagewidth = vgGetParameteri(vgimage, VG_IMAGE_WIDTH);
- VGfloat imageheight = vgGetParameteri(vgimage, VG_IMAGE_HEIGHT);
+ VGfloat imagewidth = static_cast<float>(vgGetParameteri(vgimage, VG_IMAGE_WIDTH));
+ VGfloat imageheight = static_cast<float>(vgGetParameteri(vgimage, VG_IMAGE_HEIGHT));
//vgScale(command.w,command.h);
case DrawClipping:
{
VGint coords[4] = {0, 0, 0, 0};
- coords[0] = ((command.x + clip_shift_x) * ((float)BACKBUFFER_WIDTH) / 720.f);
- coords[1] = ((576.f - command.y - clip_shift_y - command.h) * ((float)BACKBUFFER_HEIGHT) / 576.f);
- coords[2] = ((command.w - 1.f) * ((float)BACKBUFFER_WIDTH) / 720.f);
- coords[3] = ((command.h - 1.f) * ((float)BACKBUFFER_HEIGHT) / 576.f);
+ coords[0] = toi4((command.x + static_cast<float>(clip_shift_x)) * BACKBUFFER_WIDTH / 720.f);
+ coords[1] = toi4((576.f - command.y - static_cast<float>(clip_shift_y) - command.h) * BACKBUFFER_HEIGHT / 576.f);
+ coords[2] = toi4((command.w - 1.f) * BACKBUFFER_WIDTH / 720.f);
+ coords[3] = toi4((command.h - 1.f) * BACKBUFFER_HEIGHT / 576.f);
vgSetiv(VG_SCISSOR_RECTS, 4, coords);
if (command.w == 0.f && command.h == 0.f)
}
case OVGcreateImagePalette: //imcount++;
{
- VGImage input = vgCreateImage(VG_A_8, command.param1, command.param2,
+ VGImage input = vgCreateImage(VG_A_8, toi4(command.param1), toi4(command.param2),
VG_IMAGE_QUALITY_NONANTIALIASED |
VG_IMAGE_QUALITY_FASTER | VG_IMAGE_QUALITY_BETTER);
//LogNT::getInstance()->debug(TAG, "Draw create palette {} {} {:#x} {}",command.param1,command.param2,vgGetError(),input);
- vgImageSubData(input, command.data, command.param1,
- VG_A_8, 0, 0, command.param1, command.param2); // upload palettized image data
- VGImage handle = vgCreateImage(VG_sRGBA_8888, command.param1, command.param2,
+ vgImageSubData(input, command.data, toi4(command.param1),
+ VG_A_8, 0, 0, toi4(command.param1), toi4(command.param2)); // upload palettized image data
+ VGImage handle = vgCreateImage(VG_sRGBA_8888, toi4(command.param1), toi4(command.param2),
VG_IMAGE_QUALITY_NONANTIALIASED |
VG_IMAGE_QUALITY_FASTER | VG_IMAGE_QUALITY_BETTER);
VGuint* palette = static_cast<VGuint*>(malloc(256 * sizeof(VGuint)));
}
case OVGcreateMonoBitmap: //imcount++;
{
- VGImage handle = vgCreateImage(VG_A_1, command.param1, command.param2,
+ VGImage handle = vgCreateImage(VG_A_1, toi4(command.param1), toi4(command.param2),
VG_IMAGE_QUALITY_FASTER);
//LogNT::getInstance()->debug(TAG, "Draw create mono {} {} {:#x} {}",command.param1,command.param2,vgGetError(),handle);
unsigned int buffer_len = (command.param1 * command.param2) >> 3;
r_buffer1++; r_buffer2++;
}
- vgImageSubData(handle, buffer, command.param1 >> 3, VG_A_1, 0, 0, command.param1, command.param2);
+ vgImageSubData(handle, buffer, command.param1 >> 3, VG_A_1, 0, 0, toi4(command.param1), toi4(command.param2));
free(buffer);
// LogNT::getInstance()->debug(TAG, "Draw create mono2 {} {} {:#x} {}",command.param1,command.param2,vgGetError(),handle);
return handle;
const PictureInfo* info = static_cast<const PictureInfo*>(command.data);
VGImage handle;
//LogNT::getInstance()->debug(TAG, "TVMedia OVGcreateImageMemory {}",imcount);
- handle = vgCreateImage(VG_sABGR_8888, info->width, info->height, VG_IMAGE_QUALITY_BETTER);
- vgImageSubData(handle, info->image, info->width * 4,
- VG_sABGR_8888, 0, 0, info->width, info->height);
+ handle = vgCreateImage(VG_sABGR_8888, toi4(info->width), toi4(info->height), VG_IMAGE_QUALITY_BETTER);
+ vgImageSubData(handle, info->image, toi4(info->width) * 4,
+ VG_sABGR_8888, 0, 0, toi4(info->width), toi4(info->height));
info->decoder->freeReference(info->reference);
// We have a pictures! send a message to ourself, to switch to gui thread
PictureInfo* info = const_cast<PictureInfo*>(static_cast<const PictureInfo*>(command.data));
VGImage handle;
- handle = vgCreateImage(VG_sABGR_8888, info->width, info->height, VG_IMAGE_QUALITY_BETTER);
+ handle = vgCreateImage(VG_sABGR_8888, toi4(info->width), toi4(info->height), VG_IMAGE_QUALITY_BETTER);
// LogNT::getInstance()->debug(TAG, "TVMedia OVGcreateEGLImage {} {} {:#x} {}",info->width,info->height, handle,imcount);
info->handle = handle;
if (sa_MAX > static_id)
{
*userdata = static_artwork_begin[static_id];
- *length = static_artwork_end[static_id] - static_artwork_begin[static_id];
+ *length = tou4(static_artwork_end[static_id] - static_artwork_begin[static_id]);
return true;
}
{
struct OpenVGCommand comm;
comm.task = OVGcreateMonoBitmap;
- comm.param1 = width;
- comm.param2 = height;
+ comm.param1 = tou4(width);
+ comm.param2 = tou4(height);
comm.data = base;
return putOpenVGCommand(comm, true);
}
{
struct OpenVGCommand comm;
comm.task = OVGcreateImagePalette;
- comm.param1 = width;
- comm.param2 = height;
+ comm.param1 = tou4(width);
+ comm.param2 = tou4(height);
comm.data = image_data;
comm.data2 = palette_data;
return putOpenVGCommand(comm, true);