This function scales the row

@param scale How much you want the image to be scaled, must be greater than or equal to 1.
@return the scaled row
500396
byte[] getScaledRow(int scale) {
    byte[] output = new byte[row.length * scale];
    for (int i = 0; i < output.length; i++) {
      output[i] = row[i / scale];
    }
    return output;
  }
582555
public static void scale(Image srcImg, OutputStream out, float scale) throws IORuntimeException {
		scale(srcImg, getImageOutputStream(out), scale);
	}
705603
def image_scale(xscale=1.0, yscale=1.0, axes="gca"):
    
    if axes == "gca": axes = _pylab.gca()

    e = axes.images[0].get_extent()
    x1 = e[0]*xscale
    x2 = e[1]*xscale
    y1 = e[2]*yscale
    y2 = e[3]*yscale

    image_set_extent([x1,x2],[y1,y2], axes)
326941
def _squish(scale:uniform=1.0, row_pct:uniform=0.5, col_pct:uniform=0.5):
    ""
    if scale <= 1:
        col_c = (1-scale) * (2*col_pct - 1)
        return _get_zoom_mat(scale, 1, col_c, 0.)
    else:
        row_c = (1-1/scale) * (2*row_pct - 1)
        return _get_zoom_mat(1, 1/scale, 0., row_c)
1360304
public static Image scale(Image srcImage, int width, int height, Color fixedColor) {
		return Img.from(srcImage).scale(width, height, fixedColor).getImg();
	}
830348
public void setHorizontalScaling(float scale) {
        state.scale = scale;
        content.append(scale).append(" Tz").append_i(separator);
    }
846272
private void computeScales() {
		int width = getWidth();
		int height = getHeight();

		width = (width-borderSize)/2;

		// compute the scale factor for each image
		scaleLeft = scaleRight = 1;
		if( leftImage.getWidth() > width || leftImage.getHeight() > height ) {
			double scaleX = (double)width/(double)leftImage.getWidth();
			double scaleY = (double)height/(double)leftImage.getHeight();
			scaleLeft = Math.min(scaleX,scaleY);
		}
		if( rightImage.getWidth() > width || rightImage.getHeight() > height ) {
			double scaleX = (double)width/(double)rightImage.getWidth();
			double scaleY = (double)height/(double)rightImage.getHeight();
			scaleRight = Math.min(scaleX,scaleY);
		}
	}
721576
public void scale(int scale){
        parameterSize *= scale;
        updaterStateSize *= scale;
        workingMemoryFixedInference *= scale;
        workingMemoryVariableInference *= scale;
        cacheModeMemFixed = scaleEntries(cacheModeMemFixed, scale);
        cacheModeMemVariablePerEx = scaleEntries(cacheModeMemVariablePerEx, scale);
    }
325030
public Color darker(float scale) {
        scale = 1 - scale;
		Color temp = new Color(r * scale,g * scale,b * scale,a);
		
		return temp;
	}
853000
public T withThumbnail(double scale) {
        return withThumbnail(Paths.get(location.toString(), "./thumbnails").toString(), "thumb_" + fileName, scale);
    }
267470
private Double scale(Double value, Double min, Double max) {
        if(min.equals(max)) {
            if(value>max) {
                return 1.0;
            }
            else if(value==max && value!=0.0) {
                return 1.0;
            }
            else {
                return 0.0;
            }
        }
        else {
            return (value-min)/(max-min);
        }
    }
583246
public static Image scale(Image srcImg, int width, int height) {
		return Img.from(srcImg).scale(width, height).getImg();
	}
159964
public void addScaling(double scale) {
    // invalidate inverse
    inv = null;
    // Note: last ROW is not included.
    for(int i = 0; i < dim; i++) {
      for(int j = 0; j <= dim; j++) {
        trans[i][j] = trans[i][j] * scale;
      }
    }
    // As long as relative vectors aren't used, this would also work:
    // trans[dim][dim] = trans[dim][dim] / scale;
  }
816982
@VisibleForTesting
    protected static Dimension getSize(
            final ScalebarAttributeValues scalebarParams,
            final ScaleBarRenderSettings settings, final Dimension maxLabelSize) {
        final float width;
        final float height;
        if (scalebarParams.getOrientation().isHorizontal()) {
            width = 2 * settings.getPadding()
                    + settings.getIntervalLengthInPixels() * scalebarParams.intervals
                    + settings.getLeftLabelMargin() + settings.getRightLabelMargin();
            height = 2 * settings.getPadding()
                    + settings.getBarSize() + settings.getLabelDistance()
                    + Label.getRotatedHeight(maxLabelSize, scalebarParams.getLabelRotation());
        } else {
            width = 2 * settings.getPadding()
                    + settings.getLabelDistance() + settings.getBarSize()
                    + Label.getRotatedWidth(maxLabelSize, scalebarParams.getLabelRotation());
            height = 2 * settings.getPadding()
                    + settings.getTopLabelMargin()
                    + settings.getIntervalLengthInPixels() * scalebarParams.intervals
                    + settings.getBottomLabelMargin();
        }
        return new Dimension((int) Math.ceil(width), (int) Math.ceil(height));
    }
728992
public static void scale(File srcImageFile, File destImageFile, float scale) {
		scale(read(srcImageFile), destImageFile, scale);
	}
70047
public static void scaleRow( double alpha , DMatrixRMaj A , int row ) {
        int idx = row*A.numCols;
        for (int col = 0; col < A.numCols; col++) {
            A.data[idx++] *= alpha;
        }
    }
326047
private boolean doSetScale(double scale) {
		boolean res = Math.abs(viewState.getScale() - scale) > .0000001;
		viewState = viewState.copyAndSetScale(scale);
		return res;
	}