예제 #1
0
 public static byte[] BitmapToTileMapped(Bitmap image, BGR565 pal, TileMapType tileMap, ColorDepth colorDepth)
 {
     if (!_isConvertersInitialized)
     {
         InitilizeConverters();
     }
     byte[] alphaValues         = null;
     byte[] uncompressedIndexes = ImageTypeConverter.GenerateTiledIndices(image, pal, tileMap, true);
     return(_indexedFormatConverters[colorDepth].CompressIndexes(uncompressedIndexes));
 }
예제 #2
0
 public static Bitmap TileMappedToBitmap(byte[] file, List <ushort> tilemap, int width, int height, BGR565 pal, ColorDepth colorDepth)
 {
     if (!_isConvertersInitialized)
     {
         InitilizeConverters();
     }
     byte[] alphaValues = null;
     byte[] indexes     = _indexedFormatConverters[colorDepth].DecompressIndexes(file, ref alphaValues);
     return(ImageTypeConverter.TiledToBmp(indexes, width, height, pal, tilemap, alphaValues));
 }
예제 #3
0
 public static Bitmap SpriteToBitmap(byte[] tiles, byte[] pal, TypeSprite oams, TileMode tileMode, ColorDepth colorDepth)
 {
     if (!_isConvertersInitialized)
     {
         InitilizeConverters();
     }
     byte[] alphaValues = null;
     // byte[] indexes = _indexedFormatConverters[colorDepth].DecompressIndexes(tiles, ref alphaValues);
     return(ImageTypeConverter.SpriteFrameToBmp(tiles, pal, oams, tileMode, colorDepth));
 }
예제 #4
0
 public static Bitmap RawIndexedToBitmap(byte[] file, int width, int height, BGR565 pal, TileMode tileMode, ColorDepth colorDepth)
 {
     if (!_isConvertersInitialized)
     {
         InitilizeConverters();
     }
     byte[] alphaValues = null;
     byte[] indexes     = _indexedFormatConverters[colorDepth].DecompressIndexes(file, ref alphaValues);
     if (tileMode == TileMode.Tiled)
     {
         return(ImageTypeConverter.TiledToBmp(indexes, width, height, pal, null, alphaValues));
     }
     else
     {
         return(ImageTypeConverter.NotTiledToBmp(indexes, width, height, pal, alphaValues));
     }
 }
예제 #5
0
        public static byte[] BitmapToRawIndexed(Bitmap image, BGR565 pal, TileMode tileMode, ColorDepth colorDepth)
        {
            if (!_isConvertersInitialized)
            {
                InitilizeConverters();
            }
            byte[] alphaValues = null;
            byte[] uncompressedIndexes;

            if (tileMode == TileMode.Tiled)
            {
                uncompressedIndexes = ImageTypeConverter.GenerateTiledIndices(image, pal, null, false);
            }
            else
            {
                uncompressedIndexes = ImageTypeConverter.GenerateNotTiledToBmp(image, pal);
            }

            byte[] indexes = _indexedFormatConverters[colorDepth].CompressIndexes(uncompressedIndexes);
            return(indexes);
        }