CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiImage.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef __ODGIIMAGE_H__
25#define __ODGIIMAGE_H__
26
27#include "GiExport.h"
28#include "UInt32Array.h"
29#include "RxObject.h"
30
31#include "TD_PackPush.h"
32
33// ODCOLORREF is RGBA32
34
44{
45 public:
50 {
51 m_bgra = ODRGBA(0, 0, 0, 255);
52 }
53
61 : m_bgra(bgra)
62 {
63 }
64
74 {
75 m_bgra = ODRGBA(blue, green, red, alpha);
76 }
77
84 OdUInt32 getBGRA() const;
85
92 OdUInt32 getRGBA() const;
93
100 OdUInt8 blue() const;
101
108 OdUInt8 green() const;
109
116 OdUInt8 red() const;
117
124 OdUInt8 alpha() const;
125
131 void setBGRA(OdUInt32 bgra);
132
141 void setBGRA(OdUInt8 blue,
142 OdUInt8 green,
143 OdUInt8 red,
144 OdUInt8 alpha);
145
151 void setRGBA(OdUInt32 rgba);
152
161 void setRGBA(OdUInt8 red,
162 OdUInt8 green,
164 OdUInt8 alpha);
165
171 void setBlue(OdUInt8 blue);
172
178 void setGreen(OdUInt8 green);
179
185 void setRed(OdUInt8 red);
186
192 void setAlpha(OdUInt8 alpha);
193 private:
194 OdUInt32 m_bgra;
195};
196
201{
202 return m_bgra;
203}
204
209{
210 return ODRGBA(ODGETBLUE(m_bgra), ODGETGREEN(m_bgra), ODGETRED(m_bgra), ODGETALPHA(m_bgra));
211}
212
217{
218 return ODGETRED(m_bgra);
219}
220
225{
226 return ODGETGREEN(m_bgra);
227}
228
233{
234 return ODGETBLUE(m_bgra);
235}
236
241{
242 return ODGETALPHA(m_bgra);
243}
244
249{
250 m_bgra = bgra;
251}
252
257 OdUInt8 green,
258 OdUInt8 red,
260{
261 m_bgra = ODRGBA(blue, green, red, alpha);
262}
263
268{
269 m_bgra = ODRGBA(ODGETBLUE(rgba), ODGETGREEN(rgba), ODGETRED(rgba), ODGETALPHA(rgba));
270}
271
276 OdUInt8 green,
279{
280 m_bgra = ODRGBA(blue, green, red, alpha);
281}
282
287{
288 m_bgra = ODRGBA(blue, ODGETGREEN(m_bgra), ODGETBLUE(m_bgra), ODGETALPHA(m_bgra));
289}
290
295{
296 m_bgra = ODRGBA(ODGETRED(m_bgra), green, ODGETBLUE(m_bgra), ODGETALPHA(m_bgra));
297}
298
303{
304 m_bgra = ODRGBA(ODGETRED(m_bgra), ODGETGREEN(m_bgra), red, ODGETALPHA(m_bgra));
305}
306
311{
312 m_bgra = ODRGBA(ODGETRED(m_bgra), ODGETGREEN(m_bgra), ODGETBLUE(m_bgra), alpha);
313}
314
324{
325 public:
330 : m_pImageData(NULL)
331 , m_nImageWidth(0)
332 , m_nImageHeight(0)
333 {
334 }
335
343 OdGiImageBGRA32(OdUInt32 imageWidth, OdUInt32 imageHeight, OdGiPixelBGRA32* imageData)
344 : m_pImageData(imageData)
345 , m_nImageWidth(imageWidth)
346 , m_nImageHeight(imageHeight)
347 {
348 }
349
356 OdGiPixelBGRA32* image() const;
357
364 OdUInt32 width() const;
365
372 OdUInt32 height() const;
373
381 void setImage(OdUInt32 imageWidth,
382 OdUInt32 imageHeight,
383 OdGiPixelBGRA32* imageData);
384 private:
385 OdGiPixelBGRA32* m_pImageData;
386 OdUInt32 m_nImageWidth;
387 OdUInt32 m_nImageHeight;
388};
389
394{
395 return m_pImageData;
396}
397
402{
403 return m_nImageWidth;
404}
405
410{
411 return m_nImageHeight;
412}
413
417inline void OdGiImageBGRA32::setImage(OdUInt32 imageWidth,
418 OdUInt32 imageHeight,
419 OdGiPixelBGRA32* imageData)
420{
421 m_nImageWidth = imageWidth;
422 m_nImageHeight = imageHeight;
423 m_pImageData = imageData;
424}
425
430
431#include "TD_PackPop.h"
432
433#endif // __ODGIIMAGE_H__
OdArray< OdGiPixelBGRA32, OdMemoryAllocator< OdGiPixelBGRA32 > > OdGiPixelBGRA32Array
Definition: GiImage.h:429
#define ODGETBLUE(rgb)
Definition: OdPlatform.h:939
#define ODGETGREEN(rgb)
Definition: OdPlatform.h:938
#define ODRGBA(r, g, b, a)
Definition: OdPlatform.h:935
#define ODGETALPHA(rgba)
Definition: OdPlatform.h:940
#define ODGETRED(rgb)
Definition: OdPlatform.h:937
unsigned int OdUInt32
unsigned char OdUInt8
OdUInt32 height() const
Definition: GiImage.h:409
void setImage(OdUInt32 imageWidth, OdUInt32 imageHeight, OdGiPixelBGRA32 *imageData)
Definition: GiImage.h:417
OdGiImageBGRA32(OdUInt32 imageWidth, OdUInt32 imageHeight, OdGiPixelBGRA32 *imageData)
Definition: GiImage.h:343
OdUInt32 width() const
Definition: GiImage.h:401
OdGiPixelBGRA32 * image() const
Definition: GiImage.h:393
OdUInt8 green() const
Definition: GiImage.h:224
OdUInt8 alpha() const
Definition: GiImage.h:240
void setGreen(OdUInt8 green)
Definition: GiImage.h:294
OdGiPixelBGRA32(OdUInt8 blue, OdUInt8 green, OdUInt8 red, OdUInt8 alpha)
Definition: GiImage.h:73
OdGiPixelBGRA32(OdUInt32 bgra)
Definition: GiImage.h:60
OdUInt8 red() const
Definition: GiImage.h:232
void setBGRA(OdUInt32 bgra)
Definition: GiImage.h:248
void setRGBA(OdUInt32 rgba)
Definition: GiImage.h:267
void setAlpha(OdUInt8 alpha)
Definition: GiImage.h:310
void setRed(OdUInt8 red)
Definition: GiImage.h:302
void setBlue(OdUInt8 blue)
Definition: GiImage.h:286
OdUInt8 blue() const
Definition: GiImage.h:216
OdUInt32 getBGRA() const
Definition: GiImage.h:200
OdUInt32 getRGBA() const
Definition: GiImage.h:208
GLfloat GLfloat GLfloat alpha
Definition: gles2_ext.h:147
GLfloat GLfloat blue
Definition: gles2_ext.h:147
GLfloat green
Definition: gles2_ext.h:147