- Main Page
- Classes
- Files

- File List
- File Members

# flTextureBMP.c File Reference

`#include "flGlobal.h"`
`#include <stdlib.h>`
`#include <string.h>`
`#include <pspgu.h>`
`#include "flTextureBMPWinPal.c"`

Go to the source code of this file.

## Classes
struct | bmpHeader
struct | bmpInfoHeaderGeneric
## Defines
#define | BMP_WIN_COMPRESSION_RGB 0
#define | BMP_WIN_COMPRESSION_RLE8 1
#define | BMP_WIN_COMPRESSION_RLE4 2
#define | BMP_WIN_COMPRESSION_BITFIELDS 3
#define | BMP_WIN_COMPRESSION_JPEG 4
#define | BMP_WIN_COMPRESSION_PNG 5
#define | BMP_OS2_COMPRESSION_NONE 0
#define | BMP_OS2_COMPRESSION_RLE8 1
#define | BMP_OS2_COMPRESSION_RLE4 2
#define | BMP_OS2_COMPRESSION_HUFF1D 3
#define | BMP_OS2_COMPRESSION_RLE24 4
#define | BMP_GEN_COMPRESSION_RGB 0
#define | BMP_GEN_COMPRESSION_RLE4 1
#define | BMP_GEN_COMPRESSION_RLE8 2
#define | BMP_GEN_COMPRESSION_HUFF1D 3
#define | BMP_GEN_COMPRESSION_RLE24 4
#define | BMP_GEN_COMPRESSION_BITFIELDS 5
#define | BMP_GEN_COMPRESSION_JPEG 6
#define | BMP_GEN_COMPRESSION_PNG 7
#define | BMP_HEADER_OS2V1 12
#define | BMP_HEADER_OS2V2 64
#define | BMP_HEADER_WV1 10
#define | BMP_HEADER_WV2 12
#define | BMP_HEADER_WV3 40
#define | BMP_HEADER_WV4 108
#define | BMP_HEADER_WV5 124
## Functions
Texture * | texLoadBMP (char *inPath)
| Loads a bitmap image into a Texture struct.
bool | texSaveBMP (Texture *inTex, char *inPath)
| Saves a bitmap image from a Texture struct.

## Define Documentation

#define BMP_GEN_COMPRESSION_BITFIELDS 5

Definition at line 193 of file flTextureBMP.c.

#define BMP_GEN_COMPRESSION_HUFF1D 3

Definition at line 191 of file flTextureBMP.c.

#define BMP_GEN_COMPRESSION_JPEG 6

Definition at line 194 of file flTextureBMP.c.

#define BMP_GEN_COMPRESSION_PNG 7

Definition at line 195 of file flTextureBMP.c.

#define BMP_GEN_COMPRESSION_RGB 0

Definition at line 188 of file flTextureBMP.c.

#define BMP_GEN_COMPRESSION_RLE24 4

Definition at line 192 of file flTextureBMP.c.

#define BMP_GEN_COMPRESSION_RLE4 1

Definition at line 189 of file flTextureBMP.c.

#define BMP_GEN_COMPRESSION_RLE8 2

Definition at line 190 of file flTextureBMP.c.

#define BMP_HEADER_OS2V1 12

Definition at line 197 of file flTextureBMP.c.

#define BMP_HEADER_OS2V2 64

Definition at line 198 of file flTextureBMP.c.

#define BMP_HEADER_WV1 10

Definition at line 199 of file flTextureBMP.c.

Referenced by texLoadBMP().

#define BMP_HEADER_WV2 12

Definition at line 200 of file flTextureBMP.c.

#define BMP_HEADER_WV3 40

Definition at line 201 of file flTextureBMP.c.

#define BMP_HEADER_WV4 108

Definition at line 202 of file flTextureBMP.c.

#define BMP_HEADER_WV5 124

Definition at line 203 of file flTextureBMP.c.

#define BMP_OS2_COMPRESSION_HUFF1D 3

Definition at line 185 of file flTextureBMP.c.

#define BMP_OS2_COMPRESSION_NONE 0

Definition at line 182 of file flTextureBMP.c.

#define BMP_OS2_COMPRESSION_RLE24 4

Definition at line 186 of file flTextureBMP.c.

#define BMP_OS2_COMPRESSION_RLE4 2

Definition at line 184 of file flTextureBMP.c.

#define BMP_OS2_COMPRESSION_RLE8 1

Definition at line 183 of file flTextureBMP.c.

#define BMP_WIN_COMPRESSION_BITFIELDS 3

Definition at line 178 of file flTextureBMP.c.

#define BMP_WIN_COMPRESSION_JPEG 4

Definition at line 179 of file flTextureBMP.c.

#define BMP_WIN_COMPRESSION_PNG 5

Definition at line 180 of file flTextureBMP.c.

#define BMP_WIN_COMPRESSION_RGB 0

Definition at line 175 of file flTextureBMP.c.

#define BMP_WIN_COMPRESSION_RLE4 2

Definition at line 177 of file flTextureBMP.c.

#define BMP_WIN_COMPRESSION_RLE8 1

Definition at line 176 of file flTextureBMP.c.

## Function Documentation

Texture* texLoadBMP | ( | char * | inPath | ) |

Loads a bitmap image into a Texture struct.

Parameters:

  | inPath | Path to the bitmap image in memory or file.

Returns:
  A pointer to the texture struct created to hold the bmp, or NULL on failure.

Definition at line 206 of file flTextureBMP.c.

References BMP_HEADER_WV1, bmpInfoHeaderGeneric::bmpAlphaMask, bmpInfoHeaderGeneric::bmpBlueMask, bmpInfoHeaderGeneric::bmpBPP, bmpInfoHeaderGeneric::bmpByteWidth, bmpInfoHeaderGeneric::bmpColorEncoding, bmpInfoHeaderGeneric::bmpColorsImportant, bmpInfoHeaderGeneric::bmpColorsUsed, bmpInfoHeaderGeneric::bmpCompression, bmpInfoHeaderGeneric::bmpCSType, bmpHeader::bmpDataOffset, bmpInfoHeaderGeneric::bmpEndpoints, bmpHeader::bmpFileSize, bmpInfoHeaderGeneric::bmpGammaBlue, bmpInfoHeaderGeneric::bmpGammaGreen, bmpInfoHeaderGeneric::bmpGammaRed, bmpInfoHeaderGeneric::bmpGreenMask, bmpInfoHeaderGeneric::bmpHeight, bmpInfoHeaderGeneric::bmpIdentifier, bmpInfoHeaderGeneric::bmpImageSize, bmpInfoHeaderGeneric::bmpIntent, bmpInfoHeaderGeneric::bmpPlanes, bmpInfoHeaderGeneric::bmpProfileData, bmpInfoHeaderGeneric::bmpProfileSize, bmpInfoHeaderGeneric::bmpRecording, bmpInfoHeaderGeneric::bmpRedMask, bmpInfoHeaderGeneric::bmpRendering, bmpHeader::bmpReserved, bmpInfoHeaderGeneric::bmpReserved, bmpHeader::bmpSignature, bmpInfoHeaderGeneric::bmpSize, bmpInfoHeaderGeneric::bmpSize1, bmpInfoHeaderGeneric::bmpSize2, bmpInfoHeaderGeneric::bmpType, bmpInfoHeaderGeneric::bmpUnits, bmpInfoHeaderGeneric::bmpWidth, bmpInfoHeaderGeneric::bmpXResolution, bmpInfoHeaderGeneric::bmpYResolution, debugError, debugWarning, FILE_MODE_BINARY, FILE_MODE_READ, fileClose(), fileOpen(), fileRead(), and NULL.

Referenced by texLoad().

bool texSaveBMP | ( | Texture * | inTex,
|  | char * | inPath |
| ) |  |  |

Saves a bitmap image from a Texture struct.

Parameters:

  | inTex | The texture to save as a bmp.
  | inPath | Path to the file to which the bitmap image will be written.

Returns:
  Whether the bitmap was saved successfully or not.

Warning:
  This will always return false an log an error as it is not yet implemented.

Definition at line 859 of file flTextureBMP.c.

References debugWarning.

Referenced by texSave().