mirror of
https://github.com/cyanfish/naps2.git
synced 2024-10-27 01:22:49 +03:00
More API cleanup
This commit is contained in:
parent
311e59aa64
commit
ddb093394d
@ -194,12 +194,9 @@ internal class ScanPerformer : IScanPerformer
|
||||
IncludeWiaDevices = false
|
||||
// TODO: Consider adding a user option for TwainOptions.ShowProgress instead of our progress window
|
||||
},
|
||||
SaneOptions =
|
||||
{
|
||||
KeyValueOptions = scanProfile.KeyValueOptions != null
|
||||
? new KeyValueScanOptions(scanProfile.KeyValueOptions)
|
||||
: new KeyValueScanOptions()
|
||||
},
|
||||
KeyValueOptions = scanProfile.KeyValueOptions != null
|
||||
? new KeyValueScanOptions(scanProfile.KeyValueOptions)
|
||||
: new KeyValueScanOptions(),
|
||||
BarcodeDetectionOptions =
|
||||
{
|
||||
DetectBarcodes = scanParams.DetectPatchT ||
|
||||
|
@ -1,6 +1,7 @@
|
||||
using Xunit;
|
||||
using NAPS2.ImportExport;
|
||||
using Xunit;
|
||||
|
||||
namespace NAPS2.Sdk.Tests.Util;
|
||||
namespace NAPS2.Sdk.Tests.ImportExport;
|
||||
|
||||
public class SliceTests
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace NAPS2.Util;
|
||||
namespace NAPS2.ImportExport;
|
||||
|
||||
/// <summary>
|
||||
/// A class that represents a Python-style slice of a collection.
|
@ -9,7 +9,7 @@ namespace NAPS2.Ocr;
|
||||
/// Allows OCR requests to be queued and prioritized. Results are cached so that requests with the same set of
|
||||
/// parameters (image, engine, language code, etc.) don't do duplicate work.
|
||||
/// </summary>
|
||||
public class OcrRequestQueue
|
||||
internal class OcrRequestQueue
|
||||
{
|
||||
private readonly Dictionary<OcrRequestParams, OcrRequest> _requestCache = new();
|
||||
private Semaphore _queueWaitHandle = new(0, int.MaxValue);
|
||||
|
@ -3,7 +3,7 @@ using NAPS2.Scan;
|
||||
|
||||
namespace NAPS2.Ocr;
|
||||
|
||||
public class StubOcrEngine : IOcrEngine
|
||||
internal class StubOcrEngine : IOcrEngine
|
||||
{
|
||||
public Task<OcrResult?> ProcessImage(ScanningContext scanningContext, string imagePath, OcrParams ocrParams,
|
||||
CancellationToken cancelToken)
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace NAPS2.Scan;
|
||||
|
||||
public static class DriverNames
|
||||
internal static class DriverNames
|
||||
{
|
||||
// TODO: Ideally we just change everything to use the Driver enum
|
||||
public const string WIA = "wia";
|
||||
|
@ -2,6 +2,4 @@
|
||||
|
||||
public class SaneOptions
|
||||
{
|
||||
// TODO: Probably move this to top-level ScanOptions (as e.g. twain might have extra options too)
|
||||
public KeyValueScanOptions? KeyValueOptions { get; set; }
|
||||
}
|
@ -1,27 +1,11 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace NAPS2.Scan;
|
||||
|
||||
/// <summary>
|
||||
/// The representation of a scanning device identified by a driver.
|
||||
/// </summary>
|
||||
public class ScanDevice
|
||||
public record ScanDevice(string ID, string Name)
|
||||
{
|
||||
// Need an empty constructor for XML compatibility
|
||||
public ScanDevice()
|
||||
private ScanDevice() : this("", "")
|
||||
{
|
||||
}
|
||||
|
||||
[SetsRequiredMembers]
|
||||
public ScanDevice(string id, string name)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
|
||||
// Keeping old naming scheme for XML compatibility
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public required string ID { get; init; }
|
||||
public required string Name { get; init; }
|
||||
}
|
@ -65,6 +65,8 @@ public class ScanOptions
|
||||
public bool AutoDeskew { get; set; }
|
||||
|
||||
public bool FlipDuplexedPages { get; set; }
|
||||
|
||||
public KeyValueScanOptions? KeyValueOptions { get; set; }
|
||||
}
|
||||
|
||||
public enum HorizontalAlign
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace NAPS2.Serialization;
|
||||
|
||||
public class DeserializeImageOptions
|
||||
internal class DeserializeImageOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// If true, the Deserialize caller guarantees that the file storage will not be used for longer than the duration of the RPC call.
|
||||
|
@ -3,7 +3,7 @@ using NAPS2.Scan;
|
||||
|
||||
namespace NAPS2.Serialization;
|
||||
|
||||
public static class ImageSerializer
|
||||
internal static class ImageSerializer
|
||||
{
|
||||
public static SerializedImage Serialize(ProcessedImage image, SerializeImageOptions options)
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace NAPS2.Serialization;
|
||||
|
||||
public class SerializeImageOptions
|
||||
internal class SerializeImageOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that, when the serialized image is transferred with file-based storage, the file should be considered
|
||||
|
Loading…
Reference in New Issue
Block a user