Bitmap Converter
Bitmap Converter
SceneComposer SDK supplies basic means to create custom bitmap converter plugins. A bitmap converter plugin is a SceneComposer plugin which implements the IBitmapConverter interface.
The IBitmapConverter interface is pretty simple:
IEnumerable<CustomFormat> SupportedTypes { get; }
Specifies the list of all custom formats supported by this converter which will be identified in SceneComposer by their name.
void Convert(BinaryReader reader, BinaryWriter writer, IBitmap bitmap, int customFormatId, bool shouldBeVerticallyFlipped, out int assetFormat, out int assetType, out bool assetIsVerticallyFlipped)
Converts an imported bitmap into a specific custom format using a format id and a flag which specifies the layout of the output data. This method is called when the asset or the render data is generated.
Please note that the integer values for asset format and asset type have to be defined in conjunction with the hardware platform capabilities. For example, the default asset type defines the format like byte, short, short565, short4444 or short 5551 as defined in Candera, and the asset format defines the bitmap format like this: public enum BitmapFormat { Rgb = 0, Rgba = 1, Alpha = 2, Luminance = 3, LuminanceAlpha = 4, Depth = 5, Coverage = 6, }
Once the interface is implemented and the resulting assembly is placed into SceneComposer's plugin folder, the custom bitmap converter will be available next time SceneComposer is started.