libDXF 0.0.1
A library with DXF related functions written in C.

image.c

Go to the documentation of this file.
00001 
00048 #include "image.h"
00049 
00050 
00059 DxfImage *
00060 dxf_image_new ()
00061 {
00062 #if DEBUG
00063         DXF_DEBUG_BEGIN
00064 #endif
00065         DxfImage *image = NULL;
00066         size_t size;
00067 
00068         size = sizeof (DxfImage);
00069         /* avoid malloc of 0 bytes */
00070         if (size == 0) size = 1;
00071         if ((image = malloc (size)) == NULL)
00072         {
00073                 fprintf (stderr,
00074                   (_("Error in %s () could not allocate memory for a DxfImage struct.\n")),
00075                   __FUNCTION__);
00076                 image = NULL;
00077         }
00078         else
00079         {
00080                 memset (image, 0, size);
00081         }
00082 #if DEBUG
00083         DXF_DEBUG_END
00084 #endif
00085         return (image);
00086 }
00087 
00088 
00096 DxfImage *
00097 dxf_image_init
00098 (
00099         DxfImage *image
00101 )
00102 {
00103 #if DEBUG
00104         DXF_DEBUG_BEGIN
00105 #endif
00106         /* Do some basic checks. */
00107         if (image == NULL)
00108         {
00109                 fprintf (stderr,
00110                   (_("Warning in %s () a NULL pointer was passed.\n")),
00111                   __FUNCTION__);
00112                 image = dxf_image_new ();
00113         }
00114         if (image == NULL)
00115         {
00116               fprintf (stderr,
00117                 (_("Error in %s () could not allocate memory for a DxfImage struct.\n")),
00118                 __FUNCTION__);
00119               return (NULL);
00120         }
00121         dxf_image_set_id_code (image, 0);
00122         dxf_image_set_linetype (image, strdup (DXF_DEFAULT_LINETYPE));
00123         dxf_image_set_layer (image, strdup (DXF_DEFAULT_LAYER));
00124         dxf_image_set_elevation (image, 0.0);
00125         dxf_image_set_thickness (image, 0.0);
00126         dxf_image_set_linetype_scale (image, DXF_DEFAULT_LINETYPE_SCALE);
00127         dxf_image_set_visibility (image, DXF_DEFAULT_VISIBILITY);
00128         dxf_image_set_color (image, DXF_COLOR_BYLAYER);
00129         dxf_image_set_paperspace (image, DXF_MODELSPACE);
00130         dxf_image_set_graphics_data_size (image, 0);
00131         dxf_image_set_shadow_mode (image, 0);
00132         dxf_image_set_binary_graphics_data (image, (DxfBinaryGraphicsData *) dxf_binary_graphics_data_new ());
00133         dxf_binary_graphics_data_init ((DxfBinaryGraphicsData *) dxf_image_get_binary_graphics_data (image));
00134         dxf_image_set_dictionary_owner_soft (image, strdup (""));
00135         dxf_image_set_material (image, strdup (""));
00136         dxf_image_set_dictionary_owner_hard (image, strdup (""));
00137         dxf_image_set_lineweight (image, 0);
00138         dxf_image_set_plot_style_name (image, strdup (""));
00139         dxf_image_set_color_value (image, 0);
00140         dxf_image_set_color_name (image, strdup (""));
00141         dxf_image_set_transparency (image, 0);
00142         dxf_image_set_p0 (image, (DxfPoint *) dxf_point_new ());
00143         dxf_point_init ((DxfPoint *) dxf_image_get_p0 (image));
00144         dxf_image_set_p1 (image, (DxfPoint *) dxf_point_new ());
00145         dxf_point_init ((DxfPoint *) dxf_image_get_p1 (image));
00146         dxf_image_set_p2 (image, (DxfPoint *) dxf_point_new ());
00147         dxf_point_init ((DxfPoint *) dxf_image_get_p2 (image));
00148         dxf_image_set_p3 (image, (DxfPoint *) dxf_point_new ());
00149         dxf_point_init ((DxfPoint *) dxf_image_get_p3 (image));
00150         dxf_image_set_p4 (image, (DxfPoint *) dxf_point_new ());
00151         dxf_point_init ((DxfPoint *) dxf_image_get_p4 (image));
00152         dxf_image_set_image_display_properties (image, 0);
00153         dxf_image_set_clipping_boundary_type (image, 0);
00154         dxf_image_set_class_version (image, 0);
00155         dxf_image_set_number_of_clip_boundary_vertices (image, 0);
00156         dxf_image_set_clipping_state (image, 0);
00157         dxf_image_set_brightness (image, 50);
00158         dxf_image_set_contrast (image, 50);
00159         dxf_image_set_fade (image, 50);
00160         dxf_image_set_imagedef_object (image, strdup (""));
00161         dxf_image_set_imagedef_reactor_object (image, strdup (""));
00162         dxf_image_set_next (image, NULL);
00163 #if DEBUG
00164         DXF_DEBUG_END
00165 #endif
00166         return (image);
00167 }
00168 
00169 
00181 DxfImage *
00182 dxf_image_read
00183 (
00184         DxfFile *fp,
00186         DxfImage *image
00188 )
00189 {
00190 #if DEBUG
00191         DXF_DEBUG_BEGIN
00192 #endif
00193         char *temp_string = NULL;
00194         DxfPoint *iter = NULL;
00195         int next_x4;
00196 
00197         /* Do some basic checks. */
00198         if (fp == NULL)
00199         {
00200                 fprintf (stderr,
00201                   (_("Error in %s () a NULL file pointer was passed.\n")),
00202                   __FUNCTION__);
00203                 /* Clean up. */
00204                 free (temp_string);
00205                 return (NULL);
00206         }
00207         if (image == NULL)
00208         {
00209                 fprintf (stderr,
00210                   (_("Warning in %s () a NULL pointer was passed.\n")),
00211                   __FUNCTION__);
00212                 image = dxf_image_new ();
00213                 image = dxf_image_init (image);
00214         }
00215         iter = (DxfPoint *) image->p4;
00216         next_x4 = 0;
00217         (fp->line_number)++;
00218         fscanf (fp->fp, "%[^\n]", temp_string);
00219         while (strcmp (temp_string, "0") != 0)
00220         {
00221                 if (ferror (fp->fp))
00222                 {
00223                         fprintf (stderr,
00224                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00225                           __FUNCTION__, fp->filename, fp->line_number);
00226                         fclose (fp->fp);
00227                         /* Clean up. */
00228                         free (temp_string);
00229                         return (NULL);
00230                 }
00231                 if (strcmp (temp_string, "5") == 0)
00232                 {
00233                         /* Now follows a string containing a sequential
00234                          * id number. */
00235                         (fp->line_number)++;
00236                         fscanf (fp->fp, "%x\n", &image->id_code);
00237                 }
00238                 else if (strcmp (temp_string, "6") == 0)
00239                 {
00240                         /* Now follows a string containing a linetype
00241                          * name. */
00242                         (fp->line_number)++;
00243                         fscanf (fp->fp, "%s\n", image->linetype);
00244                 }
00245                 else if (strcmp (temp_string, "8") == 0)
00246                 {
00247                         /* Now follows a string containing a layer name. */
00248                         (fp->line_number)++;
00249                         fscanf (fp->fp, "%s\n", image->layer);
00250                 }
00251                 else if (strcmp (temp_string, "10") == 0)
00252                 {
00253                         /* Now follows a string containing the
00254                          * X-value of the insertion point coordinate. */
00255                         (fp->line_number)++;
00256                         fscanf (fp->fp, "%lf\n", &image->p0->x0);
00257                 }
00258                 else if (strcmp (temp_string, "20") == 0)
00259                 {
00260                         /* Now follows a string containing the
00261                          * Y-value of the insertion point coordinate. */
00262                         (fp->line_number)++;
00263                         fscanf (fp->fp, "%lf\n", &image->p0->y0);
00264                 }
00265                 else if (strcmp (temp_string, "30") == 0)
00266                 {
00267                         /* Now follows a string containing the
00268                          * Z-value of the insertion point coordinate. */
00269                         (fp->line_number)++;
00270                         fscanf (fp->fp, "%lf\n", &image->p0->z0);
00271                 }
00272                 else if (strcmp (temp_string, "11") == 0)
00273                 {
00274                         /* Now follows a string containing the
00275                          * X-value of the U-vector of a single pixel. */
00276                         (fp->line_number)++;
00277                         fscanf (fp->fp, "%lf\n", &image->p1->x0);
00278                 }
00279                 else if (strcmp (temp_string, "21") == 0)
00280                 {
00281                         /* Now follows a string containing the
00282                          * Y-value of the U-vector of a single pixel. */
00283                         (fp->line_number)++;
00284                         fscanf (fp->fp, "%lf\n", &image->p1->y0);
00285                 }
00286                 else if (strcmp (temp_string, "31") == 0)
00287                 {
00288                         /* Now follows a string containing the
00289                          * Z-value of the U-vector of a single pixel. */
00290                         (fp->line_number)++;
00291                         fscanf (fp->fp, "%lf\n", &image->p1->z0);
00292                 }
00293                 else if (strcmp (temp_string, "12") == 0)
00294                 {
00295                         /* Now follows a string containing the
00296                          * X-value of the V-vector of a single pixel. */
00297                         (fp->line_number)++;
00298                         fscanf (fp->fp, "%lf\n", &image->p2->x0);
00299                 }
00300                 else if (strcmp (temp_string, "22") == 0)
00301                 {
00302                         /* Now follows a string containing the
00303                          * Y-value of the V-vector of a single pixel. */
00304                         (fp->line_number)++;
00305                         fscanf (fp->fp, "%lf\n", &image->p2->y0);
00306                 }
00307                 else if (strcmp (temp_string, "32") == 0)
00308                 {
00309                         /* Now follows a string containing the
00310                          * Z-value of the V-vector of a single pixel. */
00311                         (fp->line_number)++;
00312                         fscanf (fp->fp, "%lf\n", &image->p2->z0);
00313                 }
00314                 else if (strcmp (temp_string, "13") == 0)
00315                 {
00316                         /* Now follows a string containing the
00317                          * U-value of image size in pixels. */
00318                         (fp->line_number)++;
00319                         fscanf (fp->fp, "%lf\n", &image->p3->x0);
00320                 }
00321                 else if (strcmp (temp_string, "23") == 0)
00322                 {
00323                         /* Now follows a string containing the
00324                          * V-value of image size in pixels. */
00325                         (fp->line_number)++;
00326                         fscanf (fp->fp, "%lf\n", &image->p3->y0);
00327                 }
00328                 else if (strcmp (temp_string, "14") == 0)
00329                 {
00330                         /* Now follows a string containing the
00331                          * X-value of a clip boundary vertex. */
00332                         (fp->line_number)++;
00333                         if (next_x4)
00334                         {
00335                                 iter->next = (struct DxfPoint *) dxf_point_new ();
00336                                 iter->next = (struct DxfPoint *) dxf_point_init ((DxfPoint *) iter->next);
00337                                 iter = (DxfPoint *) iter->next;
00338                                 next_x4 = 0;
00339                         }
00340                         fscanf (fp->fp, "%lf\n", &iter->x0);
00341                 }
00342                 else if (strcmp (temp_string, "24") == 0)
00343                 {
00344                         /* Now follows a string containing the
00345                          * Y-value of a clip boundary vertex. */
00346                         (fp->line_number)++;
00347                         fscanf (fp->fp, "%lf\n", &iter->y0);
00348                         next_x4 = 1;
00349                 }
00350                 else if ((fp->acad_version_number <= AutoCAD_11)
00351                         && (strcmp (temp_string, "38") == 0)
00352                         && (image->elevation != 0.0))
00353                 {
00354                         /* Now follows a string containing the
00355                          * elevation. */
00356                         (fp->line_number)++;
00357                         fscanf (fp->fp, "%lf\n", &image->elevation);
00358                 }
00359                 else if (strcmp (temp_string, "39") == 0)
00360                 {
00361                         /* Now follows a string containing the
00362                          * thickness. */
00363                         (fp->line_number)++;
00364                         fscanf (fp->fp, "%lf\n", &image->thickness);
00365                 }
00366                 else if (strcmp (temp_string, "48") == 0)
00367                 {
00368                         /* Now follows a string containing the linetype
00369                          * scale. */
00370                         (fp->line_number)++;
00371                         fscanf (fp->fp, "%lf\n", &image->linetype_scale);
00372                 }
00373                 else if (strcmp (temp_string, "60") == 0)
00374                 {
00375                         /* Now follows a string containing the
00376                          * visibility value. */
00377                         (fp->line_number)++;
00378                         fscanf (fp->fp, "%hd\n", &image->visibility);
00379                 }
00380                 else if (strcmp (temp_string, "62") == 0)
00381                 {
00382                         /* Now follows a string containing the
00383                          * color value. */
00384                         (fp->line_number)++;
00385                         fscanf (fp->fp, "%d\n", &image->color);
00386                 }
00387                 else if (strcmp (temp_string, "67") == 0)
00388                 {
00389                         /* Now follows a string containing the
00390                          * paperspace value. */
00391                         (fp->line_number)++;
00392                         fscanf (fp->fp, "%d\n", &image->paperspace);
00393                 }
00394                 else if (strcmp (temp_string, "70") == 0)
00395                 {
00396                         /* Now follows a string containing the
00397                          * image display properties. */
00398                         (fp->line_number)++;
00399                         fscanf (fp->fp, "%d\n", &image->image_display_properties);
00400                 }
00401                 else if (strcmp (temp_string, "71") == 0)
00402                 {
00403                         /* Now follows a string containing the
00404                          * clipping boundary type. */
00405                         (fp->line_number)++;
00406                         fscanf (fp->fp, "%d\n", &image->clipping_boundary_type);
00407                 }
00408                 else if (strcmp (temp_string, "90") == 0)
00409                 {
00410                         /* Now follows a string containing the class
00411                          * version. */
00412                         (fp->line_number)++;
00413                         fscanf (fp->fp, "%ld\n", &image->class_version);
00414                 }
00415                 else if (strcmp (temp_string, "91") == 0)
00416                 {
00417                         /* Now follows a string containing the number of
00418                          * clip boundary vertices. */
00419                         (fp->line_number)++;
00420                         fscanf (fp->fp, "%ld\n", &image->number_of_clip_boundary_vertices);
00421                 }
00422                 else if ((fp->acad_version_number >= AutoCAD_13)
00423                         && (strcmp (temp_string, "100") == 0))
00424                 {
00425                         /* Now follows a string containing the
00426                          * subclass marker value. */
00427                         (fp->line_number)++;
00428                         fscanf (fp->fp, "%s\n", temp_string);
00429                         if ((strcmp (temp_string, "AcDbEntity") != 0)
00430                         && ((strcmp (temp_string, "AcDbRasterImage") != 0)))
00431                         {
00432                                 fprintf (stderr,
00433                                   (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")),
00434                                   __FUNCTION__, fp->filename, fp->line_number);
00435                         }
00436                 }
00437                 else if (strcmp (temp_string, "280") == 0)
00438                 {
00439                         /* Now follows a string containing the clipping
00440                          * state. */
00441                         (fp->line_number)++;
00442                         fscanf (fp->fp, "%d\n", &image->clipping_state);
00443                 }
00444                 else if (strcmp (temp_string, "281") == 0)
00445                 {
00446                         /* Now follows a string containing the
00447                          * brightness value. */
00448                         (fp->line_number)++;
00449                         fscanf (fp->fp, "%d\n", &image->brightness);
00450                 }
00451                 else if (strcmp (temp_string, "282") == 0)
00452                 {
00453                         /* Now follows a string containing the contrast
00454                          * value. */
00455                         (fp->line_number)++;
00456                         fscanf (fp->fp, "%d\n", &image->contrast);
00457                 }
00458                 else if (strcmp (temp_string, "283") == 0)
00459                 {
00460                         /* Now follows a string containing the fade
00461                          * value. */
00462                         (fp->line_number)++;
00463                         fscanf (fp->fp, "%d\n", &image->fade);
00464                 }
00465                 else if (strcmp (temp_string, "330") == 0)
00466                 {
00467                         /* Now follows a string containing Soft-pointer
00468                          * ID/handle to owner dictionary. */
00469                         (fp->line_number)++;
00470                         fscanf (fp->fp, "%s\n", image->dictionary_owner_soft);
00471                 }
00472                 else if (strcmp (temp_string, "340") == 0)
00473                 {
00474                         /* Now follows a string containing a hard
00475                          * reference to imagedef object. */
00476                         (fp->line_number)++;
00477                         fscanf (fp->fp, "%s\n", image->imagedef_object);
00478                 }
00479                 else if (strcmp (temp_string, "360") == 0)
00480                 {
00481                         /* Now follows a string containing a hard
00482                          * reference to imagedef_reactor object. */
00483                         (fp->line_number)++;
00484                         fscanf (fp->fp, "%s\n", image->imagedef_reactor_object);
00485                 }
00486                 else if (strcmp (temp_string, "999") == 0)
00487                 {
00488                         /* Now follows a string containing a comment. */
00489                         (fp->line_number)++;
00490                         fscanf (fp->fp, "%s\n", temp_string);
00491                         fprintf (stdout, "DXF comment: %s\n", temp_string);
00492                 }
00493                 else
00494                 {
00495                         fprintf (stderr,
00496                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00497                           __FUNCTION__, fp->filename, fp->line_number);
00498                 }
00499         }
00500         /* Handle omitted members and/or illegal values. */
00501         if (strcmp (image->linetype, "") == 0)
00502         {
00503                 image->linetype = strdup (DXF_DEFAULT_LINETYPE);
00504         }
00505         if (strcmp (image->layer, "") == 0)
00506         {
00507                 image->layer = strdup (DXF_DEFAULT_LAYER);
00508         }
00509         /* Clean up. */
00510         free (temp_string);
00511 #if DEBUG
00512         DXF_DEBUG_END
00513 #endif
00514         return (image);
00515 }
00516 
00517 
00524 int
00525 dxf_image_write
00526 (
00527         DxfFile *fp,
00529         DxfImage *image
00531 )
00532 {
00533 #if DEBUG
00534         DXF_DEBUG_BEGIN
00535 #endif
00536         char *dxf_entity_name = strdup ("IMAGE");
00537         DxfPoint *iter = NULL;
00538 
00539         /* Do some basic checks. */
00540         if (fp == NULL)
00541         {
00542                 fprintf (stderr,
00543                   (_("Error in %s () a NULL file pointer was passed.\n")),
00544                   __FUNCTION__);
00545                 /* Clean up. */
00546                 free (dxf_entity_name);
00547                 return (EXIT_FAILURE);
00548         }
00549         if (image == NULL)
00550         {
00551                 fprintf (stderr,
00552                   (_("Error in %s () a NULL pointer was passed.\n")),
00553                   __FUNCTION__);
00554                 /* Clean up. */
00555                 free (dxf_entity_name);
00556                 return (EXIT_FAILURE);
00557         }
00558         if (fp->acad_version_number < AutoCAD_14)
00559         {
00560                 fprintf (stderr,
00561                   (_("Warning in %s () illegal DXF version for this entity.\n")),
00562                   __FUNCTION__);
00563         }
00564         if (strcmp (dxf_image_get_linetype (image), "") == 0)
00565         {
00566                 fprintf (stderr,
00567                   (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")),
00568                   __FUNCTION__, dxf_entity_name, dxf_image_get_id_code (image));
00569                 fprintf (stderr,
00570                   (_("\t%s entity is reset to default linetype")),
00571                   dxf_entity_name);
00572                 dxf_image_set_linetype (image, strdup (DXF_DEFAULT_LINETYPE));
00573         }
00574         if (strcmp (dxf_image_get_layer (image), "") == 0)
00575         {
00576                 fprintf (stderr,
00577                   (_("Warning in %s () empty layer string for the %s entity with id-code: %x.\n")),
00578                   __FUNCTION__, dxf_entity_name, dxf_image_get_id_code (image));
00579                 fprintf (stderr,
00580                   (_("\t%s entity is relocated to default layer.\n")),
00581                   dxf_entity_name);
00582                 dxf_image_set_layer (image, DXF_DEFAULT_LAYER);
00583         }
00584         /* Start writing output. */
00585         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00586         if (dxf_image_get_id_code (image) != -1)
00587         {
00588                 fprintf (fp->fp, "  5\n%x\n", dxf_image_get_id_code (image));
00589         }
00600         if ((strcmp (dxf_image_get_dictionary_owner_soft (image), "") != 0)
00601           && (fp->acad_version_number >= AutoCAD_14))
00602         {
00603                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00604                 fprintf (fp->fp, "330\n%s\n", dxf_image_get_dictionary_owner_soft (image));
00605                 fprintf (fp->fp, "102\n}\n");
00606         }
00607         if ((strcmp (dxf_image_get_dictionary_owner_hard (image), "") != 0)
00608           && (fp->acad_version_number >= AutoCAD_14))
00609         {
00610                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00611                 fprintf (fp->fp, "360\n%s\n", dxf_image_get_dictionary_owner_hard (image));
00612                 fprintf (fp->fp, "102\n}\n");
00613         }
00614         if (fp->acad_version_number >= AutoCAD_13)
00615         {
00616                 fprintf (fp->fp, "100\nAcDbEntity\n");
00617         }
00618         if (dxf_image_get_paperspace (image) == DXF_PAPERSPACE)
00619         {
00620                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00621         }
00622         fprintf (fp->fp, "  8\n%s\n", dxf_image_get_layer (image));
00623         if (strcmp (dxf_image_get_linetype (image), DXF_DEFAULT_LINETYPE) != 0)
00624         {
00625                 fprintf (fp->fp, "  6\n%s\n", dxf_image_get_linetype (image));
00626         }
00627         if ((fp->acad_version_number <= AutoCAD_11)
00628           && DXF_FLATLAND
00629           && (dxf_image_get_elevation (image) != 0.0))
00630         {
00631                 fprintf (fp->fp, " 38\n%f\n", dxf_image_get_elevation (image));
00632         }
00633         if (dxf_image_get_color (image) != DXF_COLOR_BYLAYER)
00634         {
00635                 fprintf (fp->fp, " 62\n%d\n", dxf_image_get_color (image));
00636         }
00637         if (dxf_image_get_linetype_scale (image) != 1.0)
00638         {
00639                 fprintf (fp->fp, " 48\n%f\n", dxf_image_get_linetype_scale (image));
00640         }
00641         if (dxf_image_get_visibility (image) != 0)
00642         {
00643                 fprintf (fp->fp, " 60\n%d\n", dxf_image_get_visibility (image));
00644         }
00645         if (fp->acad_version_number >= AutoCAD_13)
00646         {
00647                 fprintf (fp->fp, "100\nAcDbRasterImage\n");
00648         }
00649         if (dxf_image_get_thickness (image) != 0.0)
00650         {
00651                 fprintf (fp->fp, " 39\n%f\n", dxf_image_get_thickness (image));
00652         }
00653         fprintf (fp->fp, " 90\n%ld\n", dxf_image_get_class_version (image));
00654         fprintf (fp->fp, " 10\n%f\n", dxf_image_get_x0 (image));
00655         fprintf (fp->fp, " 20\n%f\n", dxf_image_get_y0 (image));
00656         fprintf (fp->fp, " 30\n%f\n", dxf_image_get_z0 (image));
00657         fprintf (fp->fp, " 11\n%f\n", dxf_image_get_x1 (image));
00658         fprintf (fp->fp, " 21\n%f\n", dxf_image_get_y1 (image));
00659         fprintf (fp->fp, " 31\n%f\n", dxf_image_get_z1 (image));
00660         fprintf (fp->fp, " 12\n%f\n", dxf_image_get_x2 (image));
00661         fprintf (fp->fp, " 22\n%f\n", dxf_image_get_y2 (image));
00662         fprintf (fp->fp, " 32\n%f\n", dxf_image_get_z2 (image));
00663         fprintf (fp->fp, " 13\n%f\n", dxf_image_get_x3 (image));
00664         fprintf (fp->fp, " 23\n%f\n", dxf_image_get_y3 (image));
00665         fprintf (fp->fp, "340\n%s\n", dxf_image_get_imagedef_object (image));
00666         fprintf (fp->fp, " 70\n%d\n", dxf_image_get_image_display_properties (image));
00667         fprintf (fp->fp, "280\n%d\n", dxf_image_get_clipping_state (image));
00668         fprintf (fp->fp, "281\n%d\n", dxf_image_get_brightness (image));
00669         fprintf (fp->fp, "282\n%d\n", dxf_image_get_contrast (image));
00670         fprintf (fp->fp, "283\n%d\n", dxf_image_get_fade (image));
00671         fprintf (fp->fp, "360\n%s\n", dxf_image_get_imagedef_reactor_object (image));
00672         fprintf (fp->fp, " 71\n%d\n", dxf_image_get_clipping_boundary_type (image));
00673         fprintf (fp->fp, " 91\n%ld\n", dxf_image_get_number_of_clip_boundary_vertices (image));
00674         /* Now follows a sinle linked list of points (vertices).
00675          * We do not keep track of the number of points (vertices),
00676          * we just traverse down until the first NULL pointer is found.  */
00677         iter = (DxfPoint *) dxf_image_get_p4 (image);
00678         while (iter != NULL)
00679         {
00680                 fprintf (fp->fp, " 14\n%f\n", iter->x0);
00681                 fprintf (fp->fp, " 24\n%f\n", iter->y0);
00682                 iter = (DxfPoint *) iter->next;
00683         }
00684         /* Clean up. */
00685         free (dxf_entity_name);
00686 #if DEBUG
00687         DXF_DEBUG_END
00688 #endif
00689         return (EXIT_SUCCESS);
00690 }
00691 
00692 
00700 int
00701 dxf_image_free
00702 (
00703         DxfImage *image
00706 )
00707 {
00708 #if DEBUG
00709         DXF_DEBUG_BEGIN
00710 #endif
00711         /* Do some basic checks. */
00712         if (image == NULL)
00713         {
00714                 fprintf (stderr,
00715                   (_("Error in %s () a NULL pointer was passed.\n")),
00716                   __FUNCTION__);
00717                 return (EXIT_FAILURE);
00718         }
00719         if (image->next != NULL)
00720         {
00721                 fprintf (stderr,
00722                   (_("Error in %s () pointer to next was not NULL.\n")),
00723                   __FUNCTION__);
00724                 return (EXIT_FAILURE);
00725         }
00726         free (dxf_image_get_linetype (image));
00727         free (dxf_image_get_layer (image));
00728         dxf_binary_graphics_data_free_chain (dxf_image_get_binary_graphics_data (image));
00729         free (dxf_image_get_dictionary_owner_soft (image));
00730         free (dxf_image_get_material (image));
00731         free (dxf_image_get_dictionary_owner_hard (image));
00732         free (dxf_image_get_plot_style_name (image));
00733         free (dxf_image_get_color_name (image));
00734         dxf_point_free (dxf_image_get_p0 (image));
00735         dxf_point_free (dxf_image_get_p1 (image));
00736         dxf_point_free (dxf_image_get_p2 (image));
00737         dxf_point_free (dxf_image_get_p3 (image));
00738         dxf_point_free_chain (dxf_image_get_p4 (image));
00739         free (dxf_image_get_imagedef_object (image));
00740         free (dxf_image_get_imagedef_reactor_object (image));
00741         free (image);
00742         image = NULL;
00743 #if DEBUG
00744         DXF_DEBUG_END
00745 #endif
00746         return (EXIT_SUCCESS);
00747 }
00748 
00749 
00754 void
00755 dxf_image_free_chain
00756 (
00757         DxfImage *images
00759 )
00760 {
00761 #ifdef DEBUG
00762         DXF_DEBUG_BEGIN
00763 #endif
00764         if (images == NULL)
00765         {
00766                 fprintf (stderr,
00767                   (_("Warning in %s () a NULL pointer was passed.\n")),
00768                   __FUNCTION__);
00769         }
00770         while (images != NULL)
00771         {
00772                 struct DxfImage *iter = images->next;
00773                 dxf_image_free (images);
00774                 images = (DxfImage *) iter;
00775         }
00776 #if DEBUG
00777         DXF_DEBUG_END
00778 #endif
00779 }
00780 
00781 
00788 int
00789 dxf_image_get_id_code
00790 (
00791         DxfImage *image
00793 )
00794 {
00795 #if DEBUG
00796         DXF_DEBUG_BEGIN
00797 #endif
00798         /* Do some basic checks. */
00799         if (image == NULL)
00800         {
00801                 fprintf (stderr,
00802                   (_("Error in %s () a NULL pointer was passed.\n")),
00803                   __FUNCTION__);
00804                 return (EXIT_FAILURE);
00805         }
00806         if (image->id_code < 0)
00807         {
00808                 fprintf (stderr,
00809                   (_("Error in %s () a negative value was found in the id_code member.\n")),
00810                   __FUNCTION__);
00811                 return (EXIT_FAILURE);
00812         }
00813 #if DEBUG
00814         DXF_DEBUG_END
00815 #endif
00816         return (image->id_code);
00817 }
00818 
00819 
00826 DxfImage *
00827 dxf_image_set_id_code
00828 (
00829         DxfImage *image,
00831         int id_code
00835 )
00836 {
00837 #if DEBUG
00838         DXF_DEBUG_BEGIN
00839 #endif
00840         /* Do some basic checks. */
00841         if (image == NULL)
00842         {
00843                 fprintf (stderr,
00844                   (_("Error in %s () a NULL pointer was passed.\n")),
00845                   __FUNCTION__);
00846                 return (NULL);
00847         }
00848         if (id_code < 0)
00849         {
00850                 fprintf (stderr,
00851                   (_("Error in %s () a negative id-code value was passed.\n")),
00852                   __FUNCTION__);
00853                 return (NULL);
00854         }
00855         image->id_code = id_code;
00856 #if DEBUG
00857         DXF_DEBUG_END
00858 #endif
00859         return (image);
00860 }
00861 
00862 
00868 char *
00869 dxf_image_get_linetype
00870 (
00871         DxfImage *image
00873 )
00874 {
00875 #if DEBUG
00876         DXF_DEBUG_BEGIN
00877 #endif
00878         /* Do some basic checks. */
00879         if (image == NULL)
00880         {
00881                 fprintf (stderr,
00882                   (_("Error in %s () a NULL pointer was passed.\n")),
00883                   __FUNCTION__);
00884                 return (NULL);
00885         }
00886         if (image->linetype ==  NULL)
00887         {
00888                 fprintf (stderr,
00889                   (_("Error in %s () a NULL pointer was found in the linetype member.\n")),
00890                   __FUNCTION__);
00891                 return (NULL);
00892         }
00893 #if DEBUG
00894         DXF_DEBUG_END
00895 #endif
00896         return (strdup (image->linetype));
00897 }
00898 
00899 
00906 DxfImage *
00907 dxf_image_set_linetype
00908 (
00909         DxfImage *image,
00911         char *linetype
00913 )
00914 {
00915 #if DEBUG
00916         DXF_DEBUG_BEGIN
00917 #endif
00918         /* Do some basic checks. */
00919         if (image == NULL)
00920         {
00921                 fprintf (stderr,
00922                   (_("Error in %s () a NULL pointer was passed.\n")),
00923                   __FUNCTION__);
00924                 return (NULL);
00925         }
00926         if (linetype == NULL)
00927         {
00928                 fprintf (stderr,
00929                   (_("Error in %s () a NULL pointer was passed.\n")),
00930                   __FUNCTION__);
00931                 return (NULL);
00932         }
00933         image->linetype = strdup (linetype);
00934 #if DEBUG
00935         DXF_DEBUG_END
00936 #endif
00937         return (image);
00938 }
00939 
00940 
00946 char *
00947 dxf_image_get_layer
00948 (
00949         DxfImage *image
00951 )
00952 {
00953 #if DEBUG
00954         DXF_DEBUG_BEGIN
00955 #endif
00956         /* Do some basic checks. */
00957         if (image == NULL)
00958         {
00959                 fprintf (stderr,
00960                   (_("Error in %s () a NULL pointer was passed.\n")),
00961                   __FUNCTION__);
00962                 return (NULL);
00963         }
00964         if (image->layer ==  NULL)
00965         {
00966                 fprintf (stderr,
00967                   (_("Error in %s () a NULL pointer was found in the layer member.\n")),
00968                   __FUNCTION__);
00969                 return (NULL);
00970         }
00971 #if DEBUG
00972         DXF_DEBUG_END
00973 #endif
00974         return (strdup (image->layer));
00975 }
00976 
00977 
00984 DxfImage *
00985 dxf_image_set_layer
00986 (
00987         DxfImage *image,
00989         char *layer
00991 )
00992 {
00993 #if DEBUG
00994         DXF_DEBUG_BEGIN
00995 #endif
00996         /* Do some basic checks. */
00997         if (image == NULL)
00998         {
00999                 fprintf (stderr,
01000                   (_("Error in %s () a NULL pointer was passed.\n")),
01001                   __FUNCTION__);
01002                 return (NULL);
01003         }
01004         if (layer == NULL)
01005         {
01006                 fprintf (stderr,
01007                   (_("Error in %s () a NULL pointer was passed.\n")),
01008                   __FUNCTION__);
01009                 return (NULL);
01010         }
01011         image->layer = strdup (layer);
01012 #if DEBUG
01013         DXF_DEBUG_END
01014 #endif
01015         return (image);
01016 }
01017 
01018 
01025 double
01026 dxf_image_get_elevation
01027 (
01028         DxfImage *image
01030 )
01031 {
01032 #if DEBUG
01033         DXF_DEBUG_BEGIN
01034 #endif
01035         /* Do some basic checks. */
01036         if (image == NULL)
01037         {
01038                 fprintf (stderr,
01039                   (_("Error in %s () a NULL pointer was passed.\n")),
01040                   __FUNCTION__);
01041                 return (EXIT_FAILURE);
01042         }
01043 #if DEBUG
01044         DXF_DEBUG_END
01045 #endif
01046         return (image->elevation);
01047 }
01048 
01049 
01056 DxfImage *
01057 dxf_image_set_elevation
01058 (
01059         DxfImage *image,
01061         double elevation
01063 )
01064 {
01065 #if DEBUG
01066         DXF_DEBUG_BEGIN
01067 #endif
01068         /* Do some basic checks. */
01069         if (image == NULL)
01070         {
01071                 fprintf (stderr,
01072                   (_("Error in %s () a NULL pointer was passed.\n")),
01073                   __FUNCTION__);
01074                 return (NULL);
01075         }
01076         image->elevation = elevation;
01077 #if DEBUG
01078         DXF_DEBUG_END
01079 #endif
01080         return (image);
01081 }
01082 
01083 
01090 double
01091 dxf_image_get_thickness
01092 (
01093         DxfImage *image
01095 )
01096 {
01097 #if DEBUG
01098         DXF_DEBUG_BEGIN
01099 #endif
01100         /* Do some basic checks. */
01101         if (image == NULL)
01102         {
01103                 fprintf (stderr,
01104                   (_("Error in %s () a NULL pointer was passed.\n")),
01105                   __FUNCTION__);
01106                 return (EXIT_FAILURE);
01107         }
01108         if (image->thickness < 0.0)
01109         {
01110                 fprintf (stderr,
01111                   (_("Warning in %s () a negative value was found in the thickness member.\n")),
01112                   __FUNCTION__);
01113         }
01114 #if DEBUG
01115         DXF_DEBUG_END
01116 #endif
01117         return (image->thickness);
01118 }
01119 
01120 
01127 DxfImage *
01128 dxf_image_set_thickness
01129 (
01130         DxfImage *image,
01132         double thickness
01134 )
01135 {
01136 #if DEBUG
01137         DXF_DEBUG_BEGIN
01138 #endif
01139         /* Do some basic checks. */
01140         if (image == NULL)
01141         {
01142                 fprintf (stderr,
01143                   (_("Error in %s () a NULL pointer was passed.\n")),
01144                   __FUNCTION__);
01145                 return (NULL);
01146         }
01147         if (thickness < 0.0)
01148         {
01149                 fprintf (stderr,
01150                   (_("Warning in %s () a negative thickness value was passed.\n")),
01151                   __FUNCTION__);
01152         }
01153         image->thickness = thickness;
01154 #if DEBUG
01155         DXF_DEBUG_END
01156 #endif
01157         return (image);
01158 }
01159 
01160 
01167 double
01168 dxf_image_get_linetype_scale
01169 (
01170         DxfImage *image
01172 )
01173 {
01174 #if DEBUG
01175         DXF_DEBUG_BEGIN
01176 #endif
01177         /* Do some basic checks. */
01178         if (image == NULL)
01179         {
01180                 fprintf (stderr,
01181                   (_("Error in %s () a NULL pointer was passed.\n")),
01182                   __FUNCTION__);
01183                 return (EXIT_FAILURE);
01184         }
01185         if (image->linetype_scale < 0.0)
01186         {
01187                 fprintf (stderr,
01188                   (_("Error in %s () a negative value was found in the linetype scale member.\n")),
01189                   __FUNCTION__);
01190                 return (EXIT_FAILURE);
01191         }
01192 #if DEBUG
01193         DXF_DEBUG_END
01194 #endif
01195         return (image->linetype_scale);
01196 }
01197 
01198 
01205 DxfImage *
01206 dxf_image_set_linetype_scale
01207 (
01208         DxfImage *image,
01210         double linetype_scale
01212 )
01213 {
01214 #if DEBUG
01215         DXF_DEBUG_BEGIN
01216 #endif
01217         /* Do some basic checks. */
01218         if (image == NULL)
01219         {
01220                 fprintf (stderr,
01221                   (_("Error in %s () a NULL pointer was passed.\n")),
01222                   __FUNCTION__);
01223                 return (NULL);
01224         }
01225         if (linetype_scale < 0.0)
01226         {
01227                 fprintf (stderr,
01228                   (_("Error in %s () a negative linetype scale value was passed.\n")),
01229                   __FUNCTION__);
01230                 return (NULL);
01231         }
01232         image->linetype_scale = linetype_scale;
01233 #if DEBUG
01234         DXF_DEBUG_END
01235 #endif
01236         return (image);
01237 }
01238 
01239 
01246 int16_t
01247 dxf_image_get_visibility
01248 (
01249         DxfImage *image
01251 )
01252 {
01253 #if DEBUG
01254         DXF_DEBUG_BEGIN
01255 #endif
01256         /* Do some basic checks. */
01257         if (image == NULL)
01258         {
01259                 fprintf (stderr,
01260                   (_("Error in %s () a NULL pointer was passed.\n")),
01261                   __FUNCTION__);
01262                 return (EXIT_FAILURE);
01263         }
01264         if (image->visibility < 0)
01265         {
01266                 fprintf (stderr,
01267                   (_("Error in %s () a negative value was found in the visibility member.\n")),
01268                   __FUNCTION__);
01269                 return (EXIT_FAILURE);
01270         }
01271         if (image->visibility > 1)
01272         {
01273                 fprintf (stderr,
01274                   (_("Error in %s () an out of range value was found in the visibility member.\n")),
01275                   __FUNCTION__);
01276                 return (EXIT_FAILURE);
01277         }
01278 #if DEBUG
01279         DXF_DEBUG_END
01280 #endif
01281         return (image->visibility);
01282 }
01283 
01284 
01291 DxfImage *
01292 dxf_image_set_visibility
01293 (
01294         DxfImage *image,
01296         int16_t visibility
01298 )
01299 {
01300 #if DEBUG
01301         DXF_DEBUG_BEGIN
01302 #endif
01303         /* Do some basic checks. */
01304         if (image == NULL)
01305         {
01306                 fprintf (stderr,
01307                   (_("Error in %s () a NULL pointer was passed.\n")),
01308                   __FUNCTION__);
01309                 return (NULL);
01310         }
01311         if (visibility < 0)
01312         {
01313                 fprintf (stderr,
01314                   (_("Error in %s () a negative visibility value was passed.\n")),
01315                   __FUNCTION__);
01316                 return (NULL);
01317         }
01318         if (visibility > 1)
01319         {
01320                 fprintf (stderr,
01321                   (_("Error in %s () an out of range visibility value was passed.\n")),
01322                   __FUNCTION__);
01323                 return (NULL);
01324         }
01325         image->visibility = visibility;
01326 #if DEBUG
01327         DXF_DEBUG_END
01328 #endif
01329         return (image);
01330 }
01331 
01332 
01339 int
01340 dxf_image_get_color
01341 (
01342         DxfImage *image
01344 )
01345 {
01346 #if DEBUG
01347         DXF_DEBUG_BEGIN
01348 #endif
01349         /* Do some basic checks. */
01350         if (image == NULL)
01351         {
01352                 fprintf (stderr,
01353                   (_("Error in %s () a NULL pointer was passed.\n")),
01354                   __FUNCTION__);
01355                 return (EXIT_FAILURE);
01356         }
01357         if (image->color < 0)
01358         {
01359                 fprintf (stderr,
01360                   (_("Warning in %s () a negative value was found in the color member.\n")),
01361                   __FUNCTION__);
01362         }
01363 #if DEBUG
01364         DXF_DEBUG_END
01365 #endif
01366         return (image->color);
01367 }
01368 
01369 
01376 DxfImage *
01377 dxf_image_set_color
01378 (
01379         DxfImage *image,
01381         int color
01383 )
01384 {
01385 #if DEBUG
01386         DXF_DEBUG_BEGIN
01387 #endif
01388         /* Do some basic checks. */
01389         if (image == NULL)
01390         {
01391                 fprintf (stderr,
01392                   (_("Error in %s () a NULL pointer was passed.\n")),
01393                   __FUNCTION__);
01394                 return (NULL);
01395         }
01396         if (color < 0)
01397         {
01398                 fprintf (stderr,
01399                   (_("Warning in %s () a negative color value was passed.\n")),
01400                   __FUNCTION__);
01401                 fprintf (stderr,
01402                   (_("\teffectively turning this entity it's visibility off.\n")));
01403         }
01404         image->color = color;
01405 #if DEBUG
01406         DXF_DEBUG_END
01407 #endif
01408         return (image);
01409 }
01410 
01411 
01418 int
01419 dxf_image_get_paperspace
01420 (
01421         DxfImage *image
01423 )
01424 {
01425 #if DEBUG
01426         DXF_DEBUG_BEGIN
01427 #endif
01428         /* Do some basic checks. */
01429         if (image == NULL)
01430         {
01431                 fprintf (stderr,
01432                   (_("Error in %s () a NULL pointer was passed.\n")),
01433                   __FUNCTION__);
01434                 return (EXIT_FAILURE);
01435         }
01436         if (image->paperspace < 0)
01437         {
01438                 fprintf (stderr,
01439                   (_("Warning in %s () a negative value was found in the paperspace member.\n")),
01440                   __FUNCTION__);
01441         }
01442         if (image->paperspace > 1)
01443         {
01444                 fprintf (stderr,
01445                   (_("Warning in %s () an out of range value was found in the paperspace member.\n")),
01446                   __FUNCTION__);
01447         }
01448 #if DEBUG
01449         DXF_DEBUG_END
01450 #endif
01451         return (image->paperspace);
01452 }
01453 
01454 
01461 DxfImage *
01462 dxf_image_set_paperspace
01463 (
01464         DxfImage *image,
01466         int paperspace
01469 )
01470 {
01471 #if DEBUG
01472         DXF_DEBUG_BEGIN
01473 #endif
01474         /* Do some basic checks. */
01475         if (image == NULL)
01476         {
01477                 fprintf (stderr,
01478                   (_("Error in %s () a NULL pointer was passed.\n")),
01479                   __FUNCTION__);
01480                 return (NULL);
01481         }
01482         if (paperspace < 0)
01483         {
01484                 fprintf (stderr,
01485                   (_("Error in %s () a negative paperspace value was passed.\n")),
01486                   __FUNCTION__);
01487                 return (NULL);
01488         }
01489         if (paperspace > 1)
01490         {
01491                 fprintf (stderr,
01492                   (_("Error in %s () an out of range paperspace value was passed.\n")),
01493                   __FUNCTION__);
01494                 return (NULL);
01495         }
01496         image->paperspace = paperspace;
01497 #if DEBUG
01498         DXF_DEBUG_END
01499 #endif
01500         return (image);
01501 }
01502 
01503 
01511 int
01512 dxf_image_get_graphics_data_size
01513 (
01514         DxfImage *image
01516 )
01517 {
01518 #if DEBUG
01519         DXF_DEBUG_BEGIN
01520 #endif
01521         /* Do some basic checks. */
01522         if (image == NULL)
01523         {
01524                 fprintf (stderr,
01525                   (_("Error in %s () a NULL pointer was passed.\n")),
01526                   __FUNCTION__);
01527                 return (EXIT_FAILURE);
01528         }
01529         if (image->graphics_data_size < 0)
01530         {
01531                 fprintf (stderr,
01532                   (_("Warning in %s () a negative value was found in the graphics_data_size member.\n")),
01533                   __FUNCTION__);
01534         }
01535         if (image->graphics_data_size == 0)
01536         {
01537                 fprintf (stderr,
01538                   (_("Warning in %s () a zero value was found in the graphics_data_size member.\n")),
01539                   __FUNCTION__);
01540         }
01541 #if DEBUG
01542         DXF_DEBUG_END
01543 #endif
01544         return (image->graphics_data_size);
01545 }
01546 
01547 
01554 DxfImage *
01555 dxf_image_set_graphics_data_size
01556 (
01557         DxfImage *image,
01559         int graphics_data_size
01562 )
01563 {
01564 #if DEBUG
01565         DXF_DEBUG_BEGIN
01566 #endif
01567         /* Do some basic checks. */
01568         if (image == NULL)
01569         {
01570                 fprintf (stderr,
01571                   (_("Error in %s () a NULL pointer was passed.\n")),
01572                   __FUNCTION__);
01573                 return (NULL);
01574         }
01575         if (graphics_data_size < 0)
01576         {
01577                 fprintf (stderr,
01578                   (_("Error in %s () a negative graphics_data_size value was passed.\n")),
01579                   __FUNCTION__);
01580                 return (NULL);
01581         }
01582         if (graphics_data_size == 0)
01583         {
01584                 fprintf (stderr,
01585                   (_("Error in %s () a zero graphics_data_size value was passed.\n")),
01586                   __FUNCTION__);
01587                 return (NULL);
01588         }
01589         image->graphics_data_size = graphics_data_size;
01590 #if DEBUG
01591         DXF_DEBUG_END
01592 #endif
01593         return (image);
01594 }
01595 
01596 
01603 int16_t
01604 dxf_image_get_shadow_mode
01605 (
01606         DxfImage *image
01608 )
01609 {
01610 #if DEBUG
01611         DXF_DEBUG_BEGIN
01612 #endif
01613         /* Do some basic checks. */
01614         if (image == NULL)
01615         {
01616                 fprintf (stderr,
01617                   (_("Error in %s () a NULL pointer was passed.\n")),
01618                   __FUNCTION__);
01619                 return (EXIT_FAILURE);
01620         }
01621         if (image->shadow_mode < 0)
01622         {
01623                 fprintf (stderr,
01624                   (_("Error in %s () a negative value was found in the shadow_mode member.\n")),
01625                   __FUNCTION__);
01626                 return (EXIT_FAILURE);
01627         }
01628         if (image->shadow_mode > 3)
01629         {
01630                 fprintf (stderr,
01631                   (_("Error in %s () an out of range value was found in the shadow_mode member.\n")),
01632                   __FUNCTION__);
01633                 return (EXIT_FAILURE);
01634         }
01635 #if DEBUG
01636         DXF_DEBUG_END
01637 #endif
01638         return (image->shadow_mode);
01639 }
01640 
01641 
01648 DxfImage *
01649 dxf_image_set_shadow_mode
01650 (
01651         DxfImage *image,
01653         int16_t shadow_mode
01655 )
01656 {
01657 #if DEBUG
01658         DXF_DEBUG_BEGIN
01659 #endif
01660         /* Do some basic checks. */
01661         if (image == NULL)
01662         {
01663                 fprintf (stderr,
01664                   (_("Error in %s () a NULL pointer was passed.\n")),
01665                   __FUNCTION__);
01666                 return (NULL);
01667         }
01668         if (shadow_mode < 0)
01669         {
01670                 fprintf (stderr,
01671                   (_("Error in %s () a negative shadow_mode value was passed.\n")),
01672                   __FUNCTION__);
01673                 return (NULL);
01674         }
01675         if (shadow_mode > 3)
01676         {
01677                 fprintf (stderr,
01678                   (_("Error in %s () an out of range shadow_mode value was passed.\n")),
01679                   __FUNCTION__);
01680                 return (NULL);
01681         }
01682         image->shadow_mode = shadow_mode;
01683 #if DEBUG
01684         DXF_DEBUG_END
01685 #endif
01686         return (image);
01687 }
01688 
01689 
01699 DxfBinaryGraphicsData *
01700 dxf_image_get_binary_graphics_data
01701 (
01702         DxfImage *image
01704 )
01705 {
01706 #if DEBUG
01707         DXF_DEBUG_BEGIN
01708 #endif
01709         /* Do some basic checks. */
01710         if (image == NULL)
01711         {
01712                 fprintf (stderr,
01713                   (_("Error in %s () a NULL pointer was passed.\n")),
01714                   __FUNCTION__);
01715                 return (NULL);
01716         }
01717         if (image->binary_graphics_data ==  NULL)
01718         {
01719                 fprintf (stderr,
01720                   (_("Error in %s () a NULL pointer was found in the binary_graphics_data member.\n")),
01721                   __FUNCTION__);
01722                 return (NULL);
01723         }
01724 #if DEBUG
01725         DXF_DEBUG_END
01726 #endif
01727         return ((DxfBinaryGraphicsData *) image->binary_graphics_data);
01728 }
01729 
01730 
01738 DxfImage *
01739 dxf_image_set_binary_graphics_data
01740 (
01741         DxfImage *image,
01743         DxfBinaryGraphicsData *data
01746 )
01747 {
01748 #if DEBUG
01749         DXF_DEBUG_BEGIN
01750 #endif
01751         /* Do some basic checks. */
01752         if (image == NULL)
01753         {
01754                 fprintf (stderr,
01755                   (_("Error in %s () a NULL pointer was passed.\n")),
01756                   __FUNCTION__);
01757                 return (NULL);
01758         }
01759         if (data == NULL)
01760         {
01761                 fprintf (stderr,
01762                   (_("Error in %s () a NULL pointer was passed.\n")),
01763                   __FUNCTION__);
01764                 return (NULL);
01765         }
01766         image->binary_graphics_data = (DxfBinaryGraphicsData *) data;
01767 #if DEBUG
01768         DXF_DEBUG_END
01769 #endif
01770         return (image);
01771 }
01772 
01773 
01783 char *
01784 dxf_image_get_dictionary_owner_soft
01785 (
01786         DxfImage *image
01788 )
01789 {
01790 #if DEBUG
01791         DXF_DEBUG_BEGIN
01792 #endif
01793         /* Do some basic checks. */
01794         if (image == NULL)
01795         {
01796                 fprintf (stderr,
01797                   (_("Error in %s () a NULL pointer was passed.\n")),
01798                   __FUNCTION__);
01799                 return (NULL);
01800         }
01801         if (image->dictionary_owner_soft ==  NULL)
01802         {
01803                 fprintf (stderr,
01804                   (_("Error in %s () a NULL pointer was found in the dictionary_owner_soft member.\n")),
01805                   __FUNCTION__);
01806                 return (NULL);
01807         }
01808 #if DEBUG
01809         DXF_DEBUG_END
01810 #endif
01811         return (strdup (image->dictionary_owner_soft));
01812 }
01813 
01814 
01822 DxfImage *
01823 dxf_image_set_dictionary_owner_soft
01824 (
01825         DxfImage *image,
01827         char *dictionary_owner_soft
01830 )
01831 {
01832 #if DEBUG
01833         DXF_DEBUG_BEGIN
01834 #endif
01835         /* Do some basic checks. */
01836         if (image == NULL)
01837         {
01838                 fprintf (stderr,
01839                   (_("Error in %s () a NULL pointer was passed.\n")),
01840                   __FUNCTION__);
01841                 return (NULL);
01842         }
01843         if (dictionary_owner_soft == NULL)
01844         {
01845                 fprintf (stderr,
01846                   (_("Error in %s () a NULL pointer was passed.\n")),
01847                   __FUNCTION__);
01848                 return (NULL);
01849         }
01850         image->dictionary_owner_soft = strdup (dictionary_owner_soft);
01851 #if DEBUG
01852         DXF_DEBUG_END
01853 #endif
01854         return (image);
01855 }
01856 
01857 
01866 char *
01867 dxf_image_get_material
01868 (
01869         DxfImage *image
01871 )
01872 {
01873 #if DEBUG
01874         DXF_DEBUG_BEGIN
01875 #endif
01876         /* Do some basic checks. */
01877         if (image == NULL)
01878         {
01879                 fprintf (stderr,
01880                   (_("Error in %s () a NULL pointer was passed.\n")),
01881                   __FUNCTION__);
01882                 return (NULL);
01883         }
01884         if (image->material ==  NULL)
01885         {
01886                 fprintf (stderr,
01887                   (_("Error in %s () a NULL pointer was found in the material member.\n")),
01888                   __FUNCTION__);
01889                 return (NULL);
01890         }
01891 #if DEBUG
01892         DXF_DEBUG_END
01893 #endif
01894         return (strdup (image->material));
01895 }
01896 
01897 
01904 DxfImage *
01905 dxf_image_set_material
01906 (
01907         DxfImage *image,
01909         char *material
01912 )
01913 {
01914 #if DEBUG
01915         DXF_DEBUG_BEGIN
01916 #endif
01917         /* Do some basic checks. */
01918         if (image == NULL)
01919         {
01920                 fprintf (stderr,
01921                   (_("Error in %s () a NULL pointer was passed.\n")),
01922                   __FUNCTION__);
01923                 return (NULL);
01924         }
01925         if (material == NULL)
01926         {
01927                 fprintf (stderr,
01928                   (_("Error in %s () a NULL pointer was passed.\n")),
01929                   __FUNCTION__);
01930                 return (NULL);
01931         }
01932         image->material = strdup (material);
01933 #if DEBUG
01934         DXF_DEBUG_END
01935 #endif
01936         return (image);
01937 }
01938 
01939 
01949 char *
01950 dxf_image_get_dictionary_owner_hard
01951 (
01952         DxfImage *image
01954 )
01955 {
01956 #if DEBUG
01957         DXF_DEBUG_BEGIN
01958 #endif
01959         /* Do some basic checks. */
01960         if (image == NULL)
01961         {
01962                 fprintf (stderr,
01963                   (_("Error in %s () a NULL pointer was passed.\n")),
01964                   __FUNCTION__);
01965                 return (NULL);
01966         }
01967         if (image->dictionary_owner_hard ==  NULL)
01968         {
01969                 fprintf (stderr,
01970                   (_("Error in %s () a NULL pointer was found in the dictionary_owner_hard member.\n")),
01971                   __FUNCTION__);
01972                 return (NULL);
01973         }
01974 #if DEBUG
01975         DXF_DEBUG_END
01976 #endif
01977         return (strdup (image->dictionary_owner_hard));
01978 }
01979 
01980 
01988 DxfImage *
01989 dxf_image_set_dictionary_owner_hard
01990 (
01991         DxfImage *image,
01993         char *dictionary_owner_hard
01996 )
01997 {
01998 #if DEBUG
01999         DXF_DEBUG_BEGIN
02000 #endif
02001         /* Do some basic checks. */
02002         if (image == NULL)
02003         {
02004                 fprintf (stderr,
02005                   (_("Error in %s () a NULL pointer was passed.\n")),
02006                   __FUNCTION__);
02007                 return (NULL);
02008         }
02009         if (dictionary_owner_hard == NULL)
02010         {
02011                 fprintf (stderr,
02012                   (_("Error in %s () a NULL pointer was passed.\n")),
02013                   __FUNCTION__);
02014                 return (NULL);
02015         }
02016         image->dictionary_owner_hard = strdup (dictionary_owner_hard);
02017 #if DEBUG
02018         DXF_DEBUG_END
02019 #endif
02020         return (image);
02021 }
02022 
02023 
02030 int16_t
02031 dxf_image_get_lineweight
02032 (
02033         DxfImage *image
02035 )
02036 {
02037 #if DEBUG
02038         DXF_DEBUG_BEGIN
02039 #endif
02040         /* Do some basic checks. */
02041         if (image == NULL)
02042         {
02043                 fprintf (stderr,
02044                   (_("Error in %s () a NULL pointer was passed.\n")),
02045                   __FUNCTION__);
02046                 return (EXIT_FAILURE);
02047         }
02048 #if DEBUG
02049         DXF_DEBUG_END
02050 #endif
02051         return (image->lineweight);
02052 }
02053 
02054 
02061 DxfImage *
02062 dxf_image_set_lineweight
02063 (
02064         DxfImage *image,
02066         int16_t lineweight
02068 )
02069 {
02070 #if DEBUG
02071         DXF_DEBUG_BEGIN
02072 #endif
02073         /* Do some basic checks. */
02074         if (image == NULL)
02075         {
02076                 fprintf (stderr,
02077                   (_("Error in %s () a NULL pointer was passed.\n")),
02078                   __FUNCTION__);
02079                 return (NULL);
02080         }
02081         image->lineweight = lineweight;
02082 #if DEBUG
02083         DXF_DEBUG_END
02084 #endif
02085         return (image);
02086 }
02087 
02088 
02095 char *
02096 dxf_image_get_plot_style_name
02097 (
02098         DxfImage *image
02100 )
02101 {
02102 #if DEBUG
02103         DXF_DEBUG_BEGIN
02104 #endif
02105         /* Do some basic checks. */
02106         if (image == NULL)
02107         {
02108                 fprintf (stderr,
02109                   (_("Error in %s () a NULL pointer was passed.\n")),
02110                   __FUNCTION__);
02111                 return (NULL);
02112         }
02113         if (image->plot_style_name ==  NULL)
02114         {
02115                 fprintf (stderr,
02116                   (_("Error in %s () a NULL pointer was found in the plot_style_name member.\n")),
02117                   __FUNCTION__);
02118                 return (NULL);
02119         }
02120 #if DEBUG
02121         DXF_DEBUG_END
02122 #endif
02123         return (strdup (image->plot_style_name));
02124 }
02125 
02126 
02133 DxfImage *
02134 dxf_image_set_plot_style_name
02135 (
02136         DxfImage *image,
02138         char *plot_style_name
02141 )
02142 {
02143 #if DEBUG
02144         DXF_DEBUG_BEGIN
02145 #endif
02146         /* Do some basic checks. */
02147         if (image == NULL)
02148         {
02149                 fprintf (stderr,
02150                   (_("Error in %s () a NULL pointer was passed.\n")),
02151                   __FUNCTION__);
02152                 return (NULL);
02153         }
02154         if (plot_style_name == NULL)
02155         {
02156                 fprintf (stderr,
02157                   (_("Error in %s () a NULL pointer was passed.\n")),
02158                   __FUNCTION__);
02159                 return (NULL);
02160         }
02161         image->plot_style_name = strdup (plot_style_name);
02162 #if DEBUG
02163         DXF_DEBUG_END
02164 #endif
02165         return (image);
02166 }
02167 
02168 
02175 long
02176 dxf_image_get_color_value
02177 (
02178         DxfImage *image
02180 )
02181 {
02182 #if DEBUG
02183         DXF_DEBUG_BEGIN
02184 #endif
02185         /* Do some basic checks. */
02186         if (image == NULL)
02187         {
02188                 fprintf (stderr,
02189                   (_("Error in %s () a NULL pointer was passed.\n")),
02190                   __FUNCTION__);
02191                 return (EXIT_FAILURE);
02192         }
02193 #if DEBUG
02194         DXF_DEBUG_END
02195 #endif
02196         return (image->color_value);
02197 }
02198 
02199 
02206 DxfImage *
02207 dxf_image_set_color_value
02208 (
02209         DxfImage *image,
02211         long color_value
02213 )
02214 {
02215 #if DEBUG
02216         DXF_DEBUG_BEGIN
02217 #endif
02218         /* Do some basic checks. */
02219         if (image == NULL)
02220         {
02221                 fprintf (stderr,
02222                   (_("Error in %s () a NULL pointer was passed.\n")),
02223                   __FUNCTION__);
02224                 return (NULL);
02225         }
02226         image->color_value = color_value;
02227 #if DEBUG
02228         DXF_DEBUG_END
02229 #endif
02230         return (image);
02231 }
02232 
02233 
02240 char *
02241 dxf_image_get_color_name
02242 (
02243         DxfImage *image
02245 )
02246 {
02247 #if DEBUG
02248         DXF_DEBUG_BEGIN
02249 #endif
02250         /* Do some basic checks. */
02251         if (image == NULL)
02252         {
02253                 fprintf (stderr,
02254                   (_("Error in %s () a NULL pointer was passed.\n")),
02255                   __FUNCTION__);
02256                 return (NULL);
02257         }
02258         if (image->color_name ==  NULL)
02259         {
02260                 fprintf (stderr,
02261                   (_("Error in %s () a NULL pointer was found in the color_name member.\n")),
02262                   __FUNCTION__);
02263                 return (NULL);
02264         }
02265 #if DEBUG
02266         DXF_DEBUG_END
02267 #endif
02268         return (strdup (image->color_name));
02269 }
02270 
02271 
02278 DxfImage *
02279 dxf_image_set_color_name
02280 (
02281         DxfImage *image,
02283         char *color_name
02286 )
02287 {
02288 #if DEBUG
02289         DXF_DEBUG_BEGIN
02290 #endif
02291         /* Do some basic checks. */
02292         if (image == NULL)
02293         {
02294                 fprintf (stderr,
02295                   (_("Error in %s () a NULL pointer was passed.\n")),
02296                   __FUNCTION__);
02297                 return (NULL);
02298         }
02299         if (color_name == NULL)
02300         {
02301                 fprintf (stderr,
02302                   (_("Error in %s () a NULL pointer was passed.\n")),
02303                   __FUNCTION__);
02304                 return (NULL);
02305         }
02306         image->color_name = strdup (color_name);
02307 #if DEBUG
02308         DXF_DEBUG_END
02309 #endif
02310         return (image);
02311 }
02312 
02313 
02320 long
02321 dxf_image_get_transparency
02322 (
02323         DxfImage *image
02325 )
02326 {
02327 #if DEBUG
02328         DXF_DEBUG_BEGIN
02329 #endif
02330         /* Do some basic checks. */
02331         if (image == NULL)
02332         {
02333                 fprintf (stderr,
02334                   (_("Error in %s () a NULL pointer was passed.\n")),
02335                   __FUNCTION__);
02336                 return (EXIT_FAILURE);
02337         }
02338 #if DEBUG
02339         DXF_DEBUG_END
02340 #endif
02341         return (image->transparency);
02342 }
02343 
02344 
02351 DxfImage *
02352 dxf_image_set_transparency
02353 (
02354         DxfImage *image,
02356         long transparency
02358 )
02359 {
02360 #if DEBUG
02361         DXF_DEBUG_BEGIN
02362 #endif
02363         /* Do some basic checks. */
02364         if (image == NULL)
02365         {
02366                 fprintf (stderr,
02367                   (_("Error in %s () a NULL pointer was passed.\n")),
02368                   __FUNCTION__);
02369                 return (NULL);
02370         }
02371         image->transparency = transparency;
02372 #if DEBUG
02373         DXF_DEBUG_END
02374 #endif
02375         return (image);
02376 }
02377 
02378 
02384 DxfPoint *
02385 dxf_image_get_p0
02386 (
02387         DxfImage *image
02389 )
02390 {
02391 #ifdef DEBUG
02392         DXF_DEBUG_BEGIN
02393 #endif
02394         /* Do some basic checks. */
02395         if (image == NULL)
02396         {
02397                 fprintf (stderr,
02398                   (_("Error in %s () a NULL pointer was passed.\n")),
02399                   __FUNCTION__);
02400                 return (NULL);
02401         }
02402         if (image->p0 == NULL)
02403         {
02404                 fprintf (stderr,
02405                   (_("Error in %s () a NULL pointer was found.\n")),
02406                   __FUNCTION__);
02407                 return (NULL);
02408         }
02409 #if DEBUG
02410         DXF_DEBUG_END
02411 #endif
02412         return (image->p0);
02413 }
02414 
02415 
02421 DxfImage *
02422 dxf_image_set_p0
02423 (
02424         DxfImage *image,
02426         DxfPoint *p0
02428 )
02429 {
02430 #ifdef DEBUG
02431         DXF_DEBUG_BEGIN
02432 #endif
02433         /* Do some basic checks. */
02434         if (image == NULL)
02435         {
02436                 fprintf (stderr,
02437                   (_("Error in %s () a NULL pointer was passed.\n")),
02438                   __FUNCTION__);
02439                 return (NULL);
02440         }
02441         if (p0 == NULL)
02442         {
02443                 fprintf (stderr,
02444                   (_("Error in %s () a NULL pointer was passed.\n")),
02445                   __FUNCTION__);
02446                 return (NULL);
02447         }
02448         image->p0 = p0;
02449 #if DEBUG
02450         DXF_DEBUG_END
02451 #endif
02452         return (image);
02453 }
02454 
02455 
02462 double
02463 dxf_image_get_x0
02464 (
02465         DxfImage *image
02467 )
02468 {
02469 #ifdef DEBUG
02470         DXF_DEBUG_BEGIN
02471 #endif
02472 
02473         /* Do some basic checks. */
02474         if (image == NULL)
02475         {
02476                 fprintf (stderr,
02477                   (_("Error in %s () a NULL pointer was passed.\n")),
02478                   __FUNCTION__);
02479                 return (EXIT_FAILURE);
02480         }
02481         if (image->p0 == NULL)
02482         {
02483                 fprintf (stderr,
02484                   (_("Error in %s () a NULL pointer was found.\n")),
02485                   __FUNCTION__);
02486                 return (EXIT_FAILURE);
02487         }
02488 #if DEBUG
02489         DXF_DEBUG_END
02490 #endif
02491         return (image->p0->x0);
02492 }
02493 
02494 
02502 DxfImage *
02503 dxf_image_set_x0
02504 (
02505         DxfImage *image,
02507         double x0
02510 )
02511 {
02512 #ifdef DEBUG
02513         DXF_DEBUG_BEGIN
02514 #endif
02515         /* Do some basic checks. */
02516         if (image == NULL)
02517         {
02518                 fprintf (stderr,
02519                   (_("Error in %s () a NULL pointer was passed.\n")),
02520                   __FUNCTION__);
02521                 return (NULL);
02522         }
02523         if (image->p0 == NULL)
02524         {
02525                 fprintf (stderr,
02526                   (_("Error in %s () a NULL pointer was found.\n")),
02527                   __FUNCTION__);
02528                 return (NULL);
02529         }
02530         image->p0->x0 = x0;
02531 #if DEBUG
02532         DXF_DEBUG_END
02533 #endif
02534         return (image);
02535 }
02536 
02537 
02544 double
02545 dxf_image_get_y0
02546 (
02547         DxfImage *image
02549 )
02550 {
02551 #ifdef DEBUG
02552         DXF_DEBUG_BEGIN
02553 #endif
02554 
02555         /* Do some basic checks. */
02556         if (image == NULL)
02557         {
02558                 fprintf (stderr,
02559                   (_("Error in %s () a NULL pointer was passed.\n")),
02560                   __FUNCTION__);
02561                 return (EXIT_FAILURE);
02562         }
02563         if (image->p0 == NULL)
02564         {
02565                 fprintf (stderr,
02566                   (_("Error in %s () a NULL pointer was found.\n")),
02567                   __FUNCTION__);
02568                 return (EXIT_FAILURE);
02569         }
02570 #if DEBUG
02571         DXF_DEBUG_END
02572 #endif
02573         return (image->p0->y0);
02574 }
02575 
02576 
02584 DxfImage *
02585 dxf_image_set_y0
02586 (
02587         DxfImage *image,
02589         double y0
02592 )
02593 {
02594 #ifdef DEBUG
02595         DXF_DEBUG_BEGIN
02596 #endif
02597         /* Do some basic checks. */
02598         if (image == NULL)
02599         {
02600                 fprintf (stderr,
02601                   (_("Error in %s () a NULL pointer was passed.\n")),
02602                   __FUNCTION__);
02603                 return (NULL);
02604         }
02605         if (image->p0 == NULL)
02606         {
02607                 fprintf (stderr,
02608                   (_("Error in %s () a NULL pointer was found.\n")),
02609                   __FUNCTION__);
02610                 return (NULL);
02611         }
02612         image->p0->y0 = y0;
02613 #if DEBUG
02614         DXF_DEBUG_END
02615 #endif
02616         return (image);
02617 }
02618 
02619 
02626 double
02627 dxf_image_get_z0
02628 (
02629         DxfImage *image
02631 )
02632 {
02633 #ifdef DEBUG
02634         DXF_DEBUG_BEGIN
02635 #endif
02636 
02637         /* Do some basic checks. */
02638         if (image == NULL)
02639         {
02640                 fprintf (stderr,
02641                   (_("Error in %s () a NULL pointer was passed.\n")),
02642                   __FUNCTION__);
02643                 return (EXIT_FAILURE);
02644         }
02645         if (image->p0 == NULL)
02646         {
02647                 fprintf (stderr,
02648                   (_("Error in %s () a NULL pointer was found.\n")),
02649                   __FUNCTION__);
02650                 return (EXIT_FAILURE);
02651         }
02652 #if DEBUG
02653         DXF_DEBUG_END
02654 #endif
02655         return (image->p0->z0);
02656 }
02657 
02658 
02666 DxfImage *
02667 dxf_image_set_z0
02668 (
02669         DxfImage *image,
02671         double z0
02674 )
02675 {
02676 #ifdef DEBUG
02677         DXF_DEBUG_BEGIN
02678 #endif
02679         /* Do some basic checks. */
02680         if (image == NULL)
02681         {
02682                 fprintf (stderr,
02683                   (_("Error in %s () a NULL pointer was passed.\n")),
02684                   __FUNCTION__);
02685                 return (NULL);
02686         }
02687         if (image->p0 == NULL)
02688         {
02689                 fprintf (stderr,
02690                   (_("Error in %s () a NULL pointer was found.\n")),
02691                   __FUNCTION__);
02692                 return (NULL);
02693         }
02694         image->p0->z0 = z0;
02695 #if DEBUG
02696         DXF_DEBUG_END
02697 #endif
02698         return (image);
02699 }
02700 
02701 
02708 DxfPoint *
02709 dxf_image_get_p1
02710 (
02711         DxfImage *image
02713 )
02714 {
02715 #ifdef DEBUG
02716         DXF_DEBUG_BEGIN
02717 #endif
02718         /* Do some basic checks. */
02719         if (image == NULL)
02720         {
02721                 fprintf (stderr,
02722                   (_("Error in %s () a NULL pointer was passed.\n")),
02723                   __FUNCTION__);
02724                 return (NULL);
02725         }
02726         if (image->p1 == NULL)
02727         {
02728                 fprintf (stderr,
02729                   (_("Error in %s () a NULL pointer was found.\n")),
02730                   __FUNCTION__);
02731                 return (NULL);
02732         }
02733 #if DEBUG
02734         DXF_DEBUG_END
02735 #endif
02736         return (image->p1);
02737 }
02738 
02739 
02746 DxfImage *
02747 dxf_image_set_p1
02748 (
02749         DxfImage *image,
02751         DxfPoint *p1
02753 )
02754 {
02755 #ifdef DEBUG
02756         DXF_DEBUG_BEGIN
02757 #endif
02758         /* Do some basic checks. */
02759         if (image == NULL)
02760         {
02761                 fprintf (stderr,
02762                   (_("Error in %s () a NULL pointer was passed.\n")),
02763                   __FUNCTION__);
02764                 return (NULL);
02765         }
02766         if (p1 == NULL)
02767         {
02768                 fprintf (stderr,
02769                   (_("Error in %s () a NULL pointer was passed.\n")),
02770                   __FUNCTION__);
02771                 return (NULL);
02772         }
02773         image->p1 = p1;
02774 #if DEBUG
02775         DXF_DEBUG_END
02776 #endif
02777         return (image);
02778 }
02779 
02780 
02787 double
02788 dxf_image_get_x1
02789 (
02790         DxfImage *image
02792 )
02793 {
02794 #ifdef DEBUG
02795         DXF_DEBUG_BEGIN
02796 #endif
02797 
02798         /* Do some basic checks. */
02799         if (image == NULL)
02800         {
02801                 fprintf (stderr,
02802                   (_("Error in %s () a NULL pointer was passed.\n")),
02803                   __FUNCTION__);
02804                 return (EXIT_FAILURE);
02805         }
02806         if (image->p1 == NULL)
02807         {
02808                 fprintf (stderr,
02809                   (_("Error in %s () a NULL pointer was found.\n")),
02810                   __FUNCTION__);
02811                 return (EXIT_FAILURE);
02812         }
02813 #if DEBUG
02814         DXF_DEBUG_END
02815 #endif
02816         return (image->p1->x0);
02817 }
02818 
02819 
02827 DxfImage *
02828 dxf_image_set_x1
02829 (
02830         DxfImage *image,
02832         double x1
02835 )
02836 {
02837 #ifdef DEBUG
02838         DXF_DEBUG_BEGIN
02839 #endif
02840         /* Do some basic checks. */
02841         if (image == NULL)
02842         {
02843                 fprintf (stderr,
02844                   (_("Error in %s () a NULL pointer was passed.\n")),
02845                   __FUNCTION__);
02846                 return (NULL);
02847         }
02848         if (image->p1 == NULL)
02849         {
02850                 fprintf (stderr,
02851                   (_("Error in %s () a NULL pointer was found.\n")),
02852                   __FUNCTION__);
02853                 return (NULL);
02854         }
02855         image->p1->x0 = x1;
02856 #if DEBUG
02857         DXF_DEBUG_END
02858 #endif
02859         return (image);
02860 }
02861 
02862 
02869 double
02870 dxf_image_get_y1
02871 (
02872         DxfImage *image
02874 )
02875 {
02876 #ifdef DEBUG
02877         DXF_DEBUG_BEGIN
02878 #endif
02879 
02880         /* Do some basic checks. */
02881         if (image == NULL)
02882         {
02883                 fprintf (stderr,
02884                   (_("Error in %s () a NULL pointer was passed.\n")),
02885                   __FUNCTION__);
02886                 return (EXIT_FAILURE);
02887         }
02888         if (image->p1 == NULL)
02889         {
02890                 fprintf (stderr,
02891                   (_("Error in %s () a NULL pointer was found.\n")),
02892                   __FUNCTION__);
02893                 return (EXIT_FAILURE);
02894         }
02895 #if DEBUG
02896         DXF_DEBUG_END
02897 #endif
02898         return (image->p1->y0);
02899 }
02900 
02901 
02909 DxfImage *
02910 dxf_image_set_y1
02911 (
02912         DxfImage *image,
02914         double y1
02917 )
02918 {
02919 #ifdef DEBUG
02920         DXF_DEBUG_BEGIN
02921 #endif
02922         /* Do some basic checks. */
02923         if (image == NULL)
02924         {
02925                 fprintf (stderr,
02926                   (_("Error in %s () a NULL pointer was passed.\n")),
02927                   __FUNCTION__);
02928                 return (NULL);
02929         }
02930         if (image->p1 == NULL)
02931         {
02932                 fprintf (stderr,
02933                   (_("Error in %s () a NULL pointer was found.\n")),
02934                   __FUNCTION__);
02935                 return (NULL);
02936         }
02937         image->p1->y0 = y1;
02938 #if DEBUG
02939         DXF_DEBUG_END
02940 #endif
02941         return (image);
02942 }
02943 
02944 
02951 double
02952 dxf_image_get_z1
02953 (
02954         DxfImage *image
02956 )
02957 {
02958 #ifdef DEBUG
02959         DXF_DEBUG_BEGIN
02960 #endif
02961 
02962         /* Do some basic checks. */
02963         if (image == NULL)
02964         {
02965                 fprintf (stderr,
02966                   (_("Error in %s () a NULL pointer was passed.\n")),
02967                   __FUNCTION__);
02968                 return (EXIT_FAILURE);
02969         }
02970         if (image->p1 == NULL)
02971         {
02972                 fprintf (stderr,
02973                   (_("Error in %s () a NULL pointer was found.\n")),
02974                   __FUNCTION__);
02975                 return (EXIT_FAILURE);
02976         }
02977 #if DEBUG
02978         DXF_DEBUG_END
02979 #endif
02980         return (image->p1->z0);
02981 }
02982 
02983 
02991 DxfImage *
02992 dxf_image_set_z1
02993 (
02994         DxfImage *image,
02996         double z1
02999 )
03000 {
03001 #ifdef DEBUG
03002         DXF_DEBUG_BEGIN
03003 #endif
03004         /* Do some basic checks. */
03005         if (image == NULL)
03006         {
03007                 fprintf (stderr,
03008                   (_("Error in %s () a NULL pointer was passed.\n")),
03009                   __FUNCTION__);
03010                 return (NULL);
03011         }
03012         if (image->p1 == NULL)
03013         {
03014                 fprintf (stderr,
03015                   (_("Error in %s () a NULL pointer was found.\n")),
03016                   __FUNCTION__);
03017                 return (NULL);
03018         }
03019         image->p1->z0 = z1;
03020 #if DEBUG
03021         DXF_DEBUG_END
03022 #endif
03023         return (image);
03024 }
03025 
03026 
03033 DxfPoint *
03034 dxf_image_get_p2
03035 (
03036         DxfImage *image
03038 )
03039 {
03040 #ifdef DEBUG
03041         DXF_DEBUG_BEGIN
03042 #endif
03043         /* Do some basic checks. */
03044         if (image == NULL)
03045         {
03046                 fprintf (stderr,
03047                   (_("Error in %s () a NULL pointer was passed.\n")),
03048                   __FUNCTION__);
03049                 return (NULL);
03050         }
03051         if (image->p2 == NULL)
03052         {
03053                 fprintf (stderr,
03054                   (_("Error in %s () a NULL pointer was found.\n")),
03055                   __FUNCTION__);
03056                 return (NULL);
03057         }
03058 #if DEBUG
03059         DXF_DEBUG_END
03060 #endif
03061         return (image->p2);
03062 }
03063 
03064 
03071 DxfImage *
03072 dxf_image_set_p2
03073 (
03074         DxfImage *image,
03076         DxfPoint *p2
03078 )
03079 {
03080 #ifdef DEBUG
03081         DXF_DEBUG_BEGIN
03082 #endif
03083         /* Do some basic checks. */
03084         if (image == NULL)
03085         {
03086                 fprintf (stderr,
03087                   (_("Error in %s () a NULL pointer was passed.\n")),
03088                   __FUNCTION__);
03089                 return (NULL);
03090         }
03091         if (p2 == NULL)
03092         {
03093                 fprintf (stderr,
03094                   (_("Error in %s () a NULL pointer was passed.\n")),
03095                   __FUNCTION__);
03096                 return (NULL);
03097         }
03098         image->p2 = p2;
03099 #if DEBUG
03100         DXF_DEBUG_END
03101 #endif
03102         return (image);
03103 }
03104 
03105 
03112 double
03113 dxf_image_get_x2
03114 (
03115         DxfImage *image
03117 )
03118 {
03119 #ifdef DEBUG
03120         DXF_DEBUG_BEGIN
03121 #endif
03122 
03123         /* Do some basic checks. */
03124         if (image == NULL)
03125         {
03126                 fprintf (stderr,
03127                   (_("Error in %s () a NULL pointer was passed.\n")),
03128                   __FUNCTION__);
03129                 return (EXIT_FAILURE);
03130         }
03131         if (image->p2 == NULL)
03132         {
03133                 fprintf (stderr,
03134                   (_("Error in %s () a NULL pointer was found.\n")),
03135                   __FUNCTION__);
03136                 return (EXIT_FAILURE);
03137         }
03138 #if DEBUG
03139         DXF_DEBUG_END
03140 #endif
03141         return (image->p2->x0);
03142 }
03143 
03144 
03152 DxfImage *
03153 dxf_image_set_x2
03154 (
03155         DxfImage *image,
03157         double x2
03160 )
03161 {
03162 #ifdef DEBUG
03163         DXF_DEBUG_BEGIN
03164 #endif
03165         /* Do some basic checks. */
03166         if (image == NULL)
03167         {
03168                 fprintf (stderr,
03169                   (_("Error in %s () a NULL pointer was passed.\n")),
03170                   __FUNCTION__);
03171                 return (NULL);
03172         }
03173         if (image->p2 == NULL)
03174         {
03175                 fprintf (stderr,
03176                   (_("Error in %s () a NULL pointer was found.\n")),
03177                   __FUNCTION__);
03178                 return (NULL);
03179         }
03180         image->p2->x0 = x2;
03181 #if DEBUG
03182         DXF_DEBUG_END
03183 #endif
03184         return (image);
03185 }
03186 
03187 
03194 double
03195 dxf_image_get_y2
03196 (
03197         DxfImage *image
03199 )
03200 {
03201 #ifdef DEBUG
03202         DXF_DEBUG_BEGIN
03203 #endif
03204 
03205         /* Do some basic checks. */
03206         if (image == NULL)
03207         {
03208                 fprintf (stderr,
03209                   (_("Error in %s () a NULL pointer was passed.\n")),
03210                   __FUNCTION__);
03211                 return (EXIT_FAILURE);
03212         }
03213         if (image->p2 == NULL)
03214         {
03215                 fprintf (stderr,
03216                   (_("Error in %s () a NULL pointer was found.\n")),
03217                   __FUNCTION__);
03218                 return (EXIT_FAILURE);
03219         }
03220 #if DEBUG
03221         DXF_DEBUG_END
03222 #endif
03223         return (image->p2->y0);
03224 }
03225 
03226 
03234 DxfImage *
03235 dxf_image_set_y2
03236 (
03237         DxfImage *image,
03239         double y2
03242 )
03243 {
03244 #ifdef DEBUG
03245         DXF_DEBUG_BEGIN
03246 #endif
03247         /* Do some basic checks. */
03248         if (image == NULL)
03249         {
03250                 fprintf (stderr,
03251                   (_("Error in %s () a NULL pointer was passed.\n")),
03252                   __FUNCTION__);
03253                 return (NULL);
03254         }
03255         if (image->p2 == NULL)
03256         {
03257                 fprintf (stderr,
03258                   (_("Error in %s () a NULL pointer was found.\n")),
03259                   __FUNCTION__);
03260                 return (NULL);
03261         }
03262         image->p2->y0 = y2;
03263 #if DEBUG
03264         DXF_DEBUG_END
03265 #endif
03266         return (image);
03267 }
03268 
03269 
03276 double
03277 dxf_image_get_z2
03278 (
03279         DxfImage *image
03281 )
03282 {
03283 #ifdef DEBUG
03284         DXF_DEBUG_BEGIN
03285 #endif
03286 
03287         /* Do some basic checks. */
03288         if (image == NULL)
03289         {
03290                 fprintf (stderr,
03291                   (_("Error in %s () a NULL pointer was passed.\n")),
03292                   __FUNCTION__);
03293                 return (EXIT_FAILURE);
03294         }
03295         if (image->p2 == NULL)
03296         {
03297                 fprintf (stderr,
03298                   (_("Error in %s () a NULL pointer was found.\n")),
03299                   __FUNCTION__);
03300                 return (EXIT_FAILURE);
03301         }
03302 #if DEBUG
03303         DXF_DEBUG_END
03304 #endif
03305         return (image->p2->z0);
03306 }
03307 
03308 
03316 DxfImage *
03317 dxf_image_set_z2
03318 (
03319         DxfImage *image,
03321         double z2
03324 )
03325 {
03326 #ifdef DEBUG
03327         DXF_DEBUG_BEGIN
03328 #endif
03329         /* Do some basic checks. */
03330         if (image == NULL)
03331         {
03332                 fprintf (stderr,
03333                   (_("Error in %s () a NULL pointer was passed.\n")),
03334                   __FUNCTION__);
03335                 return (NULL);
03336         }
03337         if (image->p2 == NULL)
03338         {
03339                 fprintf (stderr,
03340                   (_("Error in %s () a NULL pointer was found.\n")),
03341                   __FUNCTION__);
03342                 return (NULL);
03343         }
03344         image->p2->z0 = z2;
03345 #if DEBUG
03346         DXF_DEBUG_END
03347 #endif
03348         return (image);
03349 }
03350 
03351 
03358 DxfPoint *
03359 dxf_image_get_p3
03360 (
03361         DxfImage *image
03363 )
03364 {
03365 #ifdef DEBUG
03366         DXF_DEBUG_BEGIN
03367 #endif
03368         /* Do some basic checks. */
03369         if (image == NULL)
03370         {
03371                 fprintf (stderr,
03372                   (_("Error in %s () a NULL pointer was passed.\n")),
03373                   __FUNCTION__);
03374                 return (NULL);
03375         }
03376         if (image->p3 == NULL)
03377         {
03378                 fprintf (stderr,
03379                   (_("Error in %s () a NULL pointer was found.\n")),
03380                   __FUNCTION__);
03381                 return (NULL);
03382         }
03383 #if DEBUG
03384         DXF_DEBUG_END
03385 #endif
03386         return (image->p3);
03387 }
03388 
03389 
03396 DxfImage *
03397 dxf_image_set_p3
03398 (
03399         DxfImage *image,
03401         DxfPoint *p3
03403 )
03404 {
03405 #ifdef DEBUG
03406         DXF_DEBUG_BEGIN
03407 #endif
03408         /* Do some basic checks. */
03409         if (image == NULL)
03410         {
03411                 fprintf (stderr,
03412                   (_("Error in %s () a NULL pointer was passed.\n")),
03413                   __FUNCTION__);
03414                 return (NULL);
03415         }
03416         if (p3 == NULL)
03417         {
03418                 fprintf (stderr,
03419                   (_("Error in %s () a NULL pointer was passed.\n")),
03420                   __FUNCTION__);
03421                 return (NULL);
03422         }
03423         image->p3 = p3;
03424 #if DEBUG
03425         DXF_DEBUG_END
03426 #endif
03427         return (image);
03428 }
03429 
03430 
03437 double
03438 dxf_image_get_x3
03439 (
03440         DxfImage *image
03442 )
03443 {
03444 #ifdef DEBUG
03445         DXF_DEBUG_BEGIN
03446 #endif
03447 
03448         /* Do some basic checks. */
03449         if (image == NULL)
03450         {
03451                 fprintf (stderr,
03452                   (_("Error in %s () a NULL pointer was passed.\n")),
03453                   __FUNCTION__);
03454                 return (EXIT_FAILURE);
03455         }
03456         if (image->p3 == NULL)
03457         {
03458                 fprintf (stderr,
03459                   (_("Error in %s () a NULL pointer was found.\n")),
03460                   __FUNCTION__);
03461                 return (EXIT_FAILURE);
03462         }
03463 #if DEBUG
03464         DXF_DEBUG_END
03465 #endif
03466         return (image->p3->x0);
03467 }
03468 
03469 
03477 DxfImage *
03478 dxf_image_set_x3
03479 (
03480         DxfImage *image,
03482         double x3
03485 )
03486 {
03487 #ifdef DEBUG
03488         DXF_DEBUG_BEGIN
03489 #endif
03490         /* Do some basic checks. */
03491         if (image == NULL)
03492         {
03493                 fprintf (stderr,
03494                   (_("Error in %s () a NULL pointer was passed.\n")),
03495                   __FUNCTION__);
03496                 return (NULL);
03497         }
03498         if (image->p3 == NULL)
03499         {
03500                 fprintf (stderr,
03501                   (_("Error in %s () a NULL pointer was found.\n")),
03502                   __FUNCTION__);
03503                 return (NULL);
03504         }
03505         image->p3->x0 = x3;
03506 #if DEBUG
03507         DXF_DEBUG_END
03508 #endif
03509         return (image);
03510 }
03511 
03512 
03519 double
03520 dxf_image_get_y3
03521 (
03522         DxfImage *image
03524 )
03525 {
03526 #ifdef DEBUG
03527         DXF_DEBUG_BEGIN
03528 #endif
03529 
03530         /* Do some basic checks. */
03531         if (image == NULL)
03532         {
03533                 fprintf (stderr,
03534                   (_("Error in %s () a NULL pointer was passed.\n")),
03535                   __FUNCTION__);
03536                 return (EXIT_FAILURE);
03537         }
03538         if (image->p3 == NULL)
03539         {
03540                 fprintf (stderr,
03541                   (_("Error in %s () a NULL pointer was found.\n")),
03542                   __FUNCTION__);
03543                 return (EXIT_FAILURE);
03544         }
03545 #if DEBUG
03546         DXF_DEBUG_END
03547 #endif
03548         return (image->p3->y0);
03549 }
03550 
03551 
03559 DxfImage *
03560 dxf_image_set_y3
03561 (
03562         DxfImage *image,
03564         double y3
03567 )
03568 {
03569 #ifdef DEBUG
03570         DXF_DEBUG_BEGIN
03571 #endif
03572         /* Do some basic checks. */
03573         if (image == NULL)
03574         {
03575                 fprintf (stderr,
03576                   (_("Error in %s () a NULL pointer was passed.\n")),
03577                   __FUNCTION__);
03578                 return (NULL);
03579         }
03580         if (image->p3 == NULL)
03581         {
03582                 fprintf (stderr,
03583                   (_("Error in %s () a NULL pointer was found.\n")),
03584                   __FUNCTION__);
03585                 return (NULL);
03586         }
03587         image->p3->y0 = y3;
03588 #if DEBUG
03589         DXF_DEBUG_END
03590 #endif
03591         return (image);
03592 }
03593 
03594 
03601 DxfPoint *
03602 dxf_image_get_p4
03603 (
03604         DxfImage *image
03606 )
03607 {
03608 #ifdef DEBUG
03609         DXF_DEBUG_BEGIN
03610 #endif
03611         /* Do some basic checks. */
03612         if (image == NULL)
03613         {
03614                 fprintf (stderr,
03615                   (_("Error in %s () a NULL pointer was passed.\n")),
03616                   __FUNCTION__);
03617                 return (NULL);
03618         }
03619         if (image->p4 == NULL)
03620         {
03621                 fprintf (stderr,
03622                   (_("Error in %s () a NULL pointer was found.\n")),
03623                   __FUNCTION__);
03624                 return (NULL);
03625         }
03626 #if DEBUG
03627         DXF_DEBUG_END
03628 #endif
03629         return (image->p4);
03630 }
03631 
03632 
03639 DxfImage *
03640 dxf_image_set_p4
03641 (
03642         DxfImage *image,
03644         DxfPoint *p4
03646 )
03647 {
03648 #ifdef DEBUG
03649         DXF_DEBUG_BEGIN
03650 #endif
03651         /* Do some basic checks. */
03652         if (image == NULL)
03653         {
03654                 fprintf (stderr,
03655                   (_("Error in %s () a NULL pointer was passed.\n")),
03656                   __FUNCTION__);
03657                 return (NULL);
03658         }
03659         if (p4 == NULL)
03660         {
03661                 fprintf (stderr,
03662                   (_("Error in %s () a NULL pointer was passed.\n")),
03663                   __FUNCTION__);
03664                 return (NULL);
03665         }
03666         image->p4 = p4;
03667 #if DEBUG
03668         DXF_DEBUG_END
03669 #endif
03670         return (image);
03671 }
03672 
03673 
03681 double
03682 dxf_image_get_x4
03683 (
03684         DxfImage *image
03686 )
03687 {
03688 #ifdef DEBUG
03689         DXF_DEBUG_BEGIN
03690 #endif
03691 
03692         /* Do some basic checks. */
03693         if (image == NULL)
03694         {
03695                 fprintf (stderr,
03696                   (_("Error in %s () a NULL pointer was passed.\n")),
03697                   __FUNCTION__);
03698                 return (EXIT_FAILURE);
03699         }
03700         if (image->p4 == NULL)
03701         {
03702                 fprintf (stderr,
03703                   (_("Error in %s () a NULL pointer was found.\n")),
03704                   __FUNCTION__);
03705                 return (EXIT_FAILURE);
03706         }
03707 #if DEBUG
03708         DXF_DEBUG_END
03709 #endif
03710         return (image->p4->x0);
03711 }
03712 
03713 
03721 DxfImage *
03722 dxf_image_set_x4
03723 (
03724         DxfImage *image,
03726         double x4
03729 )
03730 {
03731 #ifdef DEBUG
03732         DXF_DEBUG_BEGIN
03733 #endif
03734         /* Do some basic checks. */
03735         if (image == NULL)
03736         {
03737                 fprintf (stderr,
03738                   (_("Error in %s () a NULL pointer was passed.\n")),
03739                   __FUNCTION__);
03740                 return (NULL);
03741         }
03742         if (image->p4 == NULL)
03743         {
03744                 fprintf (stderr,
03745                   (_("Error in %s () a NULL pointer was found.\n")),
03746                   __FUNCTION__);
03747                 return (NULL);
03748         }
03749         image->p4->x0 = x4;
03750 #if DEBUG
03751         DXF_DEBUG_END
03752 #endif
03753         return (image);
03754 }
03755 
03756 
03764 double
03765 dxf_image_get_y4
03766 (
03767         DxfImage *image
03769 )
03770 {
03771 #ifdef DEBUG
03772         DXF_DEBUG_BEGIN
03773 #endif
03774 
03775         /* Do some basic checks. */
03776         if (image == NULL)
03777         {
03778                 fprintf (stderr,
03779                   (_("Error in %s () a NULL pointer was passed.\n")),
03780                   __FUNCTION__);
03781                 return (EXIT_FAILURE);
03782         }
03783         if (image->p4 == NULL)
03784         {
03785                 fprintf (stderr,
03786                   (_("Error in %s () a NULL pointer was found.\n")),
03787                   __FUNCTION__);
03788                 return (EXIT_FAILURE);
03789         }
03790 #if DEBUG
03791         DXF_DEBUG_END
03792 #endif
03793         return (image->p4->y0);
03794 }
03795 
03796 
03804 DxfImage *
03805 dxf_image_set_y4
03806 (
03807         DxfImage *image,
03809         double y4
03812 )
03813 {
03814 #ifdef DEBUG
03815         DXF_DEBUG_BEGIN
03816 #endif
03817         /* Do some basic checks. */
03818         if (image == NULL)
03819         {
03820                 fprintf (stderr,
03821                   (_("Error in %s () a NULL pointer was passed.\n")),
03822                   __FUNCTION__);
03823                 return (NULL);
03824         }
03825         if (image->p4 == NULL)
03826         {
03827                 fprintf (stderr,
03828                   (_("Error in %s () a NULL pointer was found.\n")),
03829                   __FUNCTION__);
03830                 return (NULL);
03831         }
03832         image->p4->y0 = y4;
03833 #if DEBUG
03834         DXF_DEBUG_END
03835 #endif
03836         return (image);
03837 }
03838 
03839 
03847 int
03848 dxf_image_get_image_display_properties
03849 (
03850         DxfImage *image
03852 )
03853 {
03854 #if DEBUG
03855         DXF_DEBUG_BEGIN
03856 #endif
03857         /* Do some basic checks. */
03858         if (image == NULL)
03859         {
03860                 fprintf (stderr,
03861                   (_("Error in %s () a NULL pointer was passed.\n")),
03862                   __FUNCTION__);
03863                 return (EXIT_FAILURE);
03864         }
03865         if (image->image_display_properties < 0)
03866         {
03867                 fprintf (stderr,
03868                   (_("Warning in %s () a negative value was found in the image_display_properties member.\n")),
03869                   __FUNCTION__);
03870         }
03871         if (image->image_display_properties > 15)
03872         {
03873                 fprintf (stderr,
03874                   (_("Warning in %s () an out of range value was found in the image_display_properties member.\n")),
03875                   __FUNCTION__);
03876         }
03877 #if DEBUG
03878         DXF_DEBUG_END
03879 #endif
03880         return (image->image_display_properties);
03881 }
03882 
03883 
03891 DxfImage *
03892 dxf_image_set_image_display_properties
03893 (
03894         DxfImage *image,
03896         int image_display_properties
03899 )
03900 {
03901 #if DEBUG
03902         DXF_DEBUG_BEGIN
03903 #endif
03904         /* Do some basic checks. */
03905         if (image == NULL)
03906         {
03907                 fprintf (stderr,
03908                   (_("Error in %s () a NULL pointer was passed.\n")),
03909                   __FUNCTION__);
03910                 return (NULL);
03911         }
03912         if (image_display_properties < 0)
03913         {
03914                 fprintf (stderr,
03915                   (_("Error in %s () a negative image_display_properties value was passed.\n")),
03916                   __FUNCTION__);
03917                 return (NULL);
03918         }
03919         if (image_display_properties > 15)
03920         {
03921                 fprintf (stderr,
03922                   (_("Error in %s () an out of range image_display_properties value was passed.\n")),
03923                   __FUNCTION__);
03924                 return (NULL);
03925         }
03926         image->image_display_properties = image_display_properties;
03927 #if DEBUG
03928         DXF_DEBUG_END
03929 #endif
03930         return (image);
03931 }
03932 
03933 
03941 int
03942 dxf_image_get_clipping_boundary_type
03943 (
03944         DxfImage *image
03946 )
03947 {
03948 #if DEBUG
03949         DXF_DEBUG_BEGIN
03950 #endif
03951         /* Do some basic checks. */
03952         if (image == NULL)
03953         {
03954                 fprintf (stderr,
03955                   (_("Error in %s () a NULL pointer was passed.\n")),
03956                   __FUNCTION__);
03957                 return (EXIT_FAILURE);
03958         }
03959         if (image->clipping_boundary_type < 0)
03960         {
03961                 fprintf (stderr,
03962                   (_("Warning in %s () a negative value was found in the clipping_boundary_type member.\n")),
03963                   __FUNCTION__);
03964         }
03965         if (image->clipping_boundary_type > 2)
03966         {
03967                 fprintf (stderr,
03968                   (_("Warning in %s () an out of range value was found in the clipping_boundary_type member.\n")),
03969                   __FUNCTION__);
03970         }
03971 #if DEBUG
03972         DXF_DEBUG_END
03973 #endif
03974         return (image->clipping_boundary_type);
03975 }
03976 
03977 
03985 DxfImage *
03986 dxf_image_set_clipping_boundary_type
03987 (
03988         DxfImage *image,
03990         int clipping_boundary_type
03993 )
03994 {
03995 #if DEBUG
03996         DXF_DEBUG_BEGIN
03997 #endif
03998         /* Do some basic checks. */
03999         if (image == NULL)
04000         {
04001                 fprintf (stderr,
04002                   (_("Error in %s () a NULL pointer was passed.\n")),
04003                   __FUNCTION__);
04004                 return (NULL);
04005         }
04006         if (clipping_boundary_type < 0)
04007         {
04008                 fprintf (stderr,
04009                   (_("Error in %s () a negative clipping_boundary_type value was passed.\n")),
04010                   __FUNCTION__);
04011                 return (NULL);
04012         }
04013         if (clipping_boundary_type > 2)
04014         {
04015                 fprintf (stderr,
04016                   (_("Error in %s () an out of range clipping_boundary_type value was passed.\n")),
04017                   __FUNCTION__);
04018                 return (NULL);
04019         }
04020         image->clipping_boundary_type = clipping_boundary_type;
04021 #if DEBUG
04022         DXF_DEBUG_END
04023 #endif
04024         return (image);
04025 }
04026 
04027 
04034 long
04035 dxf_image_get_class_version
04036 (
04037         DxfImage *image
04039 )
04040 {
04041 #if DEBUG
04042         DXF_DEBUG_BEGIN
04043 #endif
04044         /* Do some basic checks. */
04045         if (image == NULL)
04046         {
04047                 fprintf (stderr,
04048                   (_("Error in %s () a NULL pointer was passed.\n")),
04049                   __FUNCTION__);
04050                 return (EXIT_FAILURE);
04051         }
04052 #if DEBUG
04053         DXF_DEBUG_END
04054 #endif
04055         return (image->class_version);
04056 }
04057 
04058 
04065 DxfImage *
04066 dxf_image_set_class_version
04067 (
04068         DxfImage *image,
04070         long class_version
04072 )
04073 {
04074 #if DEBUG
04075         DXF_DEBUG_BEGIN
04076 #endif
04077         /* Do some basic checks. */
04078         if (image == NULL)
04079         {
04080                 fprintf (stderr,
04081                   (_("Error in %s () a NULL pointer was passed.\n")),
04082                   __FUNCTION__);
04083                 return (NULL);
04084         }
04085         image->class_version = class_version;
04086 #if DEBUG
04087         DXF_DEBUG_END
04088 #endif
04089         return (image);
04090 }
04091 
04092 
04100 long
04101 dxf_image_get_number_of_clip_boundary_vertices
04102 (
04103         DxfImage *image
04105 )
04106 {
04107 #if DEBUG
04108         DXF_DEBUG_BEGIN
04109 #endif
04110         /* Do some basic checks. */
04111         if (image == NULL)
04112         {
04113                 fprintf (stderr,
04114                   (_("Error in %s () a NULL pointer was passed.\n")),
04115                   __FUNCTION__);
04116                 return (EXIT_FAILURE);
04117         }
04118 #if DEBUG
04119         DXF_DEBUG_END
04120 #endif
04121         return (image->number_of_clip_boundary_vertices);
04122 }
04123 
04124 
04132 DxfImage *
04133 dxf_image_set_number_of_clip_boundary_vertices
04134 (
04135         DxfImage *image,
04137         long number_of_clip_boundary_vertices
04140 )
04141 {
04142 #if DEBUG
04143         DXF_DEBUG_BEGIN
04144 #endif
04145         /* Do some basic checks. */
04146         if (image == NULL)
04147         {
04148                 fprintf (stderr,
04149                   (_("Error in %s () a NULL pointer was passed.\n")),
04150                   __FUNCTION__);
04151                 return (NULL);
04152         }
04153         image->number_of_clip_boundary_vertices = number_of_clip_boundary_vertices;
04154 #if DEBUG
04155         DXF_DEBUG_END
04156 #endif
04157         return (image);
04158 }
04159 
04160 
04168 int
04169 dxf_image_get_clipping_state
04170 (
04171         DxfImage *image
04173 )
04174 {
04175 #if DEBUG
04176         DXF_DEBUG_BEGIN
04177 #endif
04178         /* Do some basic checks. */
04179         if (image == NULL)
04180         {
04181                 fprintf (stderr,
04182                   (_("Error in %s () a NULL pointer was passed.\n")),
04183                   __FUNCTION__);
04184                 return (EXIT_FAILURE);
04185         }
04186         if (image->clipping_state < 0)
04187         {
04188                 fprintf (stderr,
04189                   (_("Warning in %s () a negative value was found in the clipping_state member.\n")),
04190                   __FUNCTION__);
04191         }
04192         if (image->clipping_state > 1)
04193         {
04194                 fprintf (stderr,
04195                   (_("Warning in %s () an out of range value was found in the clipping_state member.\n")),
04196                   __FUNCTION__);
04197         }
04198 #if DEBUG
04199         DXF_DEBUG_END
04200 #endif
04201         return (image->clipping_state);
04202 }
04203 
04204 
04212 DxfImage *
04213 dxf_image_set_clipping_state
04214 (
04215         DxfImage *image,
04217         int clipping_state
04220 )
04221 {
04222 #if DEBUG
04223         DXF_DEBUG_BEGIN
04224 #endif
04225         /* Do some basic checks. */
04226         if (image == NULL)
04227         {
04228                 fprintf (stderr,
04229                   (_("Error in %s () a NULL pointer was passed.\n")),
04230                   __FUNCTION__);
04231                 return (NULL);
04232         }
04233         if (clipping_state < 0)
04234         {
04235                 fprintf (stderr,
04236                   (_("Error in %s () a negative clipping_state value was passed.\n")),
04237                   __FUNCTION__);
04238                 return (NULL);
04239         }
04240         if (clipping_state > 1)
04241         {
04242                 fprintf (stderr,
04243                   (_("Error in %s () an out of range clipping_state value was passed.\n")),
04244                   __FUNCTION__);
04245                 return (NULL);
04246         }
04247         image->clipping_state = clipping_state;
04248 #if DEBUG
04249         DXF_DEBUG_END
04250 #endif
04251         return (image);
04252 }
04253 
04254 
04261 int
04262 dxf_image_get_brightness
04263 (
04264         DxfImage *image
04266 )
04267 {
04268 #if DEBUG
04269         DXF_DEBUG_BEGIN
04270 #endif
04271         /* Do some basic checks. */
04272         if (image == NULL)
04273         {
04274                 fprintf (stderr,
04275                   (_("Error in %s () a NULL pointer was passed.\n")),
04276                   __FUNCTION__);
04277                 return (EXIT_FAILURE);
04278         }
04279         if (image->brightness < 0)
04280         {
04281                 fprintf (stderr,
04282                   (_("Warning in %s () a negative value was found in the brightness member.\n")),
04283                   __FUNCTION__);
04284         }
04285         if (image->brightness > 100)
04286         {
04287                 fprintf (stderr,
04288                   (_("Warning in %s () an out of range value was found in the brightness member.\n")),
04289                   __FUNCTION__);
04290         }
04291 #if DEBUG
04292         DXF_DEBUG_END
04293 #endif
04294         return (image->brightness);
04295 }
04296 
04297 
04304 DxfImage *
04305 dxf_image_set_brightness
04306 (
04307         DxfImage *image,
04309         int brightness
04312 )
04313 {
04314 #if DEBUG
04315         DXF_DEBUG_BEGIN
04316 #endif
04317         /* Do some basic checks. */
04318         if (image == NULL)
04319         {
04320                 fprintf (stderr,
04321                   (_("Error in %s () a NULL pointer was passed.\n")),
04322                   __FUNCTION__);
04323                 return (NULL);
04324         }
04325         if (brightness < 0)
04326         {
04327                 fprintf (stderr,
04328                   (_("Error in %s () a negative brightness value was passed.\n")),
04329                   __FUNCTION__);
04330                 return (NULL);
04331         }
04332         if (brightness > 100)
04333         {
04334                 fprintf (stderr,
04335                   (_("Error in %s () an out of range brightness value was passed.\n")),
04336                   __FUNCTION__);
04337                 return (NULL);
04338         }
04339         image->brightness = brightness;
04340 #if DEBUG
04341         DXF_DEBUG_END
04342 #endif
04343         return (image);
04344 }
04345 
04346 
04353 int
04354 dxf_image_get_contrast
04355 (
04356         DxfImage *image
04358 )
04359 {
04360 #if DEBUG
04361         DXF_DEBUG_BEGIN
04362 #endif
04363         /* Do some basic checks. */
04364         if (image == NULL)
04365         {
04366                 fprintf (stderr,
04367                   (_("Error in %s () a NULL pointer was passed.\n")),
04368                   __FUNCTION__);
04369                 return (EXIT_FAILURE);
04370         }
04371         if (image->contrast < 0)
04372         {
04373                 fprintf (stderr,
04374                   (_("Warning in %s () a negative value was found in the contrast member.\n")),
04375                   __FUNCTION__);
04376         }
04377         if (image->contrast > 100)
04378         {
04379                 fprintf (stderr,
04380                   (_("Warning in %s () an out of range value was found in the contrast member.\n")),
04381                   __FUNCTION__);
04382         }
04383 #if DEBUG
04384         DXF_DEBUG_END
04385 #endif
04386         return (image->contrast);
04387 }
04388 
04389 
04396 DxfImage *
04397 dxf_image_set_contrast
04398 (
04399         DxfImage *image,
04401         int contrast
04403 )
04404 {
04405 #if DEBUG
04406         DXF_DEBUG_BEGIN
04407 #endif
04408         /* Do some basic checks. */
04409         if (image == NULL)
04410         {
04411                 fprintf (stderr,
04412                   (_("Error in %s () a NULL pointer was passed.\n")),
04413                   __FUNCTION__);
04414                 return (NULL);
04415         }
04416         if (contrast < 0)
04417         {
04418                 fprintf (stderr,
04419                   (_("Error in %s () a negative contrast value was passed.\n")),
04420                   __FUNCTION__);
04421                 return (NULL);
04422         }
04423         if (contrast > 100)
04424         {
04425                 fprintf (stderr,
04426                   (_("Error in %s () an out of range contrast value was passed.\n")),
04427                   __FUNCTION__);
04428                 return (NULL);
04429         }
04430         image->contrast = contrast;
04431 #if DEBUG
04432         DXF_DEBUG_END
04433 #endif
04434         return (image);
04435 }
04436 
04437 
04444 int
04445 dxf_image_get_fade
04446 (
04447         DxfImage *image
04449 )
04450 {
04451 #if DEBUG
04452         DXF_DEBUG_BEGIN
04453 #endif
04454         /* Do some basic checks. */
04455         if (image == NULL)
04456         {
04457                 fprintf (stderr,
04458                   (_("Error in %s () a NULL pointer was passed.\n")),
04459                   __FUNCTION__);
04460                 return (EXIT_FAILURE);
04461         }
04462         if (image->fade < 0)
04463         {
04464                 fprintf (stderr,
04465                   (_("Warning in %s () a negative value was found in the fade member.\n")),
04466                   __FUNCTION__);
04467         }
04468         if (image->fade > 100)
04469         {
04470                 fprintf (stderr,
04471                   (_("Warning in %s () an out of range value was found in the fade member.\n")),
04472                   __FUNCTION__);
04473         }
04474 #if DEBUG
04475         DXF_DEBUG_END
04476 #endif
04477         return (image->fade);
04478 }
04479 
04480 
04487 DxfImage *
04488 dxf_image_set_fade
04489 (
04490         DxfImage *image,
04492         int fade
04494 )
04495 {
04496 #if DEBUG
04497         DXF_DEBUG_BEGIN
04498 #endif
04499         /* Do some basic checks. */
04500         if (image == NULL)
04501         {
04502                 fprintf (stderr,
04503                   (_("Error in %s () a NULL pointer was passed.\n")),
04504                   __FUNCTION__);
04505                 return (NULL);
04506         }
04507         if (fade < 0)
04508         {
04509                 fprintf (stderr,
04510                   (_("Error in %s () a negative fade value was passed.\n")),
04511                   __FUNCTION__);
04512                 return (NULL);
04513         }
04514         if (fade > 100)
04515         {
04516                 fprintf (stderr,
04517                   (_("Error in %s () an out of range fade value was passed.\n")),
04518                   __FUNCTION__);
04519                 return (NULL);
04520         }
04521         image->fade = fade;
04522 #if DEBUG
04523         DXF_DEBUG_END
04524 #endif
04525         return (image);
04526 }
04527 
04528 
04535 char *
04536 dxf_image_get_imagedef_object
04537 (
04538         DxfImage *image
04540 )
04541 {
04542 #if DEBUG
04543         DXF_DEBUG_BEGIN
04544 #endif
04545         /* Do some basic checks. */
04546         if (image == NULL)
04547         {
04548                 fprintf (stderr,
04549                   (_("Error in %s () a NULL pointer was passed.\n")),
04550                   __FUNCTION__);
04551                 return (NULL);
04552         }
04553         if (image->imagedef_object ==  NULL)
04554         {
04555                 fprintf (stderr,
04556                   (_("Error in %s () a NULL pointer was found in the imagedef_object member.\n")),
04557                   __FUNCTION__);
04558                 return (NULL);
04559         }
04560 #if DEBUG
04561         DXF_DEBUG_END
04562 #endif
04563         return (strdup (image->imagedef_object));
04564 }
04565 
04566 
04573 DxfImage *
04574 dxf_image_set_imagedef_object
04575 (
04576         DxfImage *image,
04578         char *imagedef_object
04581 )
04582 {
04583 #if DEBUG
04584         DXF_DEBUG_BEGIN
04585 #endif
04586         /* Do some basic checks. */
04587         if (image == NULL)
04588         {
04589                 fprintf (stderr,
04590                   (_("Error in %s () a NULL pointer was passed.\n")),
04591                   __FUNCTION__);
04592                 return (NULL);
04593         }
04594         if (imagedef_object == NULL)
04595         {
04596                 fprintf (stderr,
04597                   (_("Error in %s () a NULL pointer was passed.\n")),
04598                   __FUNCTION__);
04599                 return (NULL);
04600         }
04601         image->imagedef_object = strdup (imagedef_object);
04602 #if DEBUG
04603         DXF_DEBUG_END
04604 #endif
04605         return (image);
04606 }
04607 
04608 
04615 char *
04616 dxf_image_get_imagedef_reactor_object
04617 (
04618         DxfImage *image
04620 )
04621 {
04622 #if DEBUG
04623         DXF_DEBUG_BEGIN
04624 #endif
04625         /* Do some basic checks. */
04626         if (image == NULL)
04627         {
04628                 fprintf (stderr,
04629                   (_("Error in %s () a NULL pointer was passed.\n")),
04630                   __FUNCTION__);
04631                 return (NULL);
04632         }
04633         if (image->imagedef_reactor_object ==  NULL)
04634         {
04635                 fprintf (stderr,
04636                   (_("Error in %s () a NULL pointer was found in the imagedef_reactor_object member.\n")),
04637                   __FUNCTION__);
04638                 return (NULL);
04639         }
04640 #if DEBUG
04641         DXF_DEBUG_END
04642 #endif
04643         return (strdup (image->imagedef_reactor_object));
04644 }
04645 
04646 
04653 DxfImage *
04654 dxf_image_set_imagedef_reactor_object
04655 (
04656         DxfImage *image,
04658         char *imagedef_reactor_object
04661 )
04662 {
04663 #if DEBUG
04664         DXF_DEBUG_BEGIN
04665 #endif
04666         /* Do some basic checks. */
04667         if (image == NULL)
04668         {
04669                 fprintf (stderr,
04670                   (_("Error in %s () a NULL pointer was passed.\n")),
04671                   __FUNCTION__);
04672                 return (NULL);
04673         }
04674         if (imagedef_reactor_object == NULL)
04675         {
04676                 fprintf (stderr,
04677                   (_("Error in %s () a NULL pointer was passed.\n")),
04678                   __FUNCTION__);
04679                 return (NULL);
04680         }
04681         image->imagedef_reactor_object = strdup (imagedef_reactor_object);
04682 #if DEBUG
04683         DXF_DEBUG_END
04684 #endif
04685         return (image);
04686 }
04687 
04688 
04697 DxfImage *
04698 dxf_image_get_next
04699 (
04700         DxfImage *image
04702 )
04703 {
04704 #if DEBUG
04705         DXF_DEBUG_BEGIN
04706 #endif
04707         /* Do some basic checks. */
04708         if (image == NULL)
04709         {
04710                 fprintf (stderr,
04711                   (_("Error in %s () a NULL pointer was passed.\n")),
04712                   __FUNCTION__);
04713                 return (NULL);
04714         }
04715         if (image->next == NULL)
04716         {
04717                 fprintf (stderr,
04718                   (_("Error in %s () a NULL pointer was found in the next member.\n")),
04719                   __FUNCTION__);
04720                 return (NULL);
04721         }
04722 #if DEBUG
04723         DXF_DEBUG_END
04724 #endif
04725         return ((DxfImage *) image->next);
04726 }
04727 
04728 
04733 DxfImage *
04734 dxf_image_set_next
04735 (
04736         DxfImage *image,
04738         DxfImage *next
04740 )
04741 {
04742 #if DEBUG
04743         DXF_DEBUG_BEGIN
04744 #endif
04745         /* Do some basic checks. */
04746         if (image == NULL)
04747         {
04748                 fprintf (stderr,
04749                   (_("Error in %s () a NULL pointer was passed.\n")),
04750                   __FUNCTION__);
04751                 return (NULL);
04752         }
04753         if (next == NULL)
04754         {
04755                 fprintf (stderr,
04756                   (_("Error in %s () a NULL pointer was passed.\n")),
04757                   __FUNCTION__);
04758                 return (NULL);
04759         }
04760         image->next = (struct DxfImage *) next;
04761 #if DEBUG
04762         DXF_DEBUG_END
04763 #endif
04764         return (image);
04765 }
04766 
04767 
04776 DxfImage *
04777 dxf_image_get_last
04778 (
04779         DxfImage *image
04781 )
04782 {
04783 #if DEBUG
04784         DXF_DEBUG_BEGIN
04785 #endif
04786         /* Do some basic checks. */
04787         if (image == NULL)
04788         {
04789                 fprintf (stderr,
04790                   (_("Error in %s () a NULL pointer was passed.\n")),
04791                   __FUNCTION__);
04792                 return (NULL);
04793         }
04794         if (image->next == NULL)
04795         {
04796                 fprintf (stderr,
04797                   (_("Warning in %s () a NULL pointer was found in the next member.\n")),
04798                   __FUNCTION__);
04799                 return ((DxfImage *) image);
04800         }
04801         DxfImage *iter = (DxfImage *) image->next;
04802         while (iter->next != NULL)
04803         {
04804                 iter = (DxfImage *) iter->next;
04805         }
04806 #if DEBUG
04807         DXF_DEBUG_END
04808 #endif
04809         return ((DxfImage *) iter);
04810 }
04811 
04812 
04813 /* EOF */