aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@eff87b29-5268-4891-90a3-a07138403961>2004-05-17 12:28:58 +0000
committergoodale <goodale@eff87b29-5268-4891-90a3-a07138403961>2004-05-17 12:28:58 +0000
commita179663126cce1ad5bea6377ffe24c213d1c9a5f (patch)
treed47b2576fa6d87b983bf7b0591ba490f8df83399
parent786af723cf6a11453af82727d71b92990ea74664 (diff)
Untabified. Please try to adhere to the Cactus coding guidelines when
modifying or adding files. git-svn-id: http://svn.cactuscode.org/arrangements/CactusIO/IOJpeg/trunk@98 eff87b29-5268-4891-90a3-a07138403961
-rw-r--r--src/JPEG.c64
-rw-r--r--src/Write.c2
2 files changed, 33 insertions, 33 deletions
diff --git a/src/JPEG.c b/src/JPEG.c
index 5d4fdd9..847be54 100644
--- a/src/JPEG.c
+++ b/src/JPEG.c
@@ -34,10 +34,10 @@ jpeg_memory_dest (j_compress_ptr cinfo, JOCTET *buffer,int bufsize);
moving dimension).
*/
int WriteJPEGToFileRGB(int nx, /* width of image in pixels */
- int ny, /* height of the image in pixels */
- void *data, /* buffer containing image data */
- int Quality, /* Integer from 0 to 100 */
- FILE* outfile){ /* name of file to store in */
+ int ny, /* height of the image in pixels */
+ void *data, /* buffer containing image data */
+ int Quality, /* Integer from 0 to 100 */
+ FILE* outfile){ /* name of file to store in */
JpgComp cinfo;
JpgErr jerr;
/* FILE * outfile;*/
@@ -47,11 +47,11 @@ int WriteJPEGToFileRGB(int nx, /* width of image in pixels */
memset (&cinfo,0,sizeof(cinfo));
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);
-
+
/* Setup JPEG */
- cinfo.image_width = nx ; /* image width and height, in pixels */
+ cinfo.image_width = nx ; /* image width and height, in pixels */
cinfo.image_height = ny;
- cinfo.input_components = 3; /* # of color components per pixel=3 RGB */
+ cinfo.input_components = 3; /* # of color components per pixel=3 RGB */
cinfo.in_color_space = JCS_RGB;
/* if ((outfile = fopen(FileName, "wb")) == NULL) {
printf("Cannot open file [%s]\n",FileName);
@@ -80,10 +80,10 @@ int WriteJPEGToFileRGB(int nx, /* width of image in pixels */
/ this defines a new destination manager to store images in memory
/ derived by jdatadst.c */
typedef struct {
- struct jpeg_destination_mgr pub; /* public fields */
- JOCTET *buffer; /* start of buffer */
- int bufsize; /* buffer size */
- int datacount; /* finale data size */
+ struct jpeg_destination_mgr pub; /* public fields */
+ JOCTET *buffer; /* start of buffer */
+ int bufsize; /* buffer size */
+ int datacount; /* finale data size */
} memory_destination_mgr;
typedef memory_destination_mgr *mem_dest_ptr;
@@ -138,10 +138,10 @@ GLOBAL(void)
jpeg_memory_dest (j_compress_ptr cinfo, JOCTET *buffer,int bufsize)
{
mem_dest_ptr dest;
- if (cinfo->dest == NULL) { /* first time for this JPEG object? */
+ if (cinfo->dest == NULL) { /* first time for this JPEG object? */
cinfo->dest = (struct jpeg_destination_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
- sizeof(memory_destination_mgr));
+ sizeof(memory_destination_mgr));
}
dest = (mem_dest_ptr) cinfo->dest;
@@ -162,7 +162,7 @@ of 75, you can get away with an image which is one quarter that
size.
******************************************** */
-int WriteJPEGToMemoryRGB(int nx,int ny, void *data, int Quality, char *memorybuffer,int bufsize){
+int WriteJPEGToMemoryRGB(int nx,int ny, void *data, int Quality, char *memorybuffer,int bufsize){
JpgComp cinfo;
JpgErr jerr;
unsigned char *dataRGB = (unsigned char *)data;
@@ -178,10 +178,10 @@ int WriteJPEGToMemoryRGB(int nx,int ny, void *data, int Quality, char *memorybuf
jpeg_create_compress(&cinfo);
/* Setup JPEG datastructures */
- cinfo.image_width = nx ; /* image width and height, in pixels */
+ cinfo.image_width = nx ; /* image width and height, in pixels */
cinfo.image_height = ny;
- cinfo.input_components = 3; /* # of color components per pixel=3 RGB */
- cinfo.in_color_space = JCS_RGB;
+ cinfo.input_components = 3; /* # of color components per pixel=3 RGB */
+ cinfo.in_color_space = JCS_RGB;
jpgbuff = (JOCTET*)memorybuffer;
/* Setup compression and do it */
@@ -217,21 +217,21 @@ int WriteJPEGToMemoryRGB(int nx,int ny, void *data, int Quality, char *memorybuf
*/
void AutoColorDataSlice(int nx,int ny, /* size of the image x & y */
- const CCTK_REAL *datain, /* 2D slice of data input */
- unsigned char *dataout, /* RGB image data output */
- CCTK_REAL min,CCTK_REAL max, /* range of the entire 3D dataset
- This could be ranged based
- on the values of the slice,
- but then that would be a
- bit untrustworthy. Its
- best to pass in the
- range for the entire
- dataset or a pre-defined
- fixed range. It does
- handle clamping of the
- range. */
- CCTK_REAL bias,
- int rdfac){
+ const CCTK_REAL *datain, /* 2D slice of data input */
+ unsigned char *dataout, /* RGB image data output */
+ CCTK_REAL min,CCTK_REAL max, /* range of the entire 3D dataset
+ This could be ranged based
+ on the values of the slice,
+ but then that would be a
+ bit untrustworthy. Its
+ best to pass in the
+ range for the entire
+ dataset or a pre-defined
+ fixed range. It does
+ handle clamping of the
+ range. */
+ CCTK_REAL bias,
+ int rdfac){
/* Bias allows you to move the spectrum from the Red to the
Blue. A value of 0.5 is the median. So 0.4 biases towards
the Red and 0.6 would bias a little towards the blue.
diff --git a/src/Write.c b/src/Write.c
index 3c9cabe..a4e1612 100644
--- a/src/Write.c
+++ b/src/Write.c
@@ -215,7 +215,7 @@ int IOJpeg_Write (const cGH *GH, CCTK_INT vindex, const char *alias)
@date Thu 18 April 2002
@author Thomas Radke
@desc
- Writes the given hyperslab into a Jpeg output file.
+ Writes the given hyperslab into a Jpeg output file.
@enddesc
@@*/
static void WriteData (const cGH *GH, int vindex, const char *alias, int dim,