All Downloads are FREE. Search and download functionalities are using the official Maven repository.

boofcv.struct.border.ImageBorder1D_IL_S32 Maven / Gradle / Ivy

/*
 * Copyright (c) 2021, Peter Abeles. All Rights Reserved.
 *
 * This file is part of BoofCV (http://boofcv.org).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package boofcv.struct.border;

import boofcv.struct.image.InterleavedInteger;

/**
 * @author Peter Abeles
 */
public class ImageBorder1D_IL_S32>
		extends ImageBorder_IL_S32 implements ImageBorder1D {
	BorderIndex1D rowWrap;
	BorderIndex1D colWrap;

	public ImageBorder1D_IL_S32( FactoryBorderIndex1D factory ) {
		this.rowWrap = factory.newInstance();
		this.colWrap = factory.newInstance();
	}

	public ImageBorder1D_IL_S32( BorderIndex1D rowWrap, BorderIndex1D colWrap ) {
		this.rowWrap = rowWrap;
		this.colWrap = colWrap;
	}

	@Override public BorderIndex1D getRowWrap() { return rowWrap; }

	@Override public BorderIndex1D getColWrap() { return colWrap; }

	@Override
	public void setImage( T image ) {
		super.setImage(image);
		colWrap.setLength(image.width);
		rowWrap.setLength(image.height);
	}

	@Override
	public ImageBorder1D_IL_S32 copy() {
		return new ImageBorder1D_IL_S32<>(this.rowWrap.copy(), this.colWrap.copy());
	}

	@Override
	public void getOutside( int x, int y, int[] pixel ) {
		image.unsafe_get(colWrap.getIndex(x), rowWrap.getIndex(y), pixel);
	}

	@Override
	public void setOutside( int x, int y, int[] pixel ) {
		image.unsafe_set(colWrap.getIndex(x), rowWrap.getIndex(y), pixel);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy