1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- package com.epson.lib.escani2;
- import com.epson.lib.escani2.EscanI2Lib;
- import java.io.Serializable;
- public class ScannerI2Info implements Serializable {
- public static final int ALIGNMENT_UNDEFINED = 255;
- public int adfAlignment;
- public int adfDuplexType;
- public boolean adfInstalled;
- public int adfSensorHeight;
- public int adfSensorWidth;
- public int adfType;
- public int flatbedAlignment;
- public boolean flatbedInstalled;
- public int flatbedSensorHeight;
- public int flatbedSensorWidth;
- public int imageSensorHeight;
- public int imageSensorWidth;
- public String productName;
- public int getSensorSizeBaseResolution() {
- return 100;
- }
- public int getAlignment(EscanI2Lib.InputUnit inputUnit) {
- switch (inputUnit) {
- case ADF:
- if (!this.adfInstalled) {
- return 255;
- }
- return this.adfAlignment;
- case FLATBED:
- if (!this.flatbedInstalled) {
- return 255;
- }
- return this.flatbedAlignment;
- default:
- return 255;
- }
- }
- public int[] getSensorPixelSize(EscanI2Lib.InputUnit inputUnit, int i, int i2) {
- int[] sensorSize = getSensorSize(inputUnit);
- int sensorSizeBaseResolution = getSensorSizeBaseResolution();
- if (i != sensorSizeBaseResolution) {
- sensorSize[0] = (int) ((((double) sensorSize[0]) * ((double) i)) / ((double) sensorSizeBaseResolution));
- }
- if (i2 != sensorSizeBaseResolution) {
- sensorSize[1] = (int) ((((double) sensorSize[1]) * ((double) i2)) / ((double) sensorSizeBaseResolution));
- }
- return sensorSize;
- }
- public int[] getSensorSize(EscanI2Lib.InputUnit inputUnit) {
- if (C09741.$SwitchMap$com$epson$lib$escani2$EscanI2Lib$InputUnit[inputUnit.ordinal()] != 1) {
- if (!this.flatbedInstalled) {
- return null;
- }
- return new int[]{this.flatbedSensorWidth, this.flatbedSensorHeight};
- } else if (!this.adfInstalled) {
- return null;
- } else {
- return new int[]{this.adfSensorWidth, this.adfSensorHeight};
- }
- }
- public boolean isAdfAlignmentInvalid() {
- return this.adfAlignment == 255;
- }
- }
|