SqueezeBrains SDK 1.13
cs_image.h
1#pragma once
2namespace sb_cs
3{
16 public enum class SbImageFormat :int {
21 };
22
26 public enum class SbImageCompressType :int {
31 };
32
36 public enum class SbImageFlipMode : int {
40 };
41
45 public enum class SbInterpolationMode : int {
48 };
49
53 ref class SbRleSeg {
54 unsigned int value;
55 int x;
56 int y;
57 int length;
58 int offset;
59 };
60
65 public ref class SbImage: SbCommon
66 {
67 public:
68
71 int Width();
72 int Height();
73 int WidthStep();
82 int Size();
83 IntPtr Data();
84
95 static SbImage^ Load(String^ filename);
96
109 static SbImage^ Create(int width, int height, SbImageFormat format);
110
124 static SbImage^ CreateHeader(int width, int height, int width_step, SbImageFormat format);
125
132 SbError SetData(IntPtr data);
133
140 SbError Save(String^ filename);
141
153
165
176
187
195
202
211
221 SbError Rotate(SbImage ^dst, SbPoint ^centre, float angle, SbInterpolationMode InterpolationMode);
222
232 SbError Resize(SbImage ^dst, SbRect ^rect, float scale, SbInterpolationMode InterpolationMode);
233
234 static String^ FormatInterpolationMode(SbInterpolationMode value);
235
236 static String^ FormatImageFormat(SbImageFormat value);
237
238 internal:
239 ~SbImage();
240 SbImage();
241 SbImage(sb_t_image *img);
242 sb_t_image *sb_image;
243 }; // group_cs_image // group_cs
246}
Common class
Definition: cs_common.h:191
SbImage class that wraps the sb_t_image structure. You must call the Dispose() method to free all the...
Definition: cs_image.h:66
int Height()
Height, in pixel, of the image.
SbImage Clone()
Clones the image.@
SbImage Convert(SbImageFormat format)
Converts the image to the specified format.
SbError Save(String^ filename)
Saves the image to file
static SbImage CreateHeader(int width, int height, int width_step, SbImageFormat format)
Creates the image header without allocating the data.
int BytesPerPixel()
Number of bytes of each pixel.
int WidthStep()
Number of bytes to move the pointer to one row to the next one.
SbError Flip(SbImage ^dst, SbImageFlipMode flipmode)
Flips the image
static SbImage Create(int width, int height, SbImageFormat format)
Creates an image.
int Size()
Dimension, in bytes, of the vector sb_t_image::data.
SbError Resize(SbImage ^dst, SbRect ^rect, float scale, SbInterpolationMode InterpolationMode)
Resizes the image
SbImage Compress(SbImageCompressType compression)
Compresses the image with the compression type specified.
SbError Rotate(SbImage ^dst, SbPoint ^centre, float angle, SbInterpolationMode InterpolationMode)
Rotates the image
static SbImage Load(String^ filename)
Loads an image from file.
SbImageCompressType Compression()
Image compression type
IntPtr Data()
Pointer to the data.
SbError SetData(IntPtr data)
Sets the pointer to a block of memory for image data.
SbImage Decompress()
Decompresses the image.
SbError Clean()
Cleans the image
int Width()
Width, in pixel, of the image.
SbError Copy(SbImage ^dst)
Copies the image content
SbImageFormat Format()
Format of the image pixel
Point class that wraps the sb_t_point structure
Definition: cs_sb.h:180
Rectangle class that wraps the sb_t_rect structure
Definition: cs_sb.h:224
Image rle segment enumeration that wraps the sb_t_rle_seg structure
Definition: cs_image.h:53
unsigned int value
Value of the segment.
Definition: cs_image.h:54
int length
Length of the segment.
Definition: cs_image.h:57
int offset
Offset of the segment from the beginning of the uncompressed buffer, in bytes.
Definition: cs_image.h:58
int y
y-coordinate of the beginning of the segment
Definition: cs_image.h:56
int x
x-coordinate of the beginning of the segment
Definition: cs_image.h:55
SbError
Enum error codes
Definition: cs_common.h:13
SbImageFlipMode
Image flip mode enumeration that wraps the sb_t_image_flip_mode enum
Definition: cs_image.h:36
SbImageCompressType
Image compression type enumeration that wraps the sb_t_image_compress_type enum
Definition: cs_image.h:26
SbInterpolationMode
Interpolation mode enumeration that wraps the sb_t_interpolation_mode enum
Definition: cs_image.h:45
SbImageFormat
Image format enumeration that wraps the sb_t_image_format enum
Definition: cs_image.h:16
@ SB_IMAGE_FLIP_HORIZONTAL
flips the image around horizontal axis.
@ SB_IMAGE_FLIP_VERTICAL
flips the image around vertical axis.
@ SB_IMAGE_FLIP_BOTH
flips the image around both horizontal and vertical axises, it is a rotation of 180 degree.
@ SB_IMAGE_COMPRESS_PNG
PNG compression.
@ SB_IMAGE_COMPRESS_RLE
RLE (Run Lenght Encoding) lossless compression.
@ SB_IMAGE_COMPRESS_JPEG
JPEG compression.
@ SB_IMAGE_COMPRESS_NONE
uncompressed or raw images
@ SB_INTERPOLATION_MODE_NN
Nearest neighbor pixel interpolation.
@ SB_INTERPOLATION_MODE_BILINEAR
Bilinear interpolation.
@ SB_IMAGE_FORMAT_BGR888
BGR: three channel, 8 bit per channel.
@ SB_IMAGE_FORMAT_UI32
unsigned int 32 bit
@ SB_IMAGE_FORMAT_RGB888
RGB: three channel, 8 bit per channel.
@ SB_IMAGE_FORMAT_BW8
BW: one channel, 8 bit per channel.
SB Namespace
Definition: cs_common.h:3
Defines an image.
Definition: sb.h:7310