2001-09-24 Lutz M�ller <urc8@rz.uni-karlsruhe.de>

* libgphoto2/jpeg.h:
        * camlibs/polaroid/pdc320.c: Adapt to changes jpeg_* -> gp_jpeg_*
        * libgphoto2/jpeg.h: Kill yet another warning.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2321 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Lutz Mueller
2001-09-24 07:41:37 +00:00
parent 04e39471cf
commit bb851540d5
3 changed files with 29 additions and 18 deletions

View File

@@ -1,3 +1,9 @@
2001-09-24 Lutz Müller <urc8@rz.uni-karlsruhe.de>
* libgphoto2/jpeg.h:
* camlibs/polaroid/pdc320.c: Adapt to changes jpeg_* -> gp_jpeg_*
* libgphoto2/jpeg.h: Kill yet another warning.
2001-09-24 Lutz Müller <urc8@rz.uni-karlsruhe.de>
* libgphoto2/jpeg.[c,h]: Respect the namespace of libjpeg. Otherwise,

View File

@@ -28,6 +28,7 @@
#include <gphoto2-library.h>
#include <gphoto2-core.h>
#include <gphoto2-debug.h>
#include <stdlib.h>
#include <string.h>
//#include "jpeghead.h"
@@ -310,11 +311,11 @@ static int
camera_file_get (Camera *camera, const char *folder, const char *filename,
CameraFileType type, CameraFile *file)
{
jpeg *myjpeg;
chunk *tempchunk;
jpeg *myjpeg;
chunk *tempchunk;
int n, size;
unsigned char *data;
unsigned char *temp;
unsigned char *data;
unsigned char *temp;
if ((type != GP_FILE_TYPE_RAW) && (type != GP_FILE_TYPE_NORMAL))
return (GP_ERROR_NOT_SUPPORTED);
@@ -330,22 +331,27 @@ camera_file_get (Camera *camera, const char *folder, const char *filename,
/* Get the file */
gp_debug_printf (GP_DEBUG_LOW, "pdc320", "Getting file %i...", n);
CHECK_RESULT (pdc320_pic (camera, n, &data, &size));
if (type == GP_FILE_TYPE_RAW) {
CHECK_RESULT (gp_file_set_data_and_size (file, data, size));
CHECK_RESULT (gp_file_set_name (file, filename));
CHECK_RESULT (gp_file_set_mime_type (file, GP_MIME_RAW));
} else {
/* Post-processing */
switch (type) {
case GP_FILE_TYPE_RAW:
CHECK_RESULT (gp_file_set_data_and_size (file, data, size));
CHECK_RESULT (gp_file_set_name (file, filename));
CHECK_RESULT (gp_file_set_mime_type (file, GP_MIME_RAW));
break;
case GP_FILE_TYPE_NORMAL:
default:
if (camera->model[9]=='6')
myjpeg = jpeg_header(640,240, 11,11,21, 1,0,0, &chrominance, &luminance,
myjpeg = gp_jpeg_header(640,240, 11,11,21, 1,0,0, &chrominance, &luminance,
0,0,0, chunk_new_filled(HUFF_00), chunk_new_filled(HUFF_10), NULL, NULL);
else if (camera->model[9]=='F')
myjpeg = jpeg_header(320,120, 11,11,21, 1,0,0, &chrominance, &luminance,
myjpeg = gp_jpeg_header(320,120, 11,11,21, 1,0,0, &chrominance, &luminance,
0,0,0, chunk_new_filled(HUFF_00), chunk_new_filled(HUFF_10), NULL, NULL);
tempchunk = chunk_new(size);
tempchunk->data = data;
jpeg_add_marker(myjpeg, tempchunk, 6, size-1);
write_jpeg(file, filename, myjpeg);
jpeg_destroy(myjpeg);
gp_jpeg_add_marker(myjpeg, tempchunk, 6, size-1);
gp_jpeg_write(file, filename, myjpeg);
gp_jpeg_destroy(myjpeg);
/* Here is the old code */
/* temp=data;
temp+=6;
@@ -428,7 +434,6 @@ camera_summary (Camera *camera, CameraText *summary)
int
camera_init (Camera *camera)
{
int result;
gp_port_settings settings;
/* First, set up all the function pointers */

View File

@@ -19,13 +19,13 @@
#ifndef __GPHOTO2_JPEG_H__
#define __GPHOTO2_JPEG_H__
enum jpegmarker {
typedef enum {
JPEG_START=0xD8, JPEG_COMMENT=0xFE, JPEG_APPO=0xE0,
JPEG_QUANTIZATION=0xDB, JPEG_HUFFMAN=0xC4, JPEG_SOFC0=0xC0,
JPEG_SSSEAHAL=0xDA, JPEG_EOI=0xD9
};
} jpegmarker;
const JPEG_MARKERS[] = {
const jpegmarker JPEG_MARKERS[] = {
JPEG_START, JPEG_COMMENT, JPEG_APPO,
JPEG_QUANTIZATION, JPEG_HUFFMAN, JPEG_SOFC0,
JPEG_SSSEAHAL, JPEG_EOI