Skip to content

Commit d55179d

Browse files
authored
Add files via upload
1 parent 8237d40 commit d55179d

File tree

11 files changed

+353
-0
lines changed

11 files changed

+353
-0
lines changed

bmp3/ReadMe.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
========================================================================
2+
CONSOLE APPLICATION : bmp3
3+
========================================================================
4+
5+
6+
AppWizard has created this bmp3 application for you.
7+
8+
This file contains a summary of what you will find in each of the files that
9+
make up your bmp3 application.
10+
11+
bmp3.dsp
12+
This file (the project file) contains information at the project level and
13+
is used to build a single project or subproject. Other users can share the
14+
project (.dsp) file, but they should export the makefiles locally.
15+
16+
bmp3.cpp
17+
This is the main application source file.
18+
19+
20+
/////////////////////////////////////////////////////////////////////////////
21+
Other standard files:
22+
23+
StdAfx.h, StdAfx.cpp
24+
These files are used to build a precompiled header (PCH) file
25+
named bmp3.pch and a precompiled types file named StdAfx.obj.
26+
27+
28+
/////////////////////////////////////////////////////////////////////////////
29+
Other notes:
30+
31+
AppWizard uses "TODO:" to indicate parts of the source code you
32+
should add to or customize.
33+
34+
/////////////////////////////////////////////////////////////////////////////

bmp3/StdAfx.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// stdafx.cpp : source file that includes just the standard includes
2+
// bmp3.pch will be the pre-compiled header
3+
// stdafx.obj will contain the pre-compiled type information
4+
5+
#include "stdafx.h"
6+
7+
// TODO: reference any additional headers you need in STDAFX.H
8+
// and not in this file

bmp3/StdAfx.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// stdafx.h : include file for standard system include files,
2+
// or project specific include files that are used frequently, but
3+
// are changed infrequently
4+
//
5+
6+
#if !defined(AFX_STDAFX_H__EF4A1570_83DC_4A03_963D_8C3787E2B8DB__INCLUDED_)
7+
#define AFX_STDAFX_H__EF4A1570_83DC_4A03_963D_8C3787E2B8DB__INCLUDED_
8+
9+
#if _MSC_VER > 1000
10+
#pragma once
11+
#endif // _MSC_VER > 1000
12+
13+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
14+
15+
#include <stdio.h>
16+
17+
// TODO: reference additional headers your program requires here
18+
19+
//{{AFX_INSERT_LOCATION}}
20+
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
21+
22+
#endif // !defined(AFX_STDAFX_H__EF4A1570_83DC_4A03_963D_8C3787E2B8DB__INCLUDED_)

bmp3/bmp3.cpp

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// bmp3.cpp : Defines the entry point for the console application.
2+
//
3+
4+
#include "stdafx.h"
5+
6+
#include <il/il.h>
7+
#include <il/ilu.h>
8+
#include <windows.h>
9+
#include "SDL.h"
10+
#include <stdio.h>
11+
#include <stdlib.h>
12+
13+
void ShowBMP(char *file, SDL_Surface *screen, int x, int y)
14+
{
15+
SDL_Surface *image;
16+
SDL_Rect dest;
17+
/* Load the BMP file into a surface */
18+
image = SDL_LoadBMP(file);
19+
if ( image == NULL )
20+
{
21+
fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
22+
return;
23+
}
24+
/* Blit onto the screen surface.
25+
The surfaces should not be locked at this point.*/
26+
dest.x = x;
27+
dest.y = y;
28+
dest.w = image->w;
29+
dest.h = image->h;
30+
SDL_BlitSurface(image, NULL, screen, &dest);
31+
32+
/* Update the changed portion of the screen */
33+
SDL_UpdateRects(screen, 1, &dest);
34+
SDL_FreeSurface(image);
35+
}
36+
37+
main(int argc, char *argv[])
38+
{
39+
unsigned char* p_inputImg;
40+
unsigned char* p_outputImg;
41+
int imgWidth, imgHeight;
42+
43+
unsigned int ImgId;
44+
char imageName[200]; //file path
45+
46+
// Load input image with DevIL
47+
ilInit();//Initialize DevIL
48+
49+
50+
/* Initialize SDL */
51+
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
52+
{
53+
fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
54+
exit(1);
55+
}
56+
atexit(SDL_Quit);
57+
58+
ilGenImages(1, &ImgId);//Generate the main image to use
59+
60+
ilBindImage(ImgId);// Bind this image name.
61+
62+
SDL_Surface *screen;
63+
screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE);
64+
65+
if ( screen == NULL )
66+
{
67+
fprintf(stderr, "Unable to set 640x480 video: %s\n", SDL_GetError());
68+
exit(1);
69+
}
70+
71+
for(int imgIdx = 1; imgIdx < 2; imgIdx++)//choose images
72+
{
73+
//ilLoadImage function loads an image from a file.
74+
sprintf(imageName, "img%d.bmp", ImgId);
75+
//ilLoadImage(imageName);
76+
//imgWidth = ilGetInteger(IL_IMAGE_WIDTH);
77+
//imgHeight = ilGetInteger(IL_IMAGE_HEIGHT);
78+
//p_outputImg = new unsigned char [imgHeight*imgWidth];
79+
// ilGetData function returns a pointer to the current image's data
80+
//p_inputImg = ilGetData();
81+
ShowBMP(imageName, screen, 0, 0);
82+
}
83+
84+
getchar ();
85+
return 0;
86+
}
87+
88+
89+
90+

bmp3/bmp3.dsp

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bmp3/bmp3.dsw

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Microsoft Developer Studio Workspace File, Format Version 6.00
2+
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3+
4+
###############################################################################
5+
6+
Project: "bmp3"=.\bmp3.dsp - Package Owner=<4>
7+
8+
Package=<5>
9+
{{{
10+
}}}
11+
12+
Package=<4>
13+
{{{
14+
}}}
15+
16+
###############################################################################
17+
18+
Global:
19+
20+
Package=<5>
21+
{{{
22+
}}}
23+
24+
Package=<3>
25+
{{{
26+
}}}
27+
28+
###############################################################################
29+

bmp3/bmp3.ncb

41 KB
Binary file not shown.

bmp3/bmp3.opt

52.5 KB
Binary file not shown.

bmp3/bmp3.plg

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<html>
2+
<body>
3+
<pre>
4+
<h1>Build Log</h1>
5+
<h3>
6+
--------------------Configuration: bmp3 - Win32 Debug--------------------
7+
</h3>
8+
<h3>Command Lines</h3>
9+
Creating temporary file "C:\DOCUME~1\MATOV~1.DE-\LOCALS~1\Temp\RSP15E.tmp" with contents
10+
[
11+
/nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/bmp3.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
12+
"E:\bmp3\bmp3.cpp"
13+
]
14+
Creating command line "cl.exe @"C:\DOCUME~1\MATOV~1.DE-\LOCALS~1\Temp\RSP15E.tmp""
15+
Creating temporary file "C:\DOCUME~1\MATOV~1.DE-\LOCALS~1\Temp\RSP15F.tmp" with contents
16+
[
17+
/nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/bmp3.pch" /Yc"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
18+
"E:\bmp3\StdAfx.cpp"
19+
]
20+
Creating command line "cl.exe @"C:\DOCUME~1\MATOV~1.DE-\LOCALS~1\Temp\RSP15F.tmp""
21+
Creating temporary file "C:\DOCUME~1\MATOV~1.DE-\LOCALS~1\Temp\RSP160.tmp" with contents
22+
[
23+
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sdl.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/bmp3.pdb" /debug /machine:I386 /nodefaultlib:"library" /out:"Debug/bmp3.exe" /pdbtype:sept
24+
.\Debug\bmp3.obj
25+
.\Debug\StdAfx.obj
26+
"..\SDL-devel-1.2.3-VC6\SDL-1.2.3\lib\SDL.lib"
27+
"..\SDL-devel-1.2.3-VC6\SDL-1.2.3\lib\SDLmain.lib"
28+
]
29+
Creating command line "link.exe @"C:\DOCUME~1\MATOV~1.DE-\LOCALS~1\Temp\RSP160.tmp""
30+
<h3>Output Window</h3>
31+
Compiling...
32+
StdAfx.cpp
33+
Compiling...
34+
bmp3.cpp
35+
E:\bmp3\bmp3.cpp(39) : warning C4101: 'p_inputImg' : unreferenced local variable
36+
E:\bmp3\bmp3.cpp(41) : warning C4101: 'imgWidth' : unreferenced local variable
37+
E:\bmp3\bmp3.cpp(41) : warning C4101: 'imgHeight' : unreferenced local variable
38+
E:\bmp3\bmp3.cpp(40) : warning C4101: 'p_outputImg' : unreferenced local variable
39+
Linking...
40+
41+
42+
43+
<h3>Results</h3>
44+
bmp3.exe - 0 error(s), 4 warning(s)
45+
</pre>
46+
</body>
47+
</html>

bmp3/bmp3.suo

4 KB
Binary file not shown.

bmp3/img1.bmp

94.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)