Aviso: cuando use im�genes truecolor, siempre debe ajustar el modo gr�fico antes de cargar cualquier dato. De otro modo el formato de pixel (RGB o BGR) ser� desconocido, y el fichero podr�a ser convertido err�neamente.
BITMAP *load_bitmap(const char *filename, RGB *pal);
Carga un bitmap desde un fichero, devolviendo un puntero al bitmap y
almacenando los datos de la paleta en el lugar especificado, que deber�a
ser un array de 256 estructuras RGB. Es responsable de destruir el bitmap
cuando ya no lo necesite. Devuelve NULL si hubo errores. Por ahora esta
funci�n soporta ficheros BMP, LBM, PCX y TGA, determinando el tipo por la
extensi�n del fichero. Si el fichero contiene una imagen truecolor, debe
ajustar el modo de v�deo o llamar set_color_conversion() antes de
cargarlo.
Relacionado con: load_bmp, load_lbm, load_pcx, load_tga, destroy_bitmap, save_bitmap, register_bitmap_file_type, set_color_depth, set_color_conversion.BITMAP *load_bmp(const char *filename, RGB *pal);
Relacionado con: load_bitmap.BITMAP *load_lbm(const char *filename, RGB *pal);
Relacionado con: load_bitmap.BITMAP *load_pcx(const char *filename, RGB *pal);
Relacionado con: load_bitmap.BITMAP *load_tga(const char *filename, RGB *pal);
Relacionado con: load_bitmap.int save_bitmap(const char *filename, BITMAP *bmp, const RGB *pal);
BITMAP *bmp; PALETTE pal; get_palette(pal); bmp = create_sub_bitmap(screen, 0, 0, SCREEN_W, SCREEN_H); save_bitmap("pantalla.pcx", bmp, pal); destroy_bitmap(bmp);
Relacionado con: save_bmp, save_pcx, save_tga, load_bitmap, register_bitmap_file_type.int save_bmp(const char *filename, BITMAP *bmp, RGB *pal);
Relacionado con: save_bitmap.int save_pcx(const char *filename, BITMAP *bmp, RGB *pal);
Relacionado con: save_bitmap.int save_tga(const char *filename, BITMAP *bmp, RGB *pal);
Relacionado con: save_bitmap.void register_bitmap_file_type(const char *ext, BITMAP *(*load)(const char *filename, RGB *pal), int (*save)(const char *filename, BITMAP *bmp, const RGB *pal));
Relacionado con: load_bitmap, save_bitmap.void set_color_conversion(int mode);
Por conveniencia, las siguientes macros pueden usarse para seleccionar combinaciones comunes de los bits anteriores.COLORCONV_NONE // desactiva las conversiones entre formatos COLORCONV_8_TO_15 // expande 8 bits a 15 bits COLORCONV_8_TO_16 // expande 8 bits a 16 bits COLORCONV_8_TO_24 // expande 8 bits a 24 bits COLORCONV_8_TO_32 // expande 8 bits a 32 bits COLORCONV_15_TO_8 // reduce 15 bits a 8 bits COLORCONV_15_TO_16 // expande 15 bits a 16 bits COLORCONV_15_TO_24 // expande 15 bits a 24 bits COLORCONV_15_TO_32 // expande 15 bits a 32 bits COLORCONV_16_TO_8 // reduce 16 bits a 8 bits COLORCONV_16_TO_15 // reduce 16 bits a 15 bits COLORCONV_16_TO_24 // expande 16 bits a 24 bits COLORCONV_16_TO_32 // expande 16 bits a 32 bits COLORCONV_24_TO_8 // reduce 24 bits a 8 bits COLORCONV_24_TO_15 // reduce 24 bits a 15 bits COLORCONV_24_TO_16 // reduce 24 bits a 16 bits COLORCONV_24_TO_32 // expande 24 bits a 32 bits COLORCONV_32_TO_8 // reduce 32 bits en RGB a 8 bits COLORCONV_32_TO_15 // reduce 32 bits en RGB a 15 bits COLORCONV_32_TO_16 // reduce 32 bits en RGB a 16 bits COLORCONV_32_TO_24 // reduce 32 bits en RGB a 24 bits COLORCONV_32A_TO_8 // reduce 32 bits en RGBA a 8 bits COLORCONV_32A_TO_15 // reduce 32 bits en RGBA a 15 bits COLORCONV_32A_TO_16 // reduce 32 bits en RGBA a 16 bits COLORCONV_32A_TO_24 // reduce 32 bits en RGBA a 24 bits COLORCONV_DITHER_PAL // difumina al reducir a 8 bits COLORCONV_DITHER_HI // difumina al reducir a hicolor COLORCONV_KEEP_TRANS // mantiene la transparencia original
Si activa el bit COLORCONV_DITHER, el difuminado se efectuar� siempre que los gr�ficos truecolor se conviertan a formato hicolor o modo con paleta, incluyendo la funci�n blit(), y cualquier rutina de conversi�n autom�tica que se ejecute cuando lea gr�ficos del disco. Esto puede producir resultados visuales m�s atractivos, pero obviamente es mucho m�s lento que una conversi�n directa.COLORCONV_EXPAND_256 // expande 256 colores a hi/truecolor COLORCONV_REDUCE_TO_256 // reduce hi/truecolor a 256 colors COLORCONV_EXPAND_15_TO_16 // expande hicolor de 15 bit a 16 bits COLORCONV_REDUCE_16_TO_15 // reduce hicolor de 16 bits a 15 bits COLORCONV_EXPAND_HI_TO_TRUE // expande 15/16 bits a 24/32 bits COLORCONV_REDUCE_TRUE_TO_HI // reduce 24/32 bits a 15/16 bits COLORCONV_24_EQUALS_32 // convierte entre 24 and 32 bits COLORCONV_TOTAL // todo al formato actual COLORCONV_PARTIAL // convierte 15 <-> 16 y 24 <-> 32 COLORCONV_MOST // todas excepto hi/truecolor <-> 256
Si intenta usar bitmaps convertidos con funciones como masked_blit() o draw_sprite(), deber�a especificar el bit COLORCONV_KEEP_TRANS. Se asegurar� de que las �reas de m�scara del bitmap antes y despu�s de la conversi�n se mantendr�n iguales, convirtiendo los colores transparentes de un modo a otro y ajustando aquellos colores que tras la conversi�n podr�an ser reconvertidos en transparentes. Este bit afecta a cualquier llamada blit() entre formatos de pixel distintos y a cualquier conversi�n autom�tica.
Relacionado con: makecol15_dither, set_color_depth, load_bitmap, load_datafile, fixup_datafile.