CL_SpriteDescription::add_alphaclipped_frames - ClanLib Game SDK

Home | All Classes | Grouped Classes | Index | Search

# CL_SpriteDescription::add_alphaclipped_frames

Adds images separated with pure alpha (within trans_limit).

    	void add_alphaclipped_frames(
    		CL_PixelBuffer provider, int xpos = 0, int ypos = 0, float trans_limit = 0.05f);

Parameters:

provider
  Image source.
xpos, ypos
  Upper left position where alpha cutting should begin.
trans_limit
  Amount of non-transparent alpha allowed before a pixel is not considered transparent.
delete_provider
  If true, deletes provider when sprite description is destroyed.

Detailed description:

The alpha clipper will cut out frames from an image based on the transparency in the picture. It first determines the height of a row by searching for the first line that it considers completely transparent. Then it finds the width of each frame on this line by looking for columns that are completely transparency.

See also:

CL_SpriteDescription | CL_PixelBuffer

Questions or comments, write to the ClanLib mailing list.