-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathimage.cpp
57 lines (48 loc) · 989 Bytes
/
image.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "types.h"
#include "memory.h"
#include "image.h"
#ifdef __BORLANDC__
#include <iostream.h>
#else
#include <iostream>
#endif
image::image()
: canvas()
{
}
void image::printhex(void)
{
int32_t i,j,b;
b=_width;
printf("width: %d height: %d\n",_width,_height);
printf(" ");
for (i=0;i<b;i++) {
printf("%2d ",i);
}
printf("\n");
for (j=0;j<_height;j++) {
printf("%2d: ",j);
for (i=0;i<b;i++) {
printf("%02x ",_buffer[j*_width+i]);
}
printf("\n");
}
}
void image::dumppalette(void)
{
int i;
for (i=0;i<_palette_size;i++) {
printf("%d: %02x %02x %02x\n",i,_palette[i].r,_palette[i].g,_palette[i].b);
}
}
/*
void image::drawtile(image& image, int x, int y, char bpp, unsigned char color, unsigned char *tiledata)
{
int tx,ty;
switch(bpp) {
case 1:
for(tx=0;tx<
*/