Compare commits
2 Commits
846e09054d
...
e0e57b53f4
Author | SHA1 | Date | |
---|---|---|---|
e0e57b53f4 | |||
f135a65c96 |
@ -13,7 +13,7 @@
|
|||||||
<!-- Nuget Properties. -->
|
<!-- Nuget Properties. -->
|
||||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||||
<PackageId>ReFuel.StbImage</PackageId>
|
<PackageId>ReFuel.StbImage</PackageId>
|
||||||
<Version>1.0.1</Version>
|
<Version>1.1.0-rc0</Version>
|
||||||
<Authors>STBI Authors, H. Utku Maden</Authors>
|
<Authors>STBI Authors, H. Utku Maden</Authors>
|
||||||
<Description>
|
<Description>
|
||||||
A C# wrapper for the ubiquitous stb_image.h and stb_image_write.h library.
|
A C# wrapper for the ubiquitous stb_image.h and stb_image_write.h library.
|
||||||
|
50
StbiWrite.cs
Normal file
50
StbiWrite.cs
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace ReFuel.Stb
|
||||||
|
{
|
||||||
|
public unsafe delegate void StbiWriteProc(void* context, void* data, int size);
|
||||||
|
|
||||||
|
public unsafe partial class Stbi
|
||||||
|
{
|
||||||
|
private static readonly int* _tga_with_rle_ptr;
|
||||||
|
private static readonly int* _png_compression_level_ptr;
|
||||||
|
private static readonly int* _forced_png_filter_ptr;
|
||||||
|
|
||||||
|
public static int write_tga_with_rle
|
||||||
|
{
|
||||||
|
get => *_tga_with_rle_ptr;
|
||||||
|
set => *_tga_with_rle_ptr = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int write_png_compression_level
|
||||||
|
{
|
||||||
|
get => *_png_compression_level_ptr;
|
||||||
|
set => *_png_compression_level_ptr = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int write_force_png_filter
|
||||||
|
{
|
||||||
|
get => *_forced_png_filter_ptr;
|
||||||
|
set => *_forced_png_filter_ptr = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("stbi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbi_write_png_to_func")]
|
||||||
|
public static extern int write_png_to_func(IntPtr func, void* context, int w, int h, int comp, void* data, int stride_in_bytes);
|
||||||
|
|
||||||
|
[DllImport("stbi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbi_write_bmp_to_func")]
|
||||||
|
public static extern int write_bmp_to_func(IntPtr func, void* context, int w, int h, int comp, void* data);
|
||||||
|
|
||||||
|
[DllImport("stbi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbi_write_tga_to_func")]
|
||||||
|
public static extern int write_tga_to_func(IntPtr func, void* context, int w, int h, int comp, void* data);
|
||||||
|
|
||||||
|
[DllImport("stbi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbi_write_hdr_to_func")]
|
||||||
|
public static extern int write_hdr_to_func(IntPtr func, void* context, int w, int h, int comp, void* data);
|
||||||
|
|
||||||
|
[DllImport("stbi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbi_write_jpg_to_func")]
|
||||||
|
public static extern int write_jpg_to_func(IntPtr func, void* context, int w, int h, int comp, void* data, int quality);
|
||||||
|
|
||||||
|
[DllImport("stbi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbi_flip_vertically_on_write")]
|
||||||
|
public static extern int flip_vertically_on_write(int value);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user