Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naocoding/bmp.c
C BMP library by NaoCoding
https://github.com/naocoding/bmp.c
Last synced: about 2 months ago
JSON representation
C BMP library by NaoCoding
- Host: GitHub
- URL: https://github.com/naocoding/bmp.c
- Owner: NaoCoding
- Created: 2024-03-31T13:55:30.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-06-29T17:59:04.000Z (6 months ago)
- Last Synced: 2024-06-29T18:54:48.992Z (6 months ago)
- Language: C
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## BMP C Library
#### Author : NaoCoding
```
This library includes general useful function for C to parse BMP file.
It is written during the course "computer programming II" by Professor Chi in NTNU.
It may possess uncorrect bugs or potential issues.
Feel free to send PR / issues.
```#### Function Lists
```c
BMP * iniBMP() // initialize BMP (calloc)int BMPLoad(BMP * t, char * p, char * m) // read path to source , return 1 = file found, return 0 = not found
void ARR2BMP(BMP * target, uint8_t ***arr) // writeIn arr into a BMP file
uint8_t ***BMP2ARR(BMP *target) // Read BMP file into an arr
int READBMP(BMP * target); // return 0 = not BMP , return 1 = success (only headers)
void showBMPInfo(BMP * target); // show info
void setupBMP(BMP * target, BMP * from); // copy all header to target
void writeInHeader(BMP *target); // write in target.source (only headers)
void BMPFree(BMP * target); // free BMP
void CallocBMP(BMP * target); // for callocing BMP pointer
int dotBMPcheck(char * target); // check if string is .bmp or .BMP format , return 1 = true , 0 = false
```
#### BMP Structure ( All are pointers )
```c
file // file headerinfo // info header
path // file path
source // FILE * pointer
```
#### Example Code
```c
BMP * n = iniBMP() // initialize BMP nBMPLoad(n,"a.bmp","rb") // read BMP file "a.bmp" as n.path and make it to n.source
READBMP(n) // read BMP *n header
uint8_t ***arr = BMP2ARR(n) // read BMP *n to a uint8_t[][][]
showBMPInfo(n) // show n.file and n.info all elements
writeInHeader(n) // write n.file and n.info into n.source
```