Flips the image from top to bottom
771417
public static void flipVertical( GrayS32 input ) {
		int h2 = input.height/2;

		for( int y = 0; y < h2; y++ ) {
			int index1 = input.getStartIndex() + y * input.getStride();
			int index2 = input.getStartIndex() + (input.height - y - 1) * input.getStride();

			int end = index1 + input.width;

			while( index1 < end ) {
				int tmp = input.data[index1];
				input.data[index1++] = input.data[index2];
				input.data[index2++] = (int)tmp;
			}
		}
	}
211519
public static void flip(Image image, ImageOutputStream out) throws IORuntimeException {
		writeJpg(flip(image), out);
	}
1349146
public function flip($horizontal = true) {
		if (function_exists('imageflip')) {
			imageflip($this->_image, $horizontal ? IMG_FLIP_HORIZONTAL : IMG_FLIP_VERTICAL);
		} else {
			$image = imagecreatetruecolor($this->width, $this->height);
			imagealphablending($image, false);
			imagesavealpha($image, true);
			if ($horizontal) {
				$dst_y = 0;
				$src_y = 0;
				$coordinate = ($this->width - 1);
				foreach (range($this->width, 0) as $range) {
					$src_x = $range;
					$dst_x = $coordinate - $range;
					imagecopy($image, $this->_image, $dst_x, $dst_y, $src_x, $src_y, 1, $this->height);
				}
			} else {
				$dst_x = 0;
				$src_x = 0;
				$coordinate = ($this->height - 1);
				foreach (range($this->height, 0) as $range) {
					$src_y = $range;
					$dst_y = $coordinate - $range;
					imagecopy($image, $this->_image, $dst_x, $dst_y, $src_x, $src_y, $this->width, 1);
				}
			}
			imagedestroy($this->_image);
			$this->_image = $image;
		}
		return $this;
	}
401736
def flip(self):
        '''

        '''
        copy = self.copy()
        copy.top, copy.bottom = copy.bottom, copy.top
        copy.features = [_flip_feature(f, len(self)) for f in copy.features]
        return copy
1274809
public static BufferedImage flipHorizontal(BufferedImage image)
    {
        final int width = image.getWidth();
        final int height = image.getHeight();
        final BufferedImage flipped = createImage(width, height, image.getColorModel().getTransparency());
        final Graphics2D g = flipped.createGraphics();

        optimizeGraphicsSpeed(g);
        g.drawImage(image, 0, 0, width, height, width, 0, 0, height, null);
        g.dispose();

        return flipped;
    }
469609
def post_process(self):
        
        self.image.putdata(self.pixels)
        self.image = self.image.transpose(Image.ROTATE_90)
88539
def flip(self, axis=0, preserve_centroid=False):
        '''
        

        '''
        self.v[:, axis] *= -1

        if preserve_centroid:
            self.v[:, axis] -= 2 * self.centroid[0]

        self.flip_faces()
1067025
def redraw(self, col=0):
        
        conf = self.conf
        # note: rotation re-calls display(), to reset the image
        # other transformations will just do .set_data() on image
        if conf.rot:
            if self.xdata is not None:
                self.xdata = self.xdata[::-1]
            if self.ydata is not None:
                self.ydata = self.ydata[:]

            self.display(np.rot90(conf.data),
                         x=self.ydata, xlabel=self.ylab,
                         y=self.xdata, ylabel=self.xlab)
        # flips, log scales
        img = conf.data
        if img is None: return
        if len(img.shape) == 2:
            col = 0
        if self.conf.style == 'image':
            if conf.flip_ud:   img = np.flipud(img)
            if conf.flip_lr:   img = np.fliplr(img)
            if conf.log_scale:
                img = np.log10(1 + 9.0*img)

        # apply intensity scale for current limited (zoomed) image
        if len(img.shape) == 2:
            # apply clipped color scale, as from sliders

            imin = float(conf.int_lo[col])
            imax = float(conf.int_hi[col])
            if conf.log_scale:
                imin = np.log10(1 + 9.0*imin)
                imax = np.log10(1 + 9.0*imax)

            (xmin, xmax, ymin, ymax) = self.conf.datalimits
            if xmin is None:  xmin = 0
            if xmax is None:  xmax = img.shape[1]
            if ymin is None:  ymin = 0
            if ymax is None:  ymax = img.shape[0]


            img = (img - imin)/(imax - imin + 1.e-8)
            mlo = conf.cmap_lo[0]/(1.0*conf.cmap_range)
            mhi = conf.cmap_hi[0]/(1.0*conf.cmap_range)
            if self.conf.style == 'image':
                conf.image.set_data(np.clip((img - mlo)/(mhi - mlo + 1.e-8), 0, 1))
                conf.image.set_interpolation(conf.interp)
        else:
            r, g, b = img[:,:,0], img[:,:,1], img[:,:,2]

            rmin = float(conf.int_lo[0])
            rmax = float(conf.int_hi[0])
            gmin = float(conf.int_lo[1])
            gmax = float(conf.int_hi[1])
            bmin = float(conf.int_lo[2])
            bmax = float(conf.int_hi[2])
            if conf.log_scale:
                rmin = np.log10(1 + 9.0*rmin)
                rmax = np.log10(1 + 9.0*rmax)
                gmin = np.log10(1 + 9.0*gmin)
                gmax = np.log10(1 + 9.0*gmax)
                bmin = np.log10(1 + 9.0*bmin)
                bmax = np.log10(1 + 9.0*bmax)

            rlo = conf.cmap_lo[0]/(1.0*conf.cmap_range)
            rhi = conf.cmap_hi[0]/(1.0*conf.cmap_range)
            glo = conf.cmap_lo[1]/(1.0*conf.cmap_range)
            ghi = conf.cmap_hi[1]/(1.0*conf.cmap_range)
            blo = conf.cmap_lo[2]/(1.0*conf.cmap_range)
            bhi = conf.cmap_hi[2]/(1.0*conf.cmap_range)
            r = (r - rmin)/(rmax - rmin + 1.e-8)
            g = (g - gmin)/(gmax - gmin + 1.e-8)
            b = (b - bmin)/(bmax - bmin + 1.e-8)

            inew = img*1.0
            inew[:,:,0] = np.clip((r - rlo)/(rhi - rlo + 1.e-8), 0, 1)
            inew[:,:,1] = np.clip((g - glo)/(ghi - glo + 1.e-8), 0, 1)
            inew[:,:,2] = np.clip((b - blo)/(bhi - blo + 1.e-8), 0, 1)

            whitebg = conf.tricolor_bg.startswith('wh')

            if whitebg:
                inew = conf.tricolor_white_bg(inew)

            if self.conf.style == 'image':
                conf.image.set_data(inew)
                conf.image.set_interpolation(conf.interp)
        self.canvas.draw()
        if callable(self.redraw_callback):
            self.redraw_callback(wid=self.GetId())
314733
function rotateTo(degree) {
    var imageData = this.imageData;


    degree = Number(degree);

    if (isNumber(degree) && this.viewed && !this.played && this.options.rotatable) {
      imageData.rotate = degree;
      this.renderImage();
    }

    return this;
  }
503789
def _bottom_position(self, resource):
        
        image = self._get_scaled_image(resource)

        left = int(round(resource.size[0] // 2 - image.size[0] // 2))
        upper = int(round(resource.size[1] - image.size[1]))

        return image, left, upper
1279113
function move(offsetX, offsetY) {
    var imageData = this.imageData;


    this.moveTo(isUndefined(offsetX) ? offsetX : imageData.left + Number(offsetX), isUndefined(offsetY) ? offsetY : imageData.top + Number(offsetY));

    return this;
  }
27614
def flipped(self):
        """"""
        forward, reverse = self.value
        return self.__class__((reverse, forward))
487293
function flipPixels(buffer, width, height) {
  const newBuffer = Buffer.alloc(buffer.length)
  for (let x = 0; x < width; x += 1) {
    for (let y = 0; y < height; y += 1) {
      const offset = (width * y + x) << 2
      const newOffset = (width * y + width - 1 - x) << 2
      const pixel = buffer.readUInt32BE(offset, true)
      newBuffer.writeUInt32BE(pixel, newOffset, true)
    }
  }
  return newBuffer
}
792925
function flipShadow(value) {
  var elements = value.split(/\s+/);

  if (!elements) { return value; }

  var inset = (elements[0] == 'inset') ? elements.shift() + ' ' : '';
  var property = elements[0].match(/^([-+]?\d+)(\w*)$/);

  if (!property) { return value; }

  return inset + [(-1 * +property[1]) + property[2]]
      .concat(elements.splice(1)).join(' ');
}
644623
def _transmogrophy(self, angle, percent, scaleFromCenter, flipH, flipV):
        '''
        

        '''

        self.angle = angle % 360
        self.percent = percent
        self.scaleFromCenter = scaleFromCenter

        previousRect = self.rect
        previousCenter = previousRect.center
        previousX = previousRect.x
        previousY = previousRect.y

        # Rotate - pygame rotates in the opposite direction
        pygameAngle = -self.angle
        rotatedImage = pygame.transform.rotate(self.originalImage, pygameAngle)
        rotatedRect = rotatedImage.get_rect()
        rotatedWidth = rotatedRect.width
        rotatedHeight = rotatedRect.height

        # Scale
        newWidth = int(rotatedWidth * .01 * self.percent)
        newHeight = int(rotatedHeight * .01 * self.percent)
        self.image = pygame.transform.scale(rotatedImage, (newWidth, newHeight))

        # Flip
        if flipH:
            self.image = pygame.transform.flip(self.image, True, False)
        if flipV:
            self.image = pygame.transform.flip(self.image, False, True)

        # Placement

        self.rect = self.image.get_rect()
        if self.scaleFromCenter:
            self.rect.center = previousCenter

        else:  # use previous X, Y
            self.rect.x = previousX
            self.rect.y = previousY

        self.setLoc((self.rect.left, self.rect.top))
409399
private void swapImages() {
		ImagePyramid<Image> tempP;

		tempP = currentImage;
		currentImage = previousImage;
		previousImage = tempP;

		Derivative[] tempD;

		tempD = previousDerivX;
		previousDerivX = currentDerivX;
		currentDerivX = tempD;

		tempD = previousDerivY;
		previousDerivY = currentDerivY;
		currentDerivY = tempD;
	}
30934
function flip(obj) {
  var result = {};
  var keys = Object.keys(obj);
  var len = keys.length;
  for (var i = 0; i < len; i++) {
    var key = keys[i];
    result[obj[key]] = key;
  }
  return result;
}