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

thumbnail.c File Reference

Functions for a DXF thumbnail (THUMBNAIL). More...

#include "thumbnail.h"
Include dependency graph for thumbnail.c:

Go to the source code of this file.

Functions

DxfThumbnaildxf_thumbnail_new ()
 Allocate memory for a DXF THUMBNAILIMAGE.
DxfThumbnaildxf_thumbnail_init (DxfThumbnail *thumbnail)
 Allocate memory and initialize data fields in a DXF THUMBNAILIMAGE entity.
DxfThumbnaildxf_thumbnail_read (DxfFile *fp, DxfThumbnail *thumbnail)
 Read data from a DXF file into a DXF THUMBNAILIMAGE entity.
int dxf_thumbnail_write (DxfFile *fp, DxfThumbnail *thumbnail)
 Write a thumbnail to a DXF file.
int dxf_thumbnail_free (DxfThumbnail *thumbnail)
 Free the allocated memory for a DXF THUMBNAILIMAGE and all it's data fields.

Detailed Description

Functions for a DXF thumbnail (THUMBNAIL).

Author:
Copyright (C) 2010, 2012, 2014, 2015, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.
Copyright (C) 2010 by Luis Matos <gass@otiliamatos.ath.cx>.

Copyright Notices.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to:
Free Software Foundation, Inc.,
59 Temple Place,
Suite 330,
Boston,
MA 02111 USA.

Drawing eXchange Format (DXF) is a defacto industry standard for the exchange of drawing files between various Computer Aided Drafting programs.
DXF is an industry standard designed by Autodesk(TM).
For more details see http://www.autodesk.com.


Definition in file thumbnail.c.


Function Documentation

DxfThumbnail* dxf_thumbnail_new ( )

Allocate memory for a DXF THUMBNAILIMAGE.

Fill the memory contents with zeros.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13 (backward compatibility).
According to DXF R14 (backward compatibility).
According to DXF R2000.
According to DXF R2000i.
According to DXF R2002.
According to DXF R2004.
According to DXF R2005.
According to DXF R2006.
According to DXF R2008.
According to DXF R2009.
According to DXF R2010.
According to DXF R2011.
According to DXF R2012.
According to DXF R2013.
According to DXF R2014.

Definition at line 69 of file thumbnail.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_thumbnail_init(), and dxf_thumbnail_read().

DxfThumbnail* dxf_thumbnail_init ( DxfThumbnail thumbnail)

Allocate memory and initialize data fields in a DXF THUMBNAILIMAGE entity.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13 (backward compatibility).
According to DXF R14 (backward compatibility).
According to DXF R2000.
According to DXF R2000i.
According to DXF R2002.
According to DXF R2004.
According to DXF R2005.
According to DXF R2006.
According to DXF R2008.
According to DXF R2009.
According to DXF R2010.
According to DXF R2011.
According to DXF R2012.
According to DXF R2013.
According to DXF R2014.
Parameters:
thumbnailDXF thumbnailimage entity.

Definition at line 126 of file thumbnail.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_MAX_PARAM, dxf_thumbnail_new(), dxf_thumbnail::number_of_bytes, and dxf_thumbnail::preview_image_data.

Referenced by dxf_drawing_init(), and dxf_thumbnail_read().

Here is the call graph for this function:

DxfThumbnail* dxf_thumbnail_read ( DxfFile fp,
DxfThumbnail thumbnail 
)

Read data from a DXF file into a DXF THUMBNAILIMAGE entity.

The last line read from file contained the string "THUMBNAILIMAGE".
Now follows some data for the THUMBNAILIMAGE, to be terminated with a " 0" string announcing the following entity, or the end of the ENTITY section marker ENDSEC.
While parsing the DXF file store data in thumbnail.

Returns:
a pointer to thumbnail.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13 (backward compatibility).
According to DXF R14 (backward compatibility).
According to DXF R2000.
According to DXF R2000i.
According to DXF R2002.
According to DXF R2004.
According to DXF R2005.
According to DXF R2006.
According to DXF R2008.
According to DXF R2009.
According to DXF R2010.
According to DXF R2011.
According to DXF R2012.
According to DXF R2013.
According to DXF R2014.
Parameters:
fpDXF file pointer to an input file (or device).
thumbnailDXF thumbnailimage entity.

Definition at line 195 of file thumbnail.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_2000, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_thumbnail_init(), dxf_thumbnail_new(), dxf_file_struct::filename, dxf_file_struct::fp, dxf_file_struct::line_number, dxf_thumbnail::number_of_bytes, and dxf_thumbnail::preview_image_data.

Here is the call graph for this function:

int dxf_thumbnail_write ( DxfFile fp,
DxfThumbnail thumbnail 
)

Write a thumbnail to a DXF file.

Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13 (backward compatibility).
According to DXF R14 (backward compatibility).
According to DXF R2000.
According to DXF R2000i.
According to DXF R2002.
According to DXF R2004.
According to DXF R2005.
According to DXF R2006.
According to DXF R2008.
According to DXF R2009.
According to DXF R2010.
According to DXF R2011.
According to DXF R2012.
According to DXF R2013.
According to DXF R2014.
Parameters:
fpDXF file pointer to an output file (or device).
thumbnailthe thumbnail to write to the output file.

Definition at line 319 of file thumbnail.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_2000, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_file_struct::fp, dxf_thumbnail::number_of_bytes, and dxf_thumbnail::preview_image_data.

int dxf_thumbnail_free ( DxfThumbnail thumbnail)

Free the allocated memory for a DXF THUMBNAILIMAGE and all it's data fields.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13 (backward compatibility).
According to DXF R14 (backward compatibility).
According to DXF R2000.
According to DXF R2000i.
According to DXF R2002.
According to DXF R2004.
According to DXF R2005.
According to DXF R2006.
According to DXF R2008.
According to DXF R2009.
According to DXF R2010.
According to DXF R2011.
According to DXF R2012.
According to DXF R2013.
According to DXF R2014.
Parameters:
thumbnailPointer to the memory occupied by the DXF THUMBNAILIMAGE entity.

Definition at line 412 of file thumbnail.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_MAX_PARAM, and dxf_thumbnail::preview_image_data.

Referenced by dxf_drawing_free().