Qt4 font size rendering is different between Windows and Linux - linux

I am developing a Qt4 application on Windows that can also run on a Linux target.
My problem is that when using setPixelSize for a text, the rendering is different between Linux and Windows (in this case smaller on Linux).
Reading the Qt documentation, using setPointSize allows to have a size independent of the platform:
void QFont::setPixelSize(int pixelSize)
Sets the font size to pixelSize pixels.
Using this function makes the font device dependent. Use
setPointSize() or setPointSizeF() to set the size of the font in a
device independent manner.
However, when using setPointSize, I still get a size difference of about 10-20%.
How can I solve this?
Linux platform:
Size: 7”, 152 mm (W) x 91 mm (H)
Resolution: 800 x 480 px (WVGA), 15:9
Physical DPI : 72
Logical DPI : 72
Windows platform:
Size: 15.6”
Resolution: 1920 x 1080 px
Physical DPI : 96
Logical DPI : 96

Related

The dialog size is different in computers

I have one desktop and one laptop (windows 10).
The size of the monitor installed on the desktop is 24 inches.
They are same resolution(1920 by 1080) and i set same zoom ratio in Windows 10.
I do not use Movewindow function or other things to fix the size, however, the dialog size in the laptop and the desktop is different.
It causes that the controls in my software are overlapping each other.
please let me know if i notify other settings!!
Thank you.
Sorry, my question is not specific, i add two pictures.
In laptop, the setting of Windows is overlapped with the setting of DICOM.
Of course, i can make the controls not overlapping when i directly use 'movewindow' on dialog, but i want to know why the two dialogs have different size.(same resolution(1920 x 1080), same zoom ratio on windows 10)
In Desktop, the print dialog has 791 x 632 size, in latop, the print dialog has 911 x 816 size.
I will check DPI-Awareness. Thank you for your comments!
I'm getting to know about this phenomenon.
In laptop, The resolution is 1920 X 1080, However, the ratio value which Windows 10 recommend is 125%.
I Change the ratio to 100% then, It worked at a higher resolution i think.
I use this code to get a resoltion.
MONITORINFO mi;
::ZeroMemory(&mi, sizeof MONITORINFO );
mi.cbSize = sizeof MONITORINFO;
if( ::GetMonitorInfo(hMonitor, &mi))
In laptop,
When i use 100% the size of text, apps, and other items in Scale and layout,
then The mi.rcMonitor's width = 2400
if i change the ratio value to 125%(which windows recommend), then The mi.rcMonitor's width = 1920
I don't know how to represent 2400 * 1350 in 1920 * 1080 monitor, so i will study this!

libfreenect2 example Protonect only showing raw feed?

I figure the Protonect example in libfreenect2 is supposed to show more than just this raw feed?
I am running Linux Mint 17.2 and pocl 0.11 for OpenCL on an i7 4790.
The system has llvm-3.6 installed.
This is the output of clinfo.
Number of platforms 1
Platform Name Portable Computing Language
Platform Vendor The pocl project
Platform Version OpenCL 1.2 pocl 0.11
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix POCL
Platform Name Portable Computing Language
Number of devices 1
Device Name pthread-Intel(R) Core(TM) i7-4790 CPU # 3.60GHz
Device Vendor pocl
Device Vendor ID 0x0
Device Version OpenCL 1.2 pocl
Driver Version 0.11
Device OpenCL C Version OpenCL C 1.2
Device Type CPU, Default
Device Profile FULL_PROFILE
Max compute units 8
Max clock frequency 4000MHz
Device Partition (core)
Max number of sub-devices 2
Supported partition types None
Max work item dimensions 3
Max work item sizes 18446744073709551615x18446744073709551615x18446744073709551615
Max work group size 4096
Preferred work group size multiple 8
Preferred / native vector sizes
char 16 / 16
short 8 / 8
int 4 / 4
long 2 / 2
half 8 / 8 (n/a)
float 4 / 4
double 2 / 2 (cl_khr_fp64)
Half-precision Floating-point support (n/a)
Single-precision Floating-point support (core)
Denormals No
Infinity and NANs Yes
Round to nearest Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Double-precision Floating-point support (cl_khr_fp64)
Denormals No
Infinity and NANs Yes
Round to nearest Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Address bits 64, Little-Endian
Global memory size 33643532288 (31.33GiB)
Error Correction support No
Max memory allocation 8410883072 (7.833GiB)
Unified memory for Host and Device Yes
Minimum alignment for any data type 128 bytes
Alignment of base address 128 bits (16 bytes)
Global Memory cache type None
Image support Yes
Max number of samplers per kernel 16
pocl warning: encountered incomplete implementation in clGetDeviceInfo.c:135
Max size for 1D images from buffer 0 pixels
pocl warning: encountered incomplete implementation in clGetDeviceInfo.c:137
Max 1D or 2D image array size 0 images
Max 2D image size 8192x8192 pixels
Max 3D image size 2048x2048x2048 pixels
Max number of read image args 128
Max number of write image args 128
Local memory type Global
Local memory size 8410883072 (7.833GiB)
Max constant buffer size 8410883072 (7.833GiB)
Max number of constant args 8
Max size of kernel argument 1024
Queue properties
Out-of-order execution No
Profiling Yes
Prefer user sync for interop Yes
Profiling timer resolution 0ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels Yes
pocl warning: encountered incomplete implementation in clGetDeviceInfo.c:257
printf() buffer size 0
Built-in kernels
Device Available Yes
Compiler Available Yes
Linker Available Yes
Device Extensions cl_khr_fp64 cl_khr_byte_addressable_store
NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Portable Computing Language
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [POCL]
clCreateContext(NULL, ...) [default] Success [POCL]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) Success (1)
Platform Name Portable Computing Language
Device Name pthread-Intel(R) Core(TM) i7-4790 CPU # 3.60GHz
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) Success (1)
Platform Name Portable Computing Language
Device Name pthread-Intel(R) Core(TM) i7-4790 CPU # 3.60GHz
ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.1.3
ICD loader Profile OpenCL 1.2
Any thoughts as to what could be wrong? This is my first time using OpenCL on a CPU instead of a GPU and also my first time trying anything with a Kinect so I am not very familiar. Thanks for the help!
Your OpenCL doesn't matter, because you're not using OpenCL. In the output you can see OpenGLDepthPacketProcessor, which is the default in protonect. I think there has been some trouble with that on Linux recently. Try starting protonect with the cl command line parameter:
./protonect cl
That should make sure the OpenCL implementation is used.
You can also try the cpu parameter instead, using neither OpenGL nor OpenCL. That will be way slower, but should at least work without worrying about the correct OpenGL/OpenCL drivers.

increase DPI of x11() canvas in R

Is it possible to increase the dpi of images displayed by the x11() device in R? By default, my plots are very grainy.

Multiple screens/resolutions/images

I need to create images for a slideshow. The problem is that the images will be displayed in different screens.
I want to know if I can use the same resolution for all of them (1920 x 1080) 72px/inch.
Screens:
1. 24ft x 14ft pitch 12mm - Aspect ration must be 16:9
2. 12ft x 9ft pitch 15mm - Aspect ration must be 16:9
3. 55" TV - Supports full HD (1080 or 720)
4. 42" TV - Supports full HD (1080 or 720)
5. 19" screen - Maximum resolution is 1440 x 900
I don't know much about resolutions and any help will be greatly appreciated.
Thank you.
1920x1080 will be large enough for any television. Full HD (1080p) means 1080 horizontal scanlines (meaning 1080 pixels tall).
The size in inches is irrelevant in this case.
The only reason I could see for going larger than 1920x1080 is if the screen depth is more than 72 DPI (e.g. the iPhone retina display, which is 326 ppi)

framebuffer size

Does the framebuffer contain depth buffer information, or just color buffer information in graphics applications? What about for gui's on windows, is their a frame buffer and does it hold both color buffer + depth info or just color info?
If you're talking about the kernel-level framebuffer in Linux, it sets both the resolution and the color depth. Here's a list of common framebuffer modes; notice that the modes are determined by both the resolution and the color depth. You can override the framebuffer by passing a command line parameter to the kernel in your bootloader (vga=...).
Unlike Linux, on Windows the graphics subsystem is a part of the OS. I don't think (and, please, someone correct me if I'm wrong) there is support for non-VGA output devices in the latest Windows, so the framebuffer is deprecated/unavailable there.
As for real-time 3D, the "standard" buffers are the color buffer, in RGBA format, 1 byte per component, and the depth buffer, 3 bytes per component. There is one sample per fragment ( i.e., if you have 8x antialiasing, you will have 8 colors and 8 depth samples per pixel )
Now, many applications use additional, custom buffers. They are usually called g-buffers. These can include : object ID, material ID, albedo, shininess, normals, tangent, binormal, AO factor, most influent lights impacting the fragment, etc. At 1080p and 4xMSAA and double- or triple-buffering, this can take huge amounts of memory, so all these information are usually packed as tightly as possible.

Resources