Update of /cvsroot/ufraw/ufraw
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15536
Modified Files:
ufraw-gimp.c ufraw.h ufraw_ufraw.c ufraw_writer.c
Log Message:
Get rid of image_type and simplify the code a bit.
Index: ufraw.h
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw.h,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- ufraw.h 26 Sep 2009 01:23:17 -0000 1.120
+++ ufraw.h 29 Sep 2009 01:03:11 -0000 1.121
@@ -252,13 +252,6 @@
long valid;
} ufraw_image_data;
-/* image_data should be phased out and replaced by ufraw_image_data */
-typedef struct {
- image_type *image;
- guint8 *buffer;
- int height, width, depth, rowstride;
-} image_data;
-
typedef struct ufraw_struct {
int status;
char *message;
@@ -269,8 +262,7 @@
float rgb_cam[3][4];
int ConvertShrink;
ufraw_image_data Images[ufraw_phases_num];
- image_data image;
- image_data thumb;
+ ufraw_image_data thumb;
void *raw;
gboolean HaveFilters;
void *unzippedBuf;
@@ -323,7 +315,7 @@
void ufraw_auto_expose(ufraw_data *uf);
void ufraw_auto_black(ufraw_data *uf);
void ufraw_auto_curve(ufraw_data *uf);
-void ufraw_rotate_row(image_data *image, void *pixbuf, double angle,
+void ufraw_rotate_row(ufraw_image_data *image, void *pixbuf, double angle,
int bitDepth, int row, int offset, int width);
void ufraw_rotate_image_buffer(ufraw_image_data *img, double angle);
void ufraw_normalize_rotation(ufraw_data *uf);
Index: ufraw_writer.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_writer.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- ufraw_writer.c 25 Sep 2009 18:55:32 -0000 1.62
+++ ufraw_writer.c 29 Sep 2009 01:03:11 -0000 1.63
@@ -208,16 +208,16 @@
int (*row_writer) (ufraw_data *, void * volatile, void *, int, int, int,
int, int))
{
int row, row0;
- int rowStride = uf->image.width;
- image_type *rawImage = uf->image.image;
+ int rowStride = uf->Images[ufraw_first_phase].width;
+ image_type *rawImage = (image_type *)uf->Images[ufraw_first_phase].buffer;
int byteDepth = (bitDepth+7)/8;
guint8 pixbuf8[width * 3 * byteDepth * DEVELOP_BATCH];
if (uf->conf->rotationAngle != 0) {
// Buffer for unrotated image.
- image_data image;
- image.width = uf->image.width;
- image.height = uf->image.height;
+ ufraw_image_data image;
+ image.width = uf->Images[ufraw_first_phase].width;
+ image.height = uf->Images[ufraw_first_phase].height;
image.depth = 6;
image.rowstride = image.width * image.depth;
image.buffer = g_new(guint8, image.height * image.rowstride);
@@ -374,15 +374,16 @@
}
// TODO: error handling
ufraw_convert_image(uf);
- left = uf->conf->CropX1 * uf->image.width / uf->initialWidth;
- top = uf->conf->CropY1 * uf->image.height / uf->initialHeight;
+ ufraw_image_data *FirstImage = &uf->Images[ufraw_first_phase];
+ left = uf->conf->CropX1 * FirstImage->width / uf->initialWidth;
+ top = uf->conf->CropY1 * FirstImage->height / uf->initialHeight;
volatile int BitDepth = uf->conf->profile[out_profile]
[uf->conf->profileIndex[out_profile]].BitDepth;
if ( BitDepth!=16 ) BitDepth = 8;
width = (uf->conf->CropX2 - uf->conf->CropX1)
- * uf->image.width / uf->initialWidth;
+ * FirstImage->width / uf->initialWidth;
height = (uf->conf->CropY2 - uf->conf->CropY1)
- * uf->image.height / uf->initialHeight;
+ * FirstImage->height / uf->initialHeight;
if ( uf->conf->type==ppm_type && BitDepth==8 ) {
fprintf(out, "P%c\n%d %d\n%d\n",
grayscaleMode ? '5' : '6', width, height, 0xFF);
@@ -651,8 +652,9 @@
int row;
int i;
- image_type *rawImage = uf->image.image;
- int rowStride = uf->image.width;
+ image_type *rawImage =
+ (image_type *)uf->Images[ufraw_first_phase].buffer;
+ int rowStride = uf->Images[ufraw_first_phase].width;
guint16 pixbuf16[3];
for (row=0; row<height; row++) {
Index: ufraw-gimp.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw-gimp.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- ufraw-gimp.c 1 Sep 2009 05:24:50 -0000 1.55
+++ ufraw-gimp.c 29 Sep 2009 01:03:11 -0000 1.56
@@ -330,12 +330,13 @@
} else {
if (ufraw_convert_image(uf)!=UFRAW_SUCCESS)
return UFRAW_ERROR;
+ ufraw_image_data *FirstImage = &uf->Images[ufraw_first_phase];
height = (uf->conf->CropY2 - uf->conf->CropY1)
- * uf->image.height / uf->initialHeight;
+ * FirstImage->height / uf->initialHeight;
width = (uf->conf->CropX2 - uf->conf->CropX1)
- * uf->image.width / uf->initialWidth;
- top = uf->conf->CropY1 * uf->image.height / uf->initialHeight;
- left = uf->conf->CropX1 * uf->image.width / uf->initialWidth;
+ * FirstImage->width / uf->initialWidth;
+ top = uf->conf->CropY1 * FirstImage->height / uf->initialHeight;
+ left = uf->conf->CropX1 * FirstImage->width / uf->initialWidth;
#ifdef UFRAW_CINEPAINT
if ( uf->conf->profile[out_profile]
[uf->conf->profileIndex[out_profile]].BitDepth==16 )
Index: ufraw_ufraw.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_ufraw.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -d -r1.187 -r1.188
--- ufraw_ufraw.c 27 Sep 2009 22:39:39 -0000 1.187
+++ ufraw_ufraw.c 29 Sep 2009 01:03:11 -0000 1.188
@@ -219,7 +219,6 @@
uf->unzippedBufLen = unzippedBufLen;
uf->conf = conf;
g_strlcpy(uf->filename, filename, max_path);
- uf->image.image = NULL;
int i;
for (i=ufraw_first_phase; i<ufraw_phases_num; i++)
uf->Images[i].buffer = NULL;
@@ -644,7 +643,6 @@
// g_free(uf->conf);
g_free(uf->inputExifBuf);
g_free(uf->outputExifBuf);
- g_free(uf->image.image);
int i;
for (i=ufraw_first_phase; i<ufraw_phases_num; i++)
g_free(uf->Images[i].buffer);
@@ -745,10 +743,11 @@
ufraw_convert_image_init(uf);
ufraw_convert_image_first_phase(uf, TRUE);
if (uf->ConvertShrink>1) {
+ ufraw_image_data *FirstImage = &uf->Images[ufraw_first_phase];
dcraw_image_data final;
- final.height = uf->image.height;
- final.width = uf->image.width;
- final.image = uf->image.image;
+ final.height = FirstImage->height;
+ final.width = FirstImage->width;
+ final.image = (image_type *)FirstImage->buffer;
/* Scale threshold according to shrink factor, as the effect of
* neighbouring pixels decays about exponentially with distance. */
float threshold = uf->conf->threshold * exp(-(uf->ConvertShrink/2.0-1));
@@ -935,12 +934,13 @@
* ufraw_convert_image_area() */
int ufraw_convert_image_first_phase(ufraw_data *uf, gboolean lensfix)
{
+ ufraw_image_data *FirstImage = &uf->Images[ufraw_first_phase];
dcraw_data *raw = uf->raw;
// final->image memory will be realloc'd as needed
dcraw_image_data final;
- final.image = uf->image.image;
- final.width = uf->image.width;
- final.height = uf->image.height;
+ final.image = (image_type *)FirstImage->buffer;
+ final.width = FirstImage->width;
+ final.height = FirstImage->height;
dcraw_data *dark = uf->conf->darkframe ? uf->conf->darkframe->raw : NULL;
if ( uf->ConvertShrink>1 || !uf->HaveFilters ) {
@@ -1017,16 +1017,11 @@
(void)lensfix;
#endif /* HAVE_LENSFUN */
- uf->image.image = final.image;
- uf->image.height = final.height;
- uf->image.width = final.width;
-
- ufraw_image_data *FirstImage = &uf->Images[ufraw_first_phase];
- FirstImage->height = uf->image.height;
- FirstImage->width = uf->image.width;
+ FirstImage->height = final.height;
+ FirstImage->width = final.width;
FirstImage->depth = sizeof(dcraw_image_type);
FirstImage->rowstride = FirstImage->width * FirstImage->depth;
- FirstImage->buffer = g_memdup(uf->image.image, FirstImage->height *
FirstImage->rowstride);
+ FirstImage->buffer = (guint8 *)final.image;
FirstImage->valid = 0xffffffff;
return UFRAW_SUCCESS;
@@ -1748,7 +1743,7 @@
}
}
-void ufraw_rotate_row(image_data *image, void *pixbuf, double angle,
+void ufraw_rotate_row(ufraw_image_data *image, void *pixbuf, double angle,
int bitDepth, int row, int offset, int width)
{
int col, ur, uc, i, j, in_image;
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
ufraw-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs