CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
RxRasterServices.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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// RxRasterServices.h - interface of module, performing different operations on raster images
25
26#ifndef __OD_RASTER_MODULE__
27#define __OD_RASTER_MODULE__
28
29#include "RxModule.h"
30#include "DbRootExport.h"
31#include "UInt32Array.h"
32#include "TDVersion.h"
33class OdGiRasterImage;
35
36#include "TD_PackPush.h"
37
39#ifndef lit_
40#define lit_ 0x20 // ' '
41#define lit_0 0x30 // '0'
42#define lit_1 0x31 // '1'
43#define lit_2 0x32 // '2'
44#define lit_3 0x33 // '3'
45#define lit_4 0x34 // '4'
46#define lit_5 0x35 // '5'
47#define lit_6 0x36 // '6'
48#define lit_7 0x37 // '7'
49#define lit_8 0x38 // '8'
50#define lit_9 0x39 // '9'
51#define lit_A 0x41 // 'A'
52#define lit_B 0x42 // 'B'
53#define lit_C 0x43 // 'C'
54#define lit_D 0x44 // 'D'
55#define lit_E 0x45 // 'E'
56#define lit_F 0x46 // 'F'
57#define lit_G 0x47 // 'G'
58#define lit_H 0x48 // 'H'
59#define lit_I 0x49 // 'I'
60#define lit_J 0x4A // 'J'
61#define lit_K 0x4B // 'K'
62#define lit_L 0x4C // 'L'
63#define lit_M 0x4D // 'M'
64#define lit_N 0x4E // 'N'
65#define lit_O 0x4F // 'O'
66#define lit_P 0x50 // 'P'
67#define lit_Q 0x51 // 'Q'
68#define lit_R 0x52 // 'R'
69#define lit_S 0x53 // 'S'
70#define lit_T 0x54 // 'T'
71#define lit_U 0x55 // 'U'
72#define lit_V 0x56 // 'V'
73#define lit_W 0x57 // 'W'
74#define lit_X 0x58 // 'X'
75#define lit_Y 0x59 // 'Y'
76#define lit_Z 0X5A // 'Z'
77#define lit_a 0x61 // 'a'
78#define lit_b 0x62 // 'b'
79#define lit_c 0x63 // 'c'
80#define lit_d 0x64 // 'd'
81#define lit_e 0x65 // 'e'
82#define lit_f 0x66 // 'f'
83#define lit_g 0x67 // 'g'
84#define lit_h 0x68 // 'h'
85#define lit_i 0x69 // 'i'
86#define lit_j 0x6A // 'j'
87#define lit_k 0x6B // 'k'
88#define lit_l 0x6C // 'l'
89#define lit_m 0x6D // 'm'
90#define lit_n 0x6E // 'n'
91#define lit_o 0x6F // 'o'
92#define lit_p 0x70 // 'p'
93#define lit_q 0x71 // 'q'
94#define lit_r 0x72 // 'r'
95#define lit_s 0x73 // 's'
96#define lit_t 0x74 // 't'
97#define lit_u 0x75 // 'u'
98#define lit_v 0x76 // 'v'
99#define lit_w 0x77 // 'w'
100#define lit_x 0x78 // 'x'
101#define lit_y 0x79 // 'y'
102#define lit_z 0x7A // 'z'
103#endif // lit_
105
106#ifndef OD_FOURCC
107#ifndef ODA_BIGENDIAN
108 #if defined(OD_SWIGCSHARP) || defined(OD_SWIGJAVA)
109 #define OD_FOURCC(a, b, c, d) (((long)(d) << 24) | ((long)(c) << 16) | ((long)(b) << 8) | ((long)(a)))
110 #else
111 #define OD_FOURCC(a, b, c, d) (((OdUInt32)(d) << 24) | ((OdUInt32)(c) << 16) | ((OdUInt32)(b) << 8) | ((OdUInt32)(a)))
112 #endif
113#else
114 #if defined(OD_SWIGCSHARP) || defined(OD_SWIGJAVA)
115 #define OD_FOURCC(a, b, c, d) (((long)(a) << 24) | ((long)(b) << 16) | ((long)(c) << 8) | ((long)(d)))
116 #else
117 #define OD_FOURCC(a, b, c, d) (((OdUInt32)(a) << 24) | ((OdUInt32)(b) << 16) | ((OdUInt32)(c) << 8) | ((OdUInt32)(d)))
118 #endif
119#endif
120#endif // OD_FOURCC
121
129{
130public:
131 // Predefined image types
133 {
171 };
172
173 // Loading flags
175 {
176 // Specify loading format explicitly
178 // Avoids post-reorientation of TIFF format images
180 };
181
182 // Saving flags
184 {
185 // Specify palette index of transparent color (-1 - by default)
187
188 // Jpeg compression quality (default depends from implementation)
190
191 // Tiff compression format (no compression by default)
198 kTiffCompressionEmbedded = OD_FOURCC(lit_E, lit_M, lit_B, lit_D), // ODA extension for IbEnabler, actually it is CCITFax4 compression
199
200 //dithering flag
202 kDitheringFS = OD_FOURCC(lit_D, lit_T, lit_F, lit_S), // Floyd & Steinberg error diffusion
203 kDitheringBayer4x4 = OD_FOURCC(lit_B, lit_Y, lit_R, lit_4), // Bayer ordered dispersed dot dithering (order 2 dithering matrix)
204 kDitheringBayer8x8 = OD_FOURCC(lit_B, lit_Y, lit_R, lit_8), // Bayer ordered dispersed dot dithering (order 3 dithering matrix)
205 kDitheringBayer16x16 = OD_FOURCC(lit_B, lit_R, lit_1, lit_6), // Bayer ordered dispersed dot dithering (order 4 dithering matrix)
206 kDitheringCluster6x6 = OD_FOURCC(lit_C, lit_L, lit_R, lit_6), // Ordered clustered dot dithering (order 3 - 6x6 matrix)
207 kDitheringCluster8x8 = OD_FOURCC(lit_C, lit_L, lit_R, lit_8), // Ordered clustered dot dithering (order 4 - 8x8 matrix)
208 kDitheringCluster16x16 = OD_FOURCC(lit_C, lit_L, lit_1, lit_6), // Ordered clustered dot dithering (order 8 - 16x16 matrix)
209
210 //rescale flags
212 kRescaleBox = OD_FOURCC(lit_B, lit_O, lit_X, lit_ ), // Box, pulse, Fourier window, 1st order (constant) b-spline
213 kRescaleBicubic = OD_FOURCC(lit_B, lit_C, lit_B, lit_C), // Mitchell & Netravali's two-param cubic filter
215 kRescaleBspline = OD_FOURCC(lit_B, lit_S, lit_P, lit_L), // 4th order (cubic) b-spline
216 kRescaleCatmullrom = OD_FOURCC(lit_C, lit_T, lit_M, lit_L), // Catmull-Rom spline, Overhauser spline
220 //Note: rescaling converts bitional images to 8-bit images, so to keep the image bitional after rescale, the dithering flags must be in flag chain.
221
222 // color quantization algorithm flag (is usable for FIF_GIF with colorDepth() > 8)
224 kQuantizeWU = OD_FOURCC(lit_W, lit_U, lit_C, lit_Q), // Xiaolin Wu color quantization algorithm (is default)
225 kQuantizeNN = OD_FOURCC(lit_N, lit_N, lit_Q, lit_ ), // NeuQuant neural-net quantization algorithm by Anthony Dekker
226 kQuantizeLFP = OD_FOURCC(lit_L, lit_F, lit_P, lit_Q) // Lossless Fast Pseudo-Quantization Algorithm by Carsten Klein
227 };
228
230
239 virtual OdGiRasterImagePtr loadRasterImage(const OdString &filename, const OdUInt32 *pFlagsChain = NULL) = 0;
240
250 virtual OdGiRasterImagePtr loadRasterImage(OdStreamBuf *pStreamBuf, const OdUInt32 *pFlagsChain = NULL) = 0;
251
260
267 virtual bool saveRasterImage(const OdGiRasterImage* rasterImage, const OdString& filename,
268 const OdUInt32 *pFlagsChain = NULL) = 0;
269
277 virtual bool saveRasterImage(const OdGiRasterImage* rasterImage, const OdString& filename,
278 OdUInt32 type, const OdUInt32 *pFlagsChain = NULL) = 0;
279
287 virtual bool convertRasterImage(const OdGiRasterImage* pRaster, OdUInt32 type,
288 OdStreamBuf* pStreamBuf, const OdUInt32 *pFlagsChain = NULL) = 0;
289
298 virtual bool convertRasterImage(OdStreamBuf* pSrcStream, OdStreamBuf* pDstStream, OdUInt32 type,
299 const OdUInt32 *pFlagsChainSrc = NULL, const OdUInt32 *pFlagsChainDst = NULL) = 0;
300
305
311
317 virtual OdString mapTypeToExtension(OdUInt32 type, OdString* psFilterName) const = 0;
318
323 virtual OdUInt32 mapExtensionToType(const OdString& extension) const = 0;
324
329 virtual OdUInt32 getImageFormat(const OdString &filename) const = 0;
330
335 virtual OdUInt32 getImageFormat(OdStreamBuf* pStreamBuf) const = 0;
336};
337
342
344#ifdef lit_
345#undef lit_ // ' '
346#undef lit_0 // '0'
347#undef lit_1 // '1'
348#undef lit_2 // '2'
349#undef lit_3 // '3'
350#undef lit_4 // '4'
351#undef lit_5 // '5'
352#undef lit_6 // '6'
353#undef lit_7 // '7'
354#undef lit_8 // '8'
355#undef lit_9 // '9'
356#undef lit_A // 'A'
357#undef lit_B // 'B'
358#undef lit_C // 'C'
359#undef lit_D // 'D'
360#undef lit_E // 'E'
361#undef lit_F // 'F'
362#undef lit_G // 'G'
363#undef lit_H // 'H'
364#undef lit_I // 'I'
365#undef lit_J // 'J'
366#undef lit_K // 'K'
367#undef lit_L // 'L'
368#undef lit_M // 'M'
369#undef lit_N // 'N'
370#undef lit_O // 'O'
371#undef lit_P // 'P'
372#undef lit_Q // 'Q'
373#undef lit_R // 'R'
374#undef lit_S // 'S'
375#undef lit_T // 'T'
376#undef lit_U // 'U'
377#undef lit_V // 'V'
378#undef lit_W // 'W'
379#undef lit_X // 'X'
380#undef lit_Y // 'Y'
381#undef lit_Z // 'Z'
382#undef lit_a // 'a'
383#undef lit_b // 'b'
384#undef lit_c // 'c'
385#undef lit_d // 'd'
386#undef lit_e // 'e'
387#undef lit_f // 'f'
388#undef lit_g // 'g'
389#undef lit_h // 'h'
390#undef lit_i // 'i'
391#undef lit_j // 'j'
392#undef lit_k // 'k'
393#undef lit_l // 'l'
394#undef lit_m // 'm'
395#undef lit_n // 'n'
396#undef lit_o // 'o'
397#undef lit_p // 'p'
398#undef lit_q // 'q'
399#undef lit_r // 'r'
400#undef lit_s // 's'
401#undef lit_t // 't'
402#undef lit_u // 'u'
403#undef lit_v // 'v'
404#undef lit_w // 'w'
405#undef lit_x // 'x'
406#undef lit_y // 'y'
407#undef lit_z // 'z'
408#endif // lit_
410
411#include "TD_PackPop.h"
412
413#endif // __OD_RASTER_MODULE__
OdSmartPtr< OdGiRasterImage > OdGiRasterImagePtr
Definition DbLayout.h:36
unsigned int OdUInt32
#define ODRX_ABSTRACT
#define FIRSTDLL_EXPORT
Definition RootExport.h:39
#define lit_C
OdSmartPtr< OdGiRasterImage > OdGiRasterImagePtr
#define lit_R
#define lit_6
#define lit_H
#define lit_D
#define lit_T
#define lit_Z
OdSmartPtr< OdRxRasterServices > OdRxRasterServicesPtr
#define lit_3
#define lit_O
#define lit_X
#define lit_J
#define lit_G
#define lit_8
#define lit_4
#define lit_B
#define lit_2
#define lit_S
#define lit_P
#define lit_A
#define lit_L
#define lit_W
#define OD_FOURCC(a, b, c, d)
#define lit_F
#define lit_N
#define lit_1
#define lit_
#define lit_M
#define lit_K
#define lit_Q
#define lit_Y
#define lit_U
#define lit_I
#define lit_E
OdArray< OdUInt32, OdMemoryAllocator< OdUInt32 > > OdUInt32Array
Definition UInt32Array.h:35
virtual bool saveRasterImage(const OdGiRasterImage *rasterImage, const OdString &filename, OdUInt32 type, const OdUInt32 *pFlagsChain=NULL)=0
virtual OdString mapTypeToExtension(OdUInt32 type, OdString *psFilterName) const =0
virtual OdUInt32 getImageFormat(OdStreamBuf *pStreamBuf) const =0
virtual OdGiRasterImagePtr loadRasterImage(const OdString &filename, const OdUInt32 *pFlagsChain=NULL)=0
virtual bool convertRasterImage(OdStreamBuf *pSrcStream, OdStreamBuf *pDstStream, OdUInt32 type, const OdUInt32 *pFlagsChainSrc=NULL, const OdUInt32 *pFlagsChainDst=NULL)=0
virtual OdGiRasterImagePtr createRasterImage(void *pImp)
virtual OdUInt32 getImageFormat(const OdString &filename) const =0
ODRX_DECLARE_MEMBERS(OdRxRasterServices)
virtual bool isRasterImageTypeSupported(OdUInt32 type) const
virtual OdGiRasterImagePtr loadRasterImage(OdStreamBuf *pStreamBuf, const OdUInt32 *pFlagsChain=NULL)=0
virtual bool saveRasterImage(const OdGiRasterImage *rasterImage, const OdString &filename, const OdUInt32 *pFlagsChain=NULL)=0
virtual bool convertRasterImage(const OdGiRasterImage *pRaster, OdUInt32 type, OdStreamBuf *pStreamBuf, const OdUInt32 *pFlagsChain=NULL)=0
virtual OdUInt32 mapExtensionToType(const OdString &extension) const =0
virtual OdUInt32Array getRasterImageTypes() const =0
GLuint GLsizei GLsizei GLint GLenum * type
Definition gles2_ext.h:274