loadsave.c File Reference

#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <png.h>
#include "const.h"
#include "struct.h"
#include "global.h"
#include "divers.h"
#include "pages.h"
#include "op_c.h"
#include "boutons.h"
#include "erreurs.h"
#include "io.h"
#include "sdlscreen.h"
#include "windows.h"
#include "loadsave.h"

Data Structures

struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__

Defines

#define _XOPEN_SOURCE
#define FILENAMESPACE   13
#define FORMAT_24B   0x100

Typedefs

typedef void(* fonction_afficheur_24b )(short, short, byte, byte, byte)

Functions

void Test_PKM (void)
void Load_PKM (void)
void Save_PKM (void)
void Test_LBM (void)
void Load_LBM (void)
void Save_LBM (void)
void Test_GIF (void)
void Load_GIF (void)
void Save_GIF (void)
void Test_PCX (void)
void Load_PCX (void)
void Save_PCX (void)
void Test_BMP (void)
void Load_BMP (void)
void Save_BMP (void)
void Test_IMG (void)
void Load_IMG (void)
void Save_IMG (void)
void Test_SCx (void)
void Load_SCx (void)
void Save_SCx (void)
void Test_CEL (void)
void Load_CEL (void)
void Save_CEL (void)
void Test_KCF (void)
void Load_KCF (void)
void Save_KCF (void)
void Test_PAL (void)
void Load_PAL (void)
void Save_PAL (void)
void Test_PI1 (void)
void Load_PI1 (void)
void Save_PI1 (void)
void Test_PC1 (void)
void Load_PC1 (void)
void Save_PC1 (void)
void Test_PNG (void)
void Load_PNG (void)
void Save_PNG (void)
int FileLength (FILE *Fichier)
void Pixel_Chargement_dans_ecran_courant (word Pos_X, word Pos_Y, byte Couleur)
void Pixel_Chargement_dans_brosse (word Pos_X, word Pos_Y, byte Couleur)
void Pixel_Chargement_dans_preview (word Pos_X, word Pos_Y, byte Couleur)
void Remapper_fileselect (void)
void Pixel_Chargement_dans_buffer_24b (short Pos_X, short Pos_Y, byte R, byte V, byte B)
void Pixel_Chargement_dans_preview_24b (short Pos_X, short Pos_Y, byte R, byte V, byte B)
void Palette_fake_24b (T_Palette Palette)
void Initialiser_preview_24b (int Largeur, int Hauteur)
void Initialiser_preview (short Largeur, short Hauteur, long Taille, int Format)
void Dessiner_preview_palette (void)
void Nom_fichier_complet (char *Nom_du_fichier, byte Sauve_Colorix)
void Lire_octet (FILE *Fichier, byte *Octet)
void Init_ecriture (void)
void Ecrire_octet (FILE *Fichier, byte Octet)
void Close_ecriture (FILE *Fichier)
void Modif_Erreur_fichier (int Nouvelle_valeur)
void Charger_image (byte Image)
void Sauver_image (byte Image)
void Trouver_recon (byte *Recon1, byte *Recon2)
void Adapter_Palette_HAM (void)
byte Wait_for (byte *Section_attendue)
byte Couleur_ILBM_line (word Pos_X, word Vraie_taille_ligne, byte HBPm1)
void Draw_ILBM_line (short Pos_Y, short Vraie_taille_ligne)
void Transferer_couleurs (void)
void Nouvelle_couleur (byte Couleur)
word GIF_Get_next_code (void)
void GIF_Nouveau_pixel (byte Couleur)
void GIF_Vider_le_buffer (void)
void GIF_Set_code (word Code)
byte GIF_Pixel_suivant (void)
void Draw_PCX_line (short Pos_Y, byte Depth)
void PI1_8b_to_16p (byte *Src, byte *Dst)
void PI1_16p_to_8b (byte *Src, byte *Dst)
void PI1_Decoder_palette (byte *Src, byte *Pal)
void PI1_Coder_palette (byte *Pal, byte *Dst)
void PC1_Decompresser_PackBits (byte *Src, byte *Dst)
void PC1_Compresser_PackBits (byte *Src, byte *Dst, int TailleS, int *TailleD)
void PC1_4pb_to_1lp (byte *Src0, byte *Src1, byte *Src2, byte *Src3, byte *Dst)
void PC1_1lp_to_4pb (byte *Src, byte *Dst0, byte *Dst1, byte *Dst2, byte *Dst3)
void Load_RAW_24B (int Largeur, int Hauteur, Bitmap24B Source)
void Load_TGA (char *nom, Bitmap24B *dest, int *larg, int *haut)
void Emergency_backup (const char *Fname, byte *Source, int Largeur, int Hauteur, T_Palette *Palette)
void Image_emergency_backup ()

Variables

T_Format FormatFichier [NB_FORMATS_CONNUS]
enum PIXEL_RATIO Ratio_image_chargee = PIXEL_SIMPLE
short Preview_Facteur_X
short Preview_Facteur_Y
short Preview_Pos_X
short Preview_Pos_Y
byte HBPm1
int Image_24b
struct Composantes * Buffer_image_24b
fonction_afficheur_24b Pixel_Chargement_24b
byteTampon_ecriture
word Index_ecriture
byteLBM_Buffer
FILE * LBM_Fichier
byte Image_HAM
byte LBM_File_de_couleurs [129]
word LBM_Taille_de_file
byte LBM_Mode_repetition
word GIF_Nb_bits
word GIF_Rest_bits
byte GIF_Rest_byte
word GIF_Code_actuel
byte GIF_Last_byte
word GIF_Pos_X
word GIF_Pos_Y
word GIF_Entrelacee
word GIF_Image_entrelacee_terminee
word GIF_Passe
FILE * GIF_Fichier
int GIF_Arret
byte GIF_Buffer [256]
T_PCX_Header PCX_Header
png_bytep * row_pointers

Define Documentation

#define _XOPEN_SOURCE

#define FILENAMESPACE   13

#define FORMAT_24B   0x100


Typedef Documentation

typedef void(* fonction_afficheur_24b)(short, short, byte, byte, byte)


Function Documentation

void Test_PKM ( void   ) 

void Load_PKM ( void   ) 

void Save_PKM ( void   ) 

void Test_LBM ( void   ) 

void Load_LBM ( void   ) 

void Save_LBM ( void   ) 

void Test_GIF ( void   ) 

void Load_GIF ( void   ) 

void Save_GIF ( void   ) 

void Test_PCX ( void   ) 

void Load_PCX ( void   ) 

void Save_PCX ( void   ) 

void Test_BMP ( void   ) 

void Load_BMP ( void   ) 

void Save_BMP ( void   ) 

void Test_IMG ( void   ) 

void Load_IMG ( void   ) 

void Save_IMG ( void   ) 

void Test_SCx ( void   ) 

void Load_SCx ( void   ) 

void Save_SCx ( void   ) 

void Test_CEL ( void   ) 

void Load_CEL ( void   ) 

void Save_CEL ( void   ) 

void Test_KCF ( void   ) 

void Load_KCF ( void   ) 

void Save_KCF ( void   ) 

void Test_PAL ( void   ) 

void Load_PAL ( void   ) 

void Save_PAL ( void   ) 

void Test_PI1 ( void   ) 

void Load_PI1 ( void   ) 

void Save_PI1 ( void   ) 

void Test_PC1 ( void   ) 

void Load_PC1 ( void   ) 

void Save_PC1 ( void   ) 

void Test_PNG ( void   ) 

void Load_PNG ( void   ) 

void Save_PNG ( void   ) 

int FileLength ( FILE *  Fichier  ) 

void Pixel_Chargement_dans_ecran_courant ( word  Pos_X,
word  Pos_Y,
byte  Couleur 
)

void Pixel_Chargement_dans_brosse ( word  Pos_X,
word  Pos_Y,
byte  Couleur 
)

void Pixel_Chargement_dans_preview ( word  Pos_X,
word  Pos_Y,
byte  Couleur 
)

void Remapper_fileselect ( void   ) 

void Pixel_Chargement_dans_buffer_24b ( short  Pos_X,
short  Pos_Y,
byte  R,
byte  V,
byte  B 
)

void Pixel_Chargement_dans_preview_24b ( short  Pos_X,
short  Pos_Y,
byte  R,
byte  V,
byte  B 
)

void Palette_fake_24b ( T_Palette  Palette  ) 

Referenced by Initialiser_preview_24b().

void Initialiser_preview_24b ( int  Largeur,
int  Hauteur 
)

void Initialiser_preview ( short  Largeur,
short  Hauteur,
long  Taille,
int  Format 
)

void Dessiner_preview_palette ( void   ) 

void Nom_fichier_complet ( char *  Nom_du_fichier,
byte  Sauve_Colorix 
)

void Lire_octet ( FILE *  Fichier,
byte Octet 
)

void Init_ecriture ( void   ) 

void Ecrire_octet ( FILE *  Fichier,
byte  Octet 
)

void Close_ecriture ( FILE *  Fichier  ) 

void Modif_Erreur_fichier ( int  Nouvelle_valeur  ) 

References Erreur_fichier.

Referenced by Load_LBM(), and Load_PCX().

void Charger_image ( byte  Image  ) 

void Sauver_image ( byte  Image  ) 

void Trouver_recon ( byte Recon1,
byte Recon2 
)

void Adapter_Palette_HAM ( void   ) 

References Principal_Palette.

Referenced by Load_LBM().

byte Wait_for ( byte Section_attendue  ) 

References LBM_Fichier, read_bytes(), and read_dword_be().

Referenced by Load_LBM().

byte Couleur_ILBM_line ( word  Pos_X,
word  Vraie_taille_ligne,
byte  HBPm1 
)

References LBM_Buffer.

Referenced by Draw_ILBM_line().

void Draw_ILBM_line ( short  Pos_Y,
short  Vraie_taille_ligne 
)

void Transferer_couleurs ( void   ) 

References Ecrire_octet(), and LBM_Fichier.

Referenced by Nouvelle_couleur(), and Save_LBM().

void Nouvelle_couleur ( byte  Couleur  ) 

References Transferer_couleurs().

Referenced by Save_LBM().

word GIF_Get_next_code ( void   ) 

References Lire_octet().

Referenced by Load_GIF().

void GIF_Nouveau_pixel ( byte  Couleur  ) 

void GIF_Vider_le_buffer ( void   ) 

References Ecrire_octet().

Referenced by GIF_Set_code(), and Save_GIF().

void GIF_Set_code ( word  Code  ) 

References GIF_Vider_le_buffer().

Referenced by Save_GIF().

byte GIF_Pixel_suivant ( void   ) 

void Draw_PCX_line ( short  Pos_Y,
byte  Depth 
)

void PI1_8b_to_16p ( byte Src,
byte Dst 
)

Referenced by Load_PI1().

void PI1_16p_to_8b ( byte Src,
byte Dst 
)

Referenced by Save_PI1().

void PI1_Decoder_palette ( byte Src,
byte Pal 
)

Referenced by Load_PC1(), and Load_PI1().

void PI1_Coder_palette ( byte Pal,
byte Dst 
)

Referenced by Save_PC1(), and Save_PI1().

void PC1_Decompresser_PackBits ( byte Src,
byte Dst 
)

References Erreur_fichier.

Referenced by Load_PC1().

void PC1_Compresser_PackBits ( byte Src,
byte Dst,
int  TailleS,
int *  TailleD 
)

Referenced by Save_PC1().

void PC1_4pb_to_1lp ( byte Src0,
byte Src1,
byte Src2,
byte Src3,
byte Dst 
)

Referenced by Load_PC1().

void PC1_1lp_to_4pb ( byte Src,
byte Dst0,
byte Dst1,
byte Dst2,
byte Dst3 
)

Referenced by Save_PC1().

void Load_RAW_24B ( int  Largeur,
int  Hauteur,
Bitmap24B  Source 
)

References read_bytes().

void Load_TGA ( char *  nom,
Bitmap24B dest,
int *  larg,
int *  haut 
)

References read_bytes().

void Emergency_backup ( const char *  Fname,
byte Source,
int  Largeur,
int  Hauteur,
T_Palette Palette 
)

void Image_emergency_backup ( void   ) 


Variable Documentation

T_Format FormatFichier[NB_FORMATS_CONNUS]

Initial value:

 {
  {"pkm", Test_PKM, Load_PKM, Save_PKM, 1, 1},
  {"lbm", Test_LBM, Load_LBM, Save_LBM, 1, 0},
  {"gif", Test_GIF, Load_GIF, Save_GIF, 1, 1},
  {"bmp", Test_BMP, Load_BMP, Save_BMP, 1, 0},
  {"pcx", Test_PCX, Load_PCX, Save_PCX, 1, 0},
  {"img", Test_IMG, Load_IMG, Save_IMG, 1, 0},
  {"sc?", Test_SCx, Load_SCx, Save_SCx, 1, 0},
  {"pi1", Test_PI1, Load_PI1, Save_PI1, 1, 0},
  {"pc1", Test_PC1, Load_PC1, Save_PC1, 1, 0},
  {"cel", Test_CEL, Load_CEL, Save_CEL, 1, 0},
  {"kcf", Test_KCF, Load_KCF, Save_KCF, 0, 0},
  {"pal", Test_PAL, Load_PAL, Save_PAL, 0, 0},

  {"png", Test_PNG, Load_PNG, Save_PNG, 1, 1}

}

Referenced by Bouton_Load_ou_Save(), Lire_liste_des_fichiers(), Load_picture(), and Save_picture().

enum PIXEL_RATIO Ratio_image_chargee = PIXEL_SIMPLE

Referenced by Charger_image(), and Load_PNG().

int Image_24b

struct Composantes* Buffer_image_24b

FILE* LBM_Fichier

FILE* GIF_Fichier

int GIF_Arret

T_PCX_Header PCX_Header

Referenced by Load_PCX(), and Save_PCX().

png_bytep* row_pointers


Generated on Sat Mar 7 22:45:16 2009 for GrafX2 by  doxygen 1.5.8