Notify OpenGL HGCM host service about graphics content scaling factor change.

        in screen_id of type int

        in u32_scale_factor_w_multiplied of type int

        in u32_scale_factor_h_multiplied of type int
971548
def notify_scale_factor_change(self, screen_id, u32_scale_factor_w_multiplied, u32_scale_factor_h_multiplied):
        
        if not isinstance(screen_id, baseinteger):
            raise TypeError("screen_id can only be an instance of type baseinteger")
        if not isinstance(u32_scale_factor_w_multiplied, baseinteger):
            raise TypeError("u32_scale_factor_w_multiplied can only be an instance of type baseinteger")
        if not isinstance(u32_scale_factor_h_multiplied, baseinteger):
            raise TypeError("u32_scale_factor_h_multiplied can only be an instance of type baseinteger")
        self._call("notifyScaleFactorChange",
                     in_p=[screen_id, u32_scale_factor_w_multiplied, u32_scale_factor_h_multiplied])
1328072
def warn_png_scale(file, scale_width, scale_height)
      if @deck.conf.warn_png_scale? && (scale_width > 1.0 || scale_height > 1.0)
        Squib.logger.warn "PNG is being upscaled - antialiasing could result: #{file}"
      end
    end
111525
def detect_mode(term_hint="xterm-256color"):
    """"""
    if "ANSICON" in os.environ:
        return 16
    elif os.environ.get("ConEmuANSI", "OFF") == "ON":
        return 256
    else:
        term = os.environ.get("TERM", term_hint)
        if term.endswith("-256color") or term in ("xterm", "screen"):
            return 256
        elif term.endswith("-color") or term in ("rxvt",):
            return 16
        else:
            return 256
1151405
function() {
			if (!gui.hosted) {
				gui.orientation = window.innerWidth > window.innerHeight ? 1 : 0;
				gui.broadcastGlobal(gui.BROADCAST_ORIENTATIONCHANGE, gui.orientation);
			}
		}
678543
public void notifyTransformed(Origin origin,
                                  FeatureProvider provider,
                                  Shape transformable,
                                  List<Collision> collisions,
                                  Map<Collision, Rectangle> cacheRectRender)
    {
        if (enabled)
        {
            final int length = collisions.size();
            for (int i = 0; i < length; i++)
            {
                final Collision collision = collisions.get(i);

                final Mirror mirror = getMirror(provider, collision);
                final int offsetX = getOffsetX(collision, mirror);
                final int offsetY = getOffsetY(collision, mirror);
                final int width;
                final int height;
                if (Collision.AUTOMATIC == collision)
                {
                    width = transformable.getWidth();
                    height = transformable.getHeight();
                }
                else
                {
                    width = collision.getWidth();
                    height = collision.getHeight();
                }
                if (width > maxWidth)
                {
                    maxWidth = width;
                }
                if (height > maxHeight)
                {
                    maxHeight = height;
                }
                final double x = origin.getX(transformable.getX() + offsetX, width);
                final double y = origin.getY(transformable.getY() + offsetY, height) + height;
                update(collision, x, y, width, height, cacheRectRender);
            }
        }
    }
1276457
public static int getScreenID(Component component)
	{
		int screenID;
		final AtomicInteger counter = new AtomicInteger(-1);
		Stream.of(getScreenDevices()).forEach(graphicsDevice -> {

			GraphicsConfiguration gc = graphicsDevice.getDefaultConfiguration();
			Rectangle rectangle = gc.getBounds();
			if (rectangle.contains(component.getLocation()))
			{
				try
				{
					Object object = ReflectionExtensions.getFieldValue(graphicsDevice, "screen");
					Integer sid = (Integer)object;
					counter.set(sid);
				}
				catch (NoSuchFieldException | SecurityException | IllegalArgumentException
					| IllegalAccessException e)
				{
					e.printStackTrace();
				}
			}
		});
		screenID = counter.get();
		return screenID;
	}
1194281
def _host_notification(self, context, method, payload, host):
        """"""
        LOG.debug('Notify Cisco cfg agent at %(host)s the message '
                  '%(method)s', {'host': host, 'method': method})
        cctxt = self.client.prepare(server=host)
        cctxt.cast(context, method, payload=payload)
666147
function getHostElementInvertedScale() {
                    var rect = _paddingElementNative.getBoundingClientRect();
                    return {
                        x :  _supportTransform ? 1 / (MATH.round(rect.width) / _paddingElementNative[LEXICON.oW]) : 1,
                        y :  _supportTransform ? 1 / (MATH.round(rect.height) / _paddingElementNative[LEXICON.oH]) : 1
                    };
                }
1013413
def update_gp(self):
        '''
        

        '''

        self.kernel_params = GetKernelParams(self.time, self.flux,
                                             self.fraw_err,
                                             mask=self.mask,
                                             guess=self.kernel_params,
                                             kernel=self.kernel,
                                             giter=self.giter,
                                             gmaxf=self.gmaxf)
823106
function setImageLuminanceColorScale( $imageObject, $filterData, $sourceMimeData, $destinationMimeData,
                                          $colorScale )
    {
        $white = ImageColorAllocate( $imageObject, 255, 255, 255 );
        $black = ImageColorAllocate( $imageObject, 0, 0, 0 );

        $rmod = $colorScale[0];
        $gmod = $colorScale[1];
        $bmod = $colorScale[2];

        $width = ImageSX( $imageObject );
        $height = ImageSY( $imageObject );
        for ( $y = 0; $y < $height; ++$y )
        {
            for ( $x = 0; $x < $width; ++$x )
            {
                $rgb = ImageColorAt( $imageObject, $x, $y );

                $r = ( $rgb >> 16 ) & 0xff;
                $g = ( $rgb >> 8 ) & 0x0ff;
                $b = ( $rgb ) & 0x0ff;

                $luminance = ( $r * 0.3 ) + ( $g * 0.59 ) + ( $b * 0.11 );

                $r = $luminance * $rmod;
                $g = $luminance * $gmod;
                $b = $luminance * $bmod;

                $color = ImageColorAllocate( $imageObject, $r, $g, $b );

                ImageSetPixel( $imageObject, $x, $y, $color );
            }
        }
        return $imageObject;
    }
692465
public void onHostActivityPaused() {
        Log.i(TAG, "onHostActivityPaused");
        synchronized (mReadyForFrameFence) {
            // Pause the GLSurfaceView's Renderer thread
            if (mDisplayView != null)
                mDisplayView.onPause();
            // Release camera if we're not recording
            if (!mRecording && mSurfaceTexture != null) {
                if (VERBOSE) Log.i("CameraRelease", "Releasing camera");
                if (mDisplayView != null)
                    releaseDisplayView();
                mHandler.sendMessage(mHandler.obtainMessage(MSG_RELEASE_CAMERA));
            }
        }
    }
1119110
def display_output(screen):
    
    format_row() # Sets up the screen width.
    screen_height = len(gunicorns) + len(instructions.split("\n")) + 9
    if not gunicorns:
        screen_height += 2 # A couple of blank lines are added when empty.
    screen.erase()
    win = curses.newwin(screen_height, screen_width + 6, 1, 3)
    win.bkgd(" ", curses.color_pair(1))
    win.border()
    x = 3
    blank_line = y = count(2).next
    win.addstr(y(), x, title.center(screen_width), curses.A_NORMAL)
    blank_line()
    win.addstr(y(), x, format_row(" PID", "PORT", "NAME", "MEM (MB)", "WORKERS"),
        curses.A_STANDOUT)
    if not gunicorns:
        blank_line()
        win.addstr(y(), x, no_gunicorns.center(screen_width),
            curses.A_NORMAL)
        blank_line()
    else:
        win.hline(y(), x, curses.ACS_HLINE, screen_width)
        for (i, pid) in enumerate(sorted(gunicorns.keys())):
            port = gunicorns[pid]["port"]
            name = gunicorns[pid]["name"]
            mem = "%#.3f" % (gunicorns[pid]["mem"] / 1000.)
            workers = gunicorns[pid]["workers"]
            # When a signal is sent to update the number of workers, the number
            # of workers is set to zero as a marker to signify an update has
            # occurred. We then piggyback this variable and use it as a counter
            # to animate the display until the gunicorn is next updated.
            if workers < 1:
                gunicorns[pid]["workers"] -= 1
                chars = "|/-\\"
                workers *= -1
                if workers == len(chars):
                   gunicorns[pid]["workers"] = workers = 0
                workers = chars[workers]
            if pid == selected_pid:
                attr = curses.A_STANDOUT
                prefix_char = '> '
            else:
                attr = curses.A_NORMAL
                prefix_char = '  '
            win.addstr(y(), x, format_row(pid, port, name, mem, workers,
                                          prefix_char), attr)
    win.hline(y(), x, curses.ACS_HLINE, screen_width)
    blank_line()
    for line in instructions.split("\n"):
        win.addstr(y(), x, line.center(screen_width), curses.A_NORMAL)
    win.refresh()
508605
def publish_scene_color(self, scene_id, color):
        """"""
        self.sequence_number += 1
        self.publisher.send_multipart(msgs.MessageBuilder.scene_color(self.sequence_number, scene_id, color))
        return self.sequence_number
929099
def push(self):
        
        if self.comm is None:
            raise Exception('Renderer does not have a comm.')
        diff = self.renderer.diff(self)
        self.comm.send(diff)
52926
def display_callback(self, cpu_cycles, op_address, address, value):
        
        self.display.write_byte(cpu_cycles, op_address, address, value)
        return value
1281230
def get_dpi(raise_error=True):
    
    display = quartz.CGMainDisplayID()
    mm = quartz.CGDisplayScreenSize(display)
    px = quartz.CGDisplayBounds(display).size
    return (px.width/mm.width + px.height/mm.height) * 0.5 * 25.4
256486
def _register_hid_notification(self):
        """"""
        # create structure, self initialized
        notify_obj = DevBroadcastDevInterface()
        h_notify = RegisterDeviceNotification(self.__hid_hwnd,
                ctypes.byref(notify_obj), DEVICE_NOTIFY_WINDOW_HANDLE)
        #
        return int(h_notify)