CameraInterface 2.1.0

dotnet add package CameraInterface --version 2.1.0
                    
NuGet\Install-Package CameraInterface -Version 2.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CameraInterface" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CameraInterface" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="CameraInterface" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CameraInterface --version 2.1.0
                    
#r "nuget: CameraInterface, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CameraInterface@2.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CameraInterface&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=CameraInterface&version=2.1.0
                    
Install as a Cake Tool

CameraInterface

A lightweight .NET library providing a clean abstraction for working with camera devices and image data. It defines common camera properties, supported pixel formats.


Features

  • 🎥 Camera Abstraction — Provides the ICamera interface with common properties (resolution, offsets, ranges, exposure, and image format).
  • 🖼 Image Data Handling — Encapsulates pixel buffers in the ImageData struct with width, height, stride, and format metadata.
  • 🧩 Supported Formats — Multiple pixel formats such as Mono8, Mono16, Rgb24, Rgb32, Raw8, Raw16.
  • Zero-Copy Parsing — Optimized APIs like TryFromMemory avoid unnecessary allocations when possible.
  • Units Integration — Exposure times use UnitsNet for type-safe duration handling.

Installation

Add the project or library to your solution. If published as a NuGet package, install via:

dotnet add package CameraInterface

Usage

Implementing a Camera

using CameraInterface;
using UnitsNet;

public class DummyCamera : ICamera
{
    public int Width { get; set; } = 640;
    public int Height { get; set; } = 480;
    public int XOffset { get; set; } = 0;
    public int YOffset { get; set; } = 0;
    public (int Min, int Max) WidthRange { get; set; } = (320, 1920);
    public (int Min, int Max) HeightRange { get; set; } = (240, 1080);
    public (int Min, int Max) XOffsetRange { get; set; } = (0, 100);
    public (int Min, int Max) YOffsetRange { get; set; } = (0, 100);
    public CameraImageFormat ImageFormat { get; set; } = CameraImageFormat.Rgb24;
    public Duration Exposure { get; set; } = Duration.FromMilliseconds(10);

    public ImageData GetImage()
    {
        // Provide pixel data from the camera here
        var pixels = new byte[Width * Height * 3]; // Rgb24 = 3 bytes per pixel
        return new ImageData(pixels, Width, Height, Width * 3, ImageFormat);
    }
}

Supported Image Formats

  • Mono8 – 8-bit grayscale
  • Mono16 – 16-bit grayscale
  • Rgb24 – 24-bit RGB
  • Rgb32 – 32-bit RGB (with alpha or padding)

License

MIT License — free to use, modify, and distribute.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CameraInterface:

Package Downloads
Ximea.NET.ObjectOriented

an OO implementation of the Ximea Camera.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 224 10/18/2025
2.0.0 151 10/18/2025
1.6.0 202 10/17/2025
1.5.0 181 10/17/2025
1.4.0 216 10/7/2025
1.3.0 188 10/3/2025
1.2.0 217 9/30/2025
1.1.0 210 9/30/2025
1.0.0 218 9/30/2025

Fixed Namespace