1 //
2 // Color profile class for the CUPS PPD Compiler.
3 //
4 // Copyright © 2020-2024 by OpenPrinting.
5 // Copyright 2007-2009 by Apple Inc.
6 // Copyright 2002-2005 by Easy Software Products.
7 //
8 // Licensed under Apache License v2.0. See the file "LICENSE" for more information.
9 //
10
11 //
12 // Include necessary headers...
13 //
14
15 #include "ppdc-private.h"
16
17
18 //
19 // 'ppdcProfile::ppdcProfile()' - Create a color profile.
20 //
21
ppdcProfile(const char * r,const char * m,float d,float g,const float * p)22 ppdcProfile::ppdcProfile(const char *r, // I - Resolution name
23 const char *m, // I - Media type name
24 float d, // I - Density
25 float g, // I - Gamma
26 const float *p) // I - 3x3 transform matrix
27 : ppdcShared()
28 {
29 PPDC_NEW;
30
31 resolution = new ppdcString(r);
32 media_type = new ppdcString(m);
33 density = d;
34 gamma = g;
35
36 memcpy(profile, p, sizeof(profile));
37 }
38
39
40 //
41 // 'ppdcProfile::~ppdcProfile()' - Destroy a color profile.
42 //
43
~ppdcProfile()44 ppdcProfile::~ppdcProfile()
45 {
46 PPDC_DELETE;
47
48 resolution->release();
49 media_type->release();
50 }
51