Re: Points vs pixels in a bash script

2020-06-10 Thread Gabriel Zachmann via Cocoa-dev
> > python -c 'import AppKit ; print > AppKit.NSScreen.screens()[0].frame().size.width' > Thanks a million! that even works for multi-monitor setups correctly. >> tells me the resolution of the screen in the same units (of course) as > > This will not work if you have multiple monitors

Re: Points vs pixels in a bash script

2020-06-10 Thread Saagar Jha via Cocoa-dev
Saagar Jha > On Jun 10, 2020, at 13:52, Ken Thomases via Cocoa-dev > wrote: > > On Jun 9, 2020, at 8:11 AM, Gabriel Zachmann wrote: >> >>> In particular, you're not taking into account the current screen resolution >>> (a.k.a. display mode). The user can select different scaling for a

Re: Points vs pixels in a bash script

2020-06-10 Thread Ken Thomases via Cocoa-dev
On Jun 9, 2020, at 8:11 AM, Gabriel Zachmann wrote: > >> In particular, you're not taking into account the current screen resolution >> (a.k.a. display mode). The user can select different scaling for a Retina >> display in System Preferences > Displays. > > Good point. > I wasn't taking

Re: Points vs pixels in a bash script

2020-06-10 Thread Clark Cox via Cocoa-dev
> On Jun 10, 2020, at 12:06 PM, Gabriel Zachmann via Cocoa-dev > wrote: > > For the record: I believe I have found a solution: > > tell application "Finder" to get bounds of window of desktop > > tells me the resolution of the screen in the same units (of course) as This will not work if

Re: Points vs pixels in a bash script

2020-06-10 Thread Gabriel Zachmann via Cocoa-dev
For the record: I believe I have found a solution: tell application "Finder" to get bounds of window of desktop tells me the resolution of the screen in the same units (of course) as tell application "System Events" to get the title of every window of every process lateron. Thanks again

How to sample MTLPixelFormatR32Float in Metal buffers and/or textures?

2020-06-10 Thread Demitri Muna via Cocoa-dev
Hi, I have float array data that I want to use to create images in Metal. My plan is to apply one or more shaders to the data, then render it into a new RGB texture and continue from there. I’m using MTLPixelFormatR32Float as the source pixel format with success. In all the kernel examples I