Changeset 29783
- Timestamp:
- Nov 16, 2010, 10:21:30 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101103/Ohana/src/kapa2
- Files:
-
- 6 edited
-
include/prototypes.h (modified) (4 diffs)
-
src/ButtonFunctions.c (modified) (1 diff)
-
src/CheckPipe.c (modified) (2 diffs)
-
src/Image.c (modified) (1 diff)
-
src/JPEGit24.c (modified) (3 diffs)
-
src/PNGit.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/Ohana/src/kapa2/include/prototypes.h
r29539 r29783 46 46 /* EventLoop */ 47 47 int PScommand PROTO((int sock)); 48 int PNGcommand PROTO((int sock)); 48 49 int CheckPipe PROTO((void)); 49 50 int Reconfig PROTO((XEvent *event)); … … 52 53 53 54 /* CheckPipe */ 54 int PNGit PROTO(( int sock));55 int PNGit PROTO((char *filename)); 55 56 int PPMit PROTO((int sock)); 56 57 int LoadFrame PROTO((int sock)); … … 212 213 int Overlay3 PROTO((Graphic *graphic, KapaImageWidget *image)); 213 214 int PSfunction PROTO((Graphic *graphic, KapaImageWidget *image)); 215 int PNGfunction PROTO((Graphic *graphic, KapaImageWidget *image)); 216 int JPEGfunction PROTO((Graphic *graphic, KapaImageWidget *image)); 214 217 215 218 /* misc functions */ … … 219 222 int SaveOverlay (int sock); 220 223 int CSaveOverlay (int sock); 221 int JPEGit24 (int sock); 224 int JPEGit24 (char *filename); 225 int JPEGcommand (int sock); 222 226 223 227 int UpdatePointer (Graphic *graphic, XMotionEvent *event); -
branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/ButtonFunctions.c
r29539 r29783 7 7 8 8 status = PSit ("kapa.ps", "default", TRUE, KAPA_PS_NEWPLOT); 9 return (status); 10 } 11 12 int PNGfunction (Graphic *graphic, KapaImageWidget *image) { 13 14 int status; 15 16 status = PNGit ("kapa.png"); 17 return (status); 18 } 19 20 int JPEGfunction (Graphic *graphic, KapaImageWidget *image) { 21 22 int status; 23 24 status = JPEGit24 ("kapa.jpg"); 9 25 return (status); 10 26 } -
branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/CheckPipe.c
r27790 r29783 89 89 90 90 if (!strcmp (word, "PNGF")) { 91 status = PNGit (sock); 92 KiiSendCommand (sock, 4, "DONE"); 93 FINISHED (status); 94 } 95 91 status = PNGcommand (sock); 92 KiiSendCommand (sock, 4, "DONE"); 93 FINISHED (status); 94 } 95 96 if (!strcmp (word, "JPEG")) { 97 status = JPEGcommand (sock); 98 KiiSendCommand (sock, 4, "DONE"); 99 FINISHED (status); 100 } 101 96 102 if (!strcmp (word, "PPMF")) { 97 103 status = PPMit (sock); … … 304 310 } 305 311 306 if (!strcmp (word, "JPEG")) {307 status = JPEGit24 (sock);308 KiiSendCommand (sock, 4, "DONE");309 FINISHED (status);310 }311 312 312 if (!strcmp (word, "CENT")) { 313 313 status = Center (sock); -
branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/Image.c
r29539 r29783 88 88 89 89 InitButtonSize (&image[0].PS_button, PS_width, PS_height, PS_bits); 90 InitButtonFunc (&image[0].PS_button, PSfunction); 90 // InitButtonFunc (&image[0].PS_button, PSfunction); 91 image->PS_button.function_1 = PSfunction; 92 image->PS_button.function_2 = PNGfunction; 93 image->PS_button.function_3 = JPEGfunction; 91 94 92 95 InitButtonSize (&image[0].grey_button, grey_width, grey_height, grey_bits); -
branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/JPEGit24.c
r27601 r29783 8 8 # define WHITE_B 255 9 9 10 int JPEGcommand (int sock) { 11 12 int status; 13 char filename[1024]; 14 15 KiiScanMessage (sock, "%s", filename); 16 status = JPEGit24 (filename); 17 return (status); 18 } 19 10 20 // XXX this currently writes out the jpeg for just the active image 11 int JPEGit24 ( int sock) {21 int JPEGit24 (char *filename) { 12 22 13 23 struct jpeg_compress_struct cinfo; … … 31 41 unsigned short *in_pix, *in_pix_ref; 32 42 unsigned char *pixel1, *pixel2, *pixel3; 33 char filename[1024];34 43 FILE *f; 35 36 /* expect a line telling the number of bytes and a filename */37 KiiScanMessage (sock, "%s", filename);38 44 39 45 graphic = GetGraphic(); … … 199 205 bDrawSetBuffer (buffer); 200 206 for (i = 0; i < NOVERLAYS; i++) { 201 if (image[ i].overlay[i].active) bDrawOverlay (image, i);207 if (image[0].overlay[i].active) bDrawOverlay (image, i); 202 208 } 203 209 -
branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/PNGit.c
r29408 r29783 10 10 int bDrawImage (bDrawBuffer *buffer, Graphic *graphic); 11 11 12 int PNGit (int sock) { 12 int PNGcommand (int sock) { 13 14 int status; 15 char filename[1024]; 16 17 KiiScanMessage (sock, "%s", filename); 18 status = PNGit (filename); 19 return (status); 20 } 21 22 int PNGit (char *filename) { 13 23 14 24 FILE *f; … … 16 26 png_infop info_ptr; 17 27 int status, Npalette; 18 char filename[1024];19 28 bDrawBuffer *buffer = NULL; 20 29 Graphic *graphic = NULL; … … 22 31 23 32 graphic = GetGraphic(); 24 25 /* expect a line telling the number of bytes and a filename */26 KiiScanMessage (sock, "%s", filename);27 33 28 34 f = fopen (filename, "w");
Note:
See TracChangeset
for help on using the changeset viewer.
