fs_image_r.h
Go to the documentation of this file.
1 
27 #ifndef _FSCRT_IMAGE_R_H_
28 #define _FSCRT_IMAGE_R_H_
29 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 
79 /*******************************************************************************/
80 /* Base definitions for bitmap */
81 /*******************************************************************************/
82 #ifndef _FSCRT_DEF_HANDLE_BITMAP_
83 #define _FSCRT_DEF_HANDLE_BITMAP_
84 
86 FSCRT_DEFINEHANDLE(FSCRT_BITMAP);
87 
88 #endif /* _FSCRT_DEF_HANDLE_BITMAP_ */
89 
90 #ifndef _FSCRT_DEF_MACRO_BITMAPFORMAT_
91 #define _FSCRT_DEF_MACRO_BITMAPFORMAT_
92 
98 #define FSCRT_BITMAPFORMAT_24BPP_BGR 1
99 
100 #define FSCRT_BITMAPFORMAT_32BPP_BGRx 2
101 
102 #define FSCRT_BITMAPFORMAT_32BPP_BGRA 3
103 
104 #define FSCRT_BITMAPFORMAT_8BPP_GRAY 4
105 
106 #define FSCRT_BITMAPFORMAT_24BPP_RGB 5
107 
108 #define FSCRT_BITMAPFORMAT_32BPP_RGBx 6
109 
110 #define FSCRT_BITMAPFORMAT_32BPP_RGBA 7
111 
112 #define FSCRT_BITMAPFORMAT_16BPP_RGB565 8
113 
114 #define FSCRT_BITMAPFORMAT_8BPP_MASK 9
115 
116 #define FSCRT_BITMAPFORMAT_1BPP_RGB 10
117 
119 #endif /* _FSCRT_DEF_MACRO_BITMAPFORMAT_ */
120 
121 #ifndef _FSCRT_DEF_MACRO_ARGB_
122 #define _FSCRT_DEF_MACRO_ARGB_
123 
129 #define FSCRT_ARGB_Encode(a,r,g,b) ((((FS_DWORD)(((FS_BYTE)(b) | ((FS_DWORD)((FS_BYTE)(g)) << 8)) | (((FS_DWORD)(FS_BYTE)(r)) << 16)))) | (((FS_DWORD)(FS_BYTE)(a)) << 24))
130 
131 #define FSCRT_ARGB_GetAValue(argb) ((FS_BYTE)(((FS_DWORD)(argb)) >> 24))
132 
133 #define FSCRT_ARGB_GetRValue(argb) ((FS_BYTE)(((FS_DWORD)(argb)) >> 16))
134 
135 #define FSCRT_ARGB_GetGValue(argb) ((FS_BYTE)(((FS_DWORD)(argb)) >> 8))
136 
137 #define FSCRT_ARGB_GetBValue(argb) ((FS_BYTE)(argb))
138 
140 #endif /* _FSCRT_DEF_MACRO_ARGB_ */
141 
142 #ifndef _FSCRT_DEF_MACRO_INTERPOLATION_
143 #define _FSCRT_DEF_MACRO_INTERPOLATION_
144 
150 #define FSCRT_INTERPOLATION_DOWNSAMPLE 0x04
151 
152 #define FSCRT_INTERPOLATION_QUADRATIC 0x20
153 
154 #define FSCRT_INTERPOLATION_BICUBIC 0x80
155 
156 #endif /* _FSCRT_DEF_MACRO_INTERPOLATION_ */
157 
158 #ifndef _FSCRT_DEF_MACRO_BITMAPBBOX_
159 #define _FSCRT_DEF_MACRO_BITMAPBBOX_
160 
166 #define FSCRT_BITMAPBBOX_DETECTION 0
167 
168 #define FSCRT_BITMAPBBOX_BACKCOLOR 1
169 
171 #endif /* _FSCRT_DEF_MACRO_BITMAPBBOX_ */
172 
173 #ifndef _FSCRT_DEF_STRUCTURE_BITMAPINFOHEADER_
174 #define _FSCRT_DEF_STRUCTURE_BITMAPINFOHEADER_
175 
179 typedef struct _FSCRT_BITMAPINFOHEADER
180 {
208 
209 #endif /* _FSCRT_DEF_STRUCTURE_BITMAPINFOHEADER_ */
210 
211 #ifndef _FSCRT_DEF_STRUCTURE_RGBQUAD_
212 #define _FSCRT_DEF_STRUCTURE_RGBQUAD_
213 
217 typedef struct _FSCRT_RGBQUAD
218 {
227 } FSCRT_RGBQUAD;
228 
229 #endif /* _FSCRT_DEF_STRUCTURE_RGBQUAD_ */
230 
231 #ifndef _FSCRT_DEF_STRUCTURE_BITMAPINFO_
232 #define _FSCRT_DEF_STRUCTURE_BITMAPINFO_
233 
237 typedef struct _FSCRT_BITMAPINFO
238 {
242  FSCRT_RGBQUAD bmiColors[1];
244 
245 #endif /* _FSCRT_DEF_STRUCTURE_BITMAPINFO_ */
246 
247 /*******************************************************************************/
248 /* Bitmap access */
249 /*******************************************************************************/
286 FS_RESULT FSCRT_Bitmap_Create(FS_INT32 width, FS_INT32 height, FS_INT32 format, FS_LPVOID buffer, FS_INT32 stride, FSCRT_BITMAP* bitmap);
287 
309 FS_RESULT FSCRT_Bitmap_Release(FSCRT_BITMAP bitmap);
310 
337 FS_RESULT FSCRT_Bitmap_FillRect(FSCRT_BITMAP bitmap, FS_ARGB color, const FSCRT_RECT* fillRect);
338 
359 FS_RESULT FSCRT_Bitmap_GetFormat(FSCRT_BITMAP bitmap, FS_INT32* format);
360 
381 FS_RESULT FSCRT_Bitmap_GetSize(FSCRT_BITMAP bitmap, FS_INT32* width, FS_INT32* height);
382 
407 FS_RESULT FSCRT_Bitmap_GetLineBuffer(FSCRT_BITMAP bitmap, FS_INT32 lineIndex, FS_LPVOID* buffer);
408 
428 FS_RESULT FSCRT_Bitmap_GetLineStride(FSCRT_BITMAP bitmap, FS_INT32* stride);
429 
457 FS_RESULT FSCRT_Bitmap_GetFlipped(FSCRT_BITMAP srcBitmap, FS_BOOL flipX, FS_BOOL flipY, FSCRT_BITMAP* dstBitmap);
458 
488 FS_RESULT FSCRT_Bitmap_StretchTo(FSCRT_BITMAP srcBitmap,
489  FSCRT_BITMAP dstBitmap, FS_INT32 dstLeft, FS_INT32 dstTop, FS_INT32 dstWidth, FS_INT32 dstHeight,
490  const FSCRT_RECT* dstClipRect, FS_INT32 interpolation);
491 
518 FS_RESULT FSCRT_Bitmap_TransformTo(FSCRT_BITMAP srcBitmap,
519  FSCRT_BITMAP dstBitmap, const FSCRT_MATRIX* matrix,
520  const FSCRT_RECT* dstClipRect, FS_INT32 interpolation);
521 
544 FS_RESULT FSCRT_Bitmap_ConvertFormat(FSCRT_BITMAP bitmap, FS_INT32 format);
545 
567 FS_RESULT FSCRT_Bitmap_Clone(FSCRT_BITMAP bitmap, FSCRT_BITMAP* clonedBitmap);
568 
602 FS_RESULT FSCRT_Bitmap_GetBitmapInfo(FSCRT_BITMAP bitmap, FSCRT_BITMAPINFO* bitmapInfo, FS_DWORD* size);
603 
628 FS_RESULT FSCRT_Bitmap_CalcBBox(FSCRT_BITMAP bitmap, FS_INT32 flag, FS_ARGB backColor, FS_INT32 windowSize, FS_INT32 tolerance, FSCRT_RECT* rectBBox);
629 
656 FS_RESULT FSCRT_Bitmap_GetMask(FSCRT_BITMAP bitmap, FSCRT_BITMAP* mask);
657 
658 /*******************************************************************************/
659 /* Image access */
660 /*******************************************************************************/
661 #ifndef _FSCRT_DEF_HANDLE_IMAGE_
662 #define _FSCRT_DEF_HANDLE_IMAGE_
663 
665 FSCRT_DEFINEHANDLE(FSCRT_IMAGE);
666 
667 #endif /* _FSCRT_DEF_HANDLE_IMAGE_ */
668 
669 #ifndef _FSCRT_DEF_HANDLE_IMAGEFILE_
670 #define _FSCRT_DEF_HANDLE_IMAGEFILE_
671 
673 FSCRT_DEFINEHANDLE(FSCRT_IMAGEFILE);
674 
675 #endif /* _FSCRT_DEF_HANDLE_IMAGEFILE_ */
676 
677 #ifndef _FSCRT_DEF_MACRO_IMAGETYPE_
678 #define _FSCRT_DEF_MACRO_IMAGETYPE_
679 
685 #define FSCRT_IMAGETYPE_BMP 1
686 
687 #define FSCRT_IMAGETYPE_JPG 2
688 
689 #define FSCRT_IMAGETYPE_PNG 3
690 
691 #define FSCRT_IMAGETYPE_GIF 4
692 
693 #define FSCRT_IMAGETYPE_TIF 5
694 
695 #define FSCRT_IMAGETYPE_JPX 6
696 
699 #define FSCRT_IMAGETYPE_JBIG2 8
700 
702 #endif /* _FSCRT_DEF_MACRO_IMAGETYPE_ */
703 
704 #ifndef _FSCRT_DEF_MACRO_IMAGEPROPERTY_
705 #define _FSCRT_DEF_MACRO_IMAGEPROPERTY_
706 
718 #define FSCRT_IMAGEPROPERTY_DPI "dpi"
719 
721 #endif /* _FSCRT_DEF_MACRO_IMAGEPROPERTY_ */
722 
749 FS_RESULT FSCRT_Image_LoadFromFile(FSCRT_FILE imageFile, FSCRT_IMAGE* image);
750 
771 FS_RESULT FSCRT_Image_GetType(FSCRT_IMAGE image, FS_INT32* type);
772 
795 FS_RESULT FSCRT_Image_GetSize(FSCRT_IMAGE image, FS_INT32* width, FS_INT32* height);
796 
817 FS_RESULT FSCRT_Image_CountFrames(FSCRT_IMAGE image, FS_INT32* count);
818 
844 FS_RESULT FSCRT_Image_LoadFrame(FSCRT_IMAGE image, FS_INT32 frameIndex);
845 
869 FS_RESULT FSCRT_Image_GetCurrentFrameSize(FSCRT_IMAGE image, FS_INT32* width, FS_INT32* height);
870 
896 FS_RESULT FSCRT_Image_GetCurrentFrameBitmap(FSCRT_IMAGE image, FSCRT_BITMAP* bitmap);
897 
924 FS_RESULT FSCRT_Image_GetProperty(FSCRT_IMAGE image, const FSCRT_BSTR* property, FSCRT_VAR* values, FS_INT32* count);
925 
945 FS_RESULT FSCRT_Image_Release(FSCRT_IMAGE image);
946 
947 #ifdef __cplusplus
948 };
949 #endif
950  /* group FSIMAGE */
952 
953 #endif /* _FSCRT_IMAGE_R_H_ */
FS_RESULT FSCRT_Bitmap_GetMask(FSCRT_BITMAP bitmap, FSCRT_BITMAP *mask)
Get the mask bitmap of a bitmap.
FS_RESULT FSCRT_Bitmap_GetBitmapInfo(FSCRT_BITMAP bitmap, FSCRT_BITMAPINFO *bitmapInfo, FS_DWORD *size)
Get bitmap information from a given Foxit DIB.
FS_RESULT FSCRT_Image_CountFrames(FSCRT_IMAGE image, FS_INT32 *count)
Count frames of an image.
Structure for rectangle, in integer.
Definition: fs_base_r.h:2056
FS_RESULT FSCRT_Image_GetCurrentFrameSize(FSCRT_IMAGE image, FS_INT32 *width, FS_INT32 *height)
Get width and height of the current frame.
FS_BYTE rgbRed
The intensity of red in the color.
Definition: fs_image_r.h:224
FS_INT32 height
The height of a bitmap, in pixels.
Definition: fs_image_r.h:186
FS_RESULT FSCRT_Image_GetType(FSCRT_IMAGE image, FS_INT32 *type)
Get an image type.
FS_RESULT FSCRT_Image_LoadFromFile(FSCRT_FILE imageFile, FSCRT_IMAGE *image)
Load an image from an image file.
FS_DWORD sizeImage
The size of an image, in bytes.
Definition: fs_image_r.h:194
FS_RESULT FSCRT_Bitmap_FillRect(FSCRT_BITMAP bitmap, FS_ARGB color, const FSCRT_RECT *fillRect)
Fill a bitmap object with a specified color.
unsigned int FS_DWORD
32-bit unsigned integer.
Definition: fs_base_r.h:142
Structure for dimensions and color information of a device-independent bitmap(DIB).
Definition: fs_image_r.h:237
FS_RESULT FSCRT_Bitmap_Create(FS_INT32 width, FS_INT32 height, FS_INT32 format, FS_LPVOID buffer, FS_INT32 stride, FSCRT_BITMAP *bitmap)
Create a bitmap.
FS_RESULT FSCRT_Bitmap_StretchTo(FSCRT_BITMAP srcBitmap, FSCRT_BITMAP dstBitmap, FS_INT32 dstLeft, FS_INT32 dstTop, FS_INT32 dstWidth, FS_INT32 dstHeight, const FSCRT_RECT *dstClipRect, FS_INT32 interpolation)
Stretch the source bitmap into a new bitmap with different size.
FS_BYTE rgbGreen
The intensity of green in the color.
Definition: fs_image_r.h:222
int FS_INT32
32-bit signed integer.
Definition: fs_base_r.h:175
FS_RESULT FSCRT_Bitmap_GetFormat(FSCRT_BITMAP bitmap, FS_INT32 *format)
Get format of a bitmap object.
FS_BYTE rgbReserved
This member is reserved and shall be zero.
Definition: fs_image_r.h:226
unsigned short FS_WORD
16-bit unsigned integer.
Definition: fs_base_r.h:139
int FS_BOOL
Boolean type (This should be TRUE or FALSE).
Definition: fs_base_r.h:133
FS_INT32 yPelsPerMeter
Reserved. The vertical resolution, in pixels per meter, of the target device for the bitmap...
Definition: fs_image_r.h:198
Structure for variant definitions.
Definition: fs_base_r.h:369
Structure for a color consisting of relative intensities of red, green, and blue. ...
Definition: fs_image_r.h:217
unsigned char FS_BYTE
An unsigned byte integer (8 bits).
Definition: fs_base_r.h:136
FS_RESULT FSCRT_Bitmap_GetFlipped(FSCRT_BITMAP srcBitmap, FS_BOOL flipX, FS_BOOL flipY, FSCRT_BITMAP *dstBitmap)
Swap X/Y dimensions of a bitmap object to generate rotated one.
FS_RESULT FSCRT_Image_GetProperty(FSCRT_IMAGE image, const FSCRT_BSTR *property, FSCRT_VAR *values, FS_INT32 *count)
Get properties of an image.
void * FS_LPVOID
A pointer to any types.
Definition: fs_base_r.h:127
FS_INT32 xPelsPerMeter
Reserved. The horizontal resolution, in pixels per meter, of the target device for the bitmap...
Definition: fs_image_r.h:196
FS_RESULT FSCRT_Image_GetCurrentFrameBitmap(FSCRT_IMAGE image, FSCRT_BITMAP *bitmap)
Retrieve the bitmap of the current frame.
FS_WORD planes
The number of planes for a target device. This value must be set to 1.
Definition: fs_image_r.h:188
FS_RESULT FSCRT_Bitmap_GetLineStride(FSCRT_BITMAP bitmap, FS_INT32 *stride)
Get a row stride of the bitmap.
unsigned int FS_ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_base_r.h:145
Structure for information about dimensions and color format of a device-independent bitmap (DIB)...
Definition: fs_image_r.h:179
FS_INT32 width
The width of a bitmap, in pixels.
Definition: fs_image_r.h:184
FS_RESULT FSCRT_Bitmap_GetSize(FSCRT_BITMAP bitmap, FS_INT32 *width, FS_INT32 *height)
Get the size of a bitmap object.
Structure for 2D matrix.
Definition: fs_base_r.h:2130
Structure for byte string.
Definition: fs_base_r.h:611
FS_DWORD size
The number of bytes required by the structure.
Definition: fs_image_r.h:182
FS_RESULT FSCRT_Image_GetSize(FSCRT_IMAGE image, FS_INT32 *width, FS_INT32 *height)
Get width and height of an image.
FS_WORD bitCount
The number of bits per pixel (bpp).
Definition: fs_image_r.h:190
FS_DWORD clrImportant
The number of color indicates which is important for displaying a bitmap.
Definition: fs_image_r.h:206
FS_BYTE rgbBlue
The intensity of blue in the color.
Definition: fs_image_r.h:220
FSCRT_BITMAPINFOHEADER bmiHeader
A FSCRT_BITMAPINFOHEADER structure that contains information about dimensions and color formats of a ...
Definition: fs_image_r.h:240
FS_RESULT FSCRT_Image_LoadFrame(FSCRT_IMAGE image, FS_INT32 frameIndex)
Load an image frame by index.
FS_RESULT FSCRT_Bitmap_GetLineBuffer(FSCRT_BITMAP bitmap, FS_INT32 lineIndex, FS_LPVOID *buffer)
Get a line buffer of a bitmap object.
FS_RESULT FSCRT_Bitmap_ConvertFormat(FSCRT_BITMAP bitmap, FS_INT32 format)
Convert a bitmap to another specific format.
FS_RESULT FSCRT_Bitmap_Release(FSCRT_BITMAP bitmap)
Destroy a bitmap and release related resources.
FS_RESULT FSCRT_Image_Release(FSCRT_IMAGE image)
Release an image object.
FS_DWORD clrUsed
The number of color indices in the color table which are actually used by the bitmap.
Definition: fs_image_r.h:200
FS_RESULT FSCRT_Bitmap_CalcBBox(FSCRT_BITMAP bitmap, FS_INT32 flag, FS_ARGB backColor, FS_INT32 windowSize, FS_INT32 tolerance, FSCRT_RECT *rectBBox)
Calculate the bounding box of a bitmap.
FS_RESULT FSCRT_Bitmap_TransformTo(FSCRT_BITMAP srcBitmap, FSCRT_BITMAP dstBitmap, const FSCRT_MATRIX *matrix, const FSCRT_RECT *dstClipRect, FS_INT32 interpolation)
Transform a source bitmap into destination one.
int FS_RESULT
Result code for functions in Foxit PDF SDK.
Definition: fs_base_r.h:160
FS_DWORD compression
The type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed)...
Definition: fs_image_r.h:192
FS_RESULT FSCRT_Bitmap_Clone(FSCRT_BITMAP bitmap, FSCRT_BITMAP *clonedBitmap)
Clone a bitmap.

Foxit Corporation