public static unsafe extern int stbir_resize( void *input_pixels, int input_w, int input_h, int input_stride_in_bytes, void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, stbir_datatype datatype, int num_channels, int alpha_channel, int flags, stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, stbir_filter filter_horizontal, stbir_filter filter_vertical, stbir_colorspace space, void *alloc_context );
public static int stbir_resize(void *input_pixels, int input_w, int input_h, int input_stride_in_bytes, void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, stbir_datatype datatype, int num_channels, int alpha_channel, stbir__resize_flag flags, stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, stbir_filter filter_horizontal, stbir_filter filter_vertical, stbir_colorspace space) { return(stbir_resize(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, (int)datatype, num_channels, alpha_channel, (int)flags, (int)edge_mode_horizontal, (int)edge_mode_vertical, (int)filter_horizontal, (int)filter_vertical, (int)space)); }
public static unsafe MipGeneratorFn Get( MipFormat format, stbir_filter filter_horizontal = stbir_filter.DEFAULT, stbir_filter filter_vertical = stbir_filter.DEFAULT, stbir_edge edge_horizontal = stbir_edge.CLAMP, stbir_edge edge_vertical = stbir_edge.CLAMP ) { var masked = (format & ~MipFormat.sRGB); var datatype = (masked == MipFormat.Vector4) || (masked == MipFormat.pVector4) || (masked == MipFormat.Single) ? stbir_datatype.FLOAT : stbir_datatype.UINT8; var colorspace = (format & MipFormat.sRGB) == MipFormat.sRGB ? stbir_colorspace.SRGB : stbir_colorspace.LINEAR; var channels = masked == MipFormat.Gray1 ? 1 : 4; var flags = (masked == MipFormat.pRGBA) || (masked == MipFormat.pGray4) || (masked == MipFormat.pVector4) ? stbir_flags.ALPHA_PREMULTIPLIED : default; var alpha_channel = (masked == MipFormat.Gray1) ? -1 : 3; unsafe void Implementation( void *src, int srcWidth, int srcHeight, int srcStrideBytes, void *dest, int destWidth, int destHeight, int destStrideBytes ) { var result = API.stbir_resize( src, srcWidth, srcHeight, srcStrideBytes, dest, destWidth, destHeight, destStrideBytes, datatype, channels, alpha_channel, (int)flags, edge_horizontal, edge_vertical, filter_horizontal, filter_vertical, colorspace, null ); if (result != 1) { throw new Exception("An error occurred in stb_image_resize"); } } return(Implementation); } }
public static int stbir_resize_uint16_generic(ushort[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, ushort[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, stbir__resize_flag flags, stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space) { fixed(ushort *inputPtr = input_pixels) fixed(ushort *outputPtr = output_pixels) { return(stbir_resize_uint16_generic(inputPtr, input_w, input_h, input_stride_in_bytes, outputPtr, output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, (int)flags, (int)edge_wrap_mode, (int)filter, (int)space)); } }