SqueezeBrains SDK 1.18
sb_cs::SbImage Class Reference

SbImage class that wraps the sb_t_image structure.
You must call the Dispose() method to free all the resources of the returned instance. More...

#include <cs_image.h>

Inheritance diagram for sb_cs::SbImage:
Collaboration diagram for sb_cs::SbImage:

Public Member Functions

SbImageFormat Format ()
 Format of the image pixel

 
SbImageCompressType Compression ()
 Image compression type

 
int Width ()
 Width, in pixel, of the image.
 
int Height ()
 Height, in pixel, of the image.
 
int WidthStep ()
 Number of bytes to move the pointer to one row to the next one.
 
int BytesPerPixel ()
 Number of bytes of each pixel. More...
 
int Size ()
 Dimension, in bytes, of the vector sb_t_image::data.
 
IntPtr Data ()
 Pointer to the data.
 
SbError SetData (IntPtr data)
 Sets the pointer to a block of memory for image data. More...
 
SbError Save (String^ filename)
 Saves the image to file More...
 
SbImage Convert (SbImageFormat format)
 Converts the image to the specified format.
More...
 
SbImage Compress (SbImageCompressType compression)
 Compresses the image with the compression type specified.
More...
 
SbImage Decompress ()
 Decompresses the image.
More...
 
SbImage Clone ()
 Clones the image.@ More...
 
SbError Copy (SbImage ^dst)
 Copies the image content More...
 
SbError Clean ()
 Cleans the image More...
 
SbError Flip (SbImage ^dst, SbImageFlipMode flipmode)
 Flips the image More...
 
SbError Rotate (SbImage ^dst, SbPoint ^centre, float angle, SbInterpolationMode InterpolationMode)
 Rotates the image More...
 
SbError Resize (SbImage ^dst, SbRect ^rect, float scale, SbInterpolationMode InterpolationMode)
 Resizes the image More...
 
- Public Member Functions inherited from sb_cs::SbCommon
SbError Error ()
 Returns the error code of the last operation. If no error SbError.SB_ERR_NONE is returned. More...
 
String ErrorMsg ()
 Returns the error message of the last operation. More...
 

Static Public Member Functions

static SbImage Load (String^ filename)
 Loads an image from file.
More...
 
static SbImage Create (int width, int height, SbImageFormat format)
 Creates an image.
More...
 
static SbImage CreateHeader (int width, int height, int width_step, SbImageFormat format)
 Creates the image header without allocating the data.
More...
 
- Static Public Member Functions inherited from sb_cs::SbCommon
static String FormatError (SbError error)
 Returns the error message. More...
 

Detailed Description

SbImage class that wraps the sb_t_image structure.
You must call the Dispose() method to free all the resources of the returned instance.

Definition at line 65 of file cs_image.h.

Member Function Documentation

◆ BytesPerPixel()

int sb_cs::SbImage::BytesPerPixel ( )

◆ Clean()

SbError sb_cs::SbImage::Clean ( )

Cleans the image

Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_image_clean

◆ Clone()

SbImage sb_cs::SbImage::Clone ( )

Clones the image.@

Returns
An instance to the SbImage class or null in case of memory error.
The instance returned is valid only if the SbImage.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_image_clone

◆ Compress()

SbImage sb_cs::SbImage::Compress ( SbImageCompressType  compression)

Compresses the image with the compression type specified.

Parameters
compressionCompression type
Returns
An instance to the SbImage class or null in case of memory error.
The instance returned is valid only if the SbImage.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_image_compress

◆ Convert()

SbImage sb_cs::SbImage::Convert ( SbImageFormat  format)

Converts the image to the specified format.

Parameters
formatFormat
Returns
An instance to the SbImage class or null in case of memory error.
The instance returned is valid only if the SbImage.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_image_convert

◆ Copy()

SbError sb_cs::SbImage::Copy ( SbImage dst)

Copies the image content

Parameters
dstDestination image
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_image_copy

◆ Create()

static SbImage sb_cs::SbImage::Create ( int  width,
int  height,
SbImageFormat  format 
)
static

Creates an image.

Parameters
widthImage width
heightImage height
formatImage format
Returns
An instance to the SbImage class or null in case of memory error.
The instance returned is valid only if the SbImage.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_image_create

◆ CreateHeader()

static SbImage sb_cs::SbImage::CreateHeader ( int  width,
int  height,
int  width_step,
SbImageFormat  format 
)
static

Creates the image header without allocating the data.

Parameters
widthImage width
heightImage height
width_stepImage width step
formatImage format
Returns
An instance to the SbImage class or null in case of memory error.
The instance returned is valid only if the SbImage.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_image_create_header

◆ Decompress()

SbImage sb_cs::SbImage::Decompress ( )

Decompresses the image.

Returns
An instance to the SbImage class or null in case of memory error.
The instance returned is valid only if the SbImage.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_image_decompress

◆ Flip()

SbError sb_cs::SbImage::Flip ( SbImage dst,
SbImageFlipMode  flipmode 
)

Flips the image

Parameters
dstDestination image
flipmodeFlip mode
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_image_flip

◆ Load()

static SbImage sb_cs::SbImage::Load ( String^  filename)
static

Loads an image from file.

Parameters
filenameThe filename of the image to load
Returns
An instance to the SbImage class or null in case of memory error.
The instance returned is valid only if the SbImage.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_image_load

◆ Resize()

SbError sb_cs::SbImage::Resize ( SbImage dst,
SbRect rect,
float  scale,
SbInterpolationMode  InterpolationMode 
)

Resizes the image

Parameters
dstDestination image
rectCoordinates of the rectangular ROI of the source image that have to be resized.
scaleScale factor
InterpolationModeInterpolation mode.
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_image_resize

◆ Rotate()

SbError sb_cs::SbImage::Rotate ( SbImage dst,
SbPoint centre,
float  angle,
SbInterpolationMode  InterpolationMode 
)

Rotates the image

Parameters
dstDestination image
centreCenter of the rotation
angleAngle of rotation in radians, clockwise if positive.
InterpolationModeInterpolation mode.
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_image_rotate

◆ Save()

SbError sb_cs::SbImage::Save ( String^  filename)

Saves the image to file

Parameters
filenameFilename
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_image_save

◆ SetData()

SbError sb_cs::SbImage::SetData ( IntPtr  data)

Sets the pointer to a block of memory for image data.

Parameters
dataPointer to the data
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_image_set_data

The documentation for this class was generated from the following file: