InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PNGArt.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: kphilbri
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __PNGART_H__
25 #define __PNGART_H__
26 
27 #include "BravoForwardDecl.h"
28 #include "IDFile.h"
29 #include "IArt.h"
30 
31 class IGraphicsPort;
32 
33 #ifdef PUBLIC_BUILD
34 #endif
35 
36 class PNGArt : public IArt
37 {
38 public :
39  PNGArt ();
40 
43  ~PNGArt ();
44 
58  bool SetRsrc (const PluginID & pid, const RsrcID & rid, const bool isRollOver, const bool isDark = false, const float scaleFactor = 1.0, const float iconScale = 2.0);
59  bool SetRsrc (const RsrcSpec& spec, const float scaleFactor = 1.0, const float iconScale = 2.0); // all decisions (light/dark/rollover/hiRes/etc.) resolved by caller
60 
67  bool SetFile (const IDFile& idFile, const float scaleFactor = 1.0, const float iconScale = 2.0);
68 
75  void Draw (IGraphicsPort * gPort, const PMMatrix &imMatrix, int32 agmflags);
76 
79  void DrawDisabled (IGraphicsPort * gPort, const PMMatrix &imMatrix, int32 agmflags);
80 
84  bool HasAlpha ();
85 
89  bool IsLoaded ();
90 
93  void Delete ();
94 
97  int GetHeight () const;
98 
101  int GetWidth () const;
102 
106  static void ReleasePNGSharedCaches (void);
107 
110  AGMImageRecord* GetBitmap () const;
111 
112 private :
113 
114  AGMImageRecord *fBitmap;
115  float fScaleFactor;
116 
117  bool8 ReadPNGImage(IPMStream* iPMStream, AGMImageRecord * bitmap);
118 };
119 
120 #ifdef PUBLIC_BUILD
121 #endif
122 
123 #endif