Foxit PDF SDK
|
Public Member Functions | |
def | Bitmap () |
Constructor, as an empty bitmap object. | |
def | Bitmap (other) |
Constructor, with another bitmap object. More... | |
def | CalculateBBoxByColor (backgroud_color) |
Calculate the bounding box according to the given background color. More... | |
def | Clone (clip_rect) |
Clone current bitmap, with specified clip rectangle. More... | |
def | ConvertFormat (format, icc_transform) |
Convert a bitmap to another specified DIB format. More... | |
def | DetectBBoxByColorDiffer (detection_size, color_differ) |
Detect the bounding box of content according to the given color difference between content and margin. More... | |
def | FillRect (color, rect) |
Fill current bitmap with a specified color. More... | |
def | Flip (is_flip_horz, is_flip_vert) |
Flip bitmap. More... | |
def | GetBpp () |
Get bitmap bits-per-pixel. More... | |
def | GetBuffer () |
Get bitmap buffer. More... | |
def | GetFormat () |
Get bitmap format. More... | |
def | GetHeight () |
Get bitmap height. More... | |
def | GetMask (clip_rect) |
Get the mask if bitmap has mask. More... | |
def | GetPitch () |
Get bitmap pitch. More... | |
def | GetWidth () |
Get bitmap width. More... | |
def | IsEmpty () |
Check whether current object is empty or not. More... | |
def | StretchTo (dest_width, dest_height, flag, clip_rect) |
Stretch with different size. More... | |
def | SwapXY (is_flip_horz, is_flip_vert, clip_rect) |
Swap X,Y coordinations of the bitmap. After being swapped, the image can also be flipped at the same time. More... | |
def | TransformTo (matrix, flag, out_left, out_top, clip_rect) |
Transform current bitmap (as source bitmap) into destination one. More... | |
Static Public Attributes | |
e_Bicubic = _fsdk.Bitmap_e_Bicubic | |
If set, do bicubic interpolation for stretching or transforming. | |
e_DIB1bpp = _fsdk.Bitmap_e_DIB1bpp | |
DIB format: 1bpp format, two color RGB bitmap.It does not support format conversion and rendering. | |
e_DIB8bpp = _fsdk.Bitmap_e_DIB8bpp | |
DIB format: 8bpp format, 256 color RGB bitmap. | |
e_DIB8bppGray = _fsdk.Bitmap_e_DIB8bppGray | |
DIB format: 8bpp format, 256 color GrayScale bitmap. | |
e_DIB8bppMask = _fsdk.Bitmap_e_DIB8bppMask | |
DIB format: 8bpp alpha mask. | |
e_DIBAbgr = _fsdk.Bitmap_e_DIBAbgr | |
DIB format: 32bpp format, with bits order "Red, Green, Blue, Alpha". Red is in the lowest order. | |
e_DIBArgb = _fsdk.Bitmap_e_DIBArgb | |
DIB format: 32bpp format, with bits order "Blue, Green, Red, Alpha". Blue is in the lowest order. | |
e_DIBCmyk = _fsdk.Bitmap_e_DIBCmyk | |
DIB format: 32bpp CMYK format, with bits order "Cyan, Magenta, Yellow, Black". Cyan is in the lowest order. | |
e_DIBRgb = _fsdk.Bitmap_e_DIBRgb | |
DIB format: 24bpp format, with bits order "Blue, Green, Red". Blue is in the lowest order. | |
e_DIBRgb32 = _fsdk.Bitmap_e_DIBRgb32 | |
DIB format: 32bpp format, with bits order "Blue, Green, Red, not used". Blue is in the lowest order. | |
e_DIBRgb565 = _fsdk.Bitmap_e_DIBRgb565 | |
16bpp format, bits order: Red 5 bits, Green 6 bits, Blue 5 bits. Red is the lowest order. | |
e_Quadratic = _fsdk.Bitmap_e_Quadratic | |
If set, do interpolation for stretching or transforming. | |
Bitmap is one of most important data structures in Foxit PDF SDK. It is commonly used for rendering. This class can construct a new bitmap object (not retrieved from other object) and offer methods to get information or operate the bitmap.
def FoxitPDFSDKPython2.Bitmap.Bitmap | ( | other | ) |
Constructor, with another bitmap object.
[in] | other | Another bitmap object. |
def FoxitPDFSDKPython2.Bitmap.CalculateBBoxByColor | ( | backgroud_color | ) |
Calculate the bounding box according to the given background color.
This function can support the following formats:
FoxitPDFSDKPython2.Bitmap.e_DIB8bppMask , FoxitPDFSDKPython2.Bitmap.e_DIB8bpp , FoxitPDFSDKPython2.Bitmap.e_DIBRgb , FoxitPDFSDKPython2.Bitmap.e_DIBRgb32 , FoxitPDFSDKPython2.Bitmap.e_DIBArgb .
[in] | backgroud_color | A valid background color. Format: 0xAARRGGBB. |
def FoxitPDFSDKPython2.Bitmap.Clone | ( | clip_rect | ) |
Clone current bitmap, with specified clip rectangle.
[in] | clip_rect | The clipping region in current bitmap to specify the region to be cloned.
|
def FoxitPDFSDKPython2.Bitmap.ConvertFormat | ( | format, | |
icc_transform | |||
) |
Convert a bitmap to another specified DIB format.
[in] | format | New bitmap format type. It should be one of following values: FoxitPDFSDKPython2.Bitmap.e_DIB8bppMask , FoxitPDFSDKPython2.Bitmap.e_DIB8bpp , FoxitPDFSDKPython2.Bitmap.e_DIBRgb , FoxitPDFSDKPython2.Bitmap.e_DIBRgb32 , FoxitPDFSDKPython2.Bitmap.e_DIBArgb . FoxitPDFSDKPython2.Bitmap.e_DIBRgb565 . |
[in] | icc_transform | The color mapping context for source format to destination format. It can be null, which means not use the color mapping. |
def FoxitPDFSDKPython2.Bitmap.DetectBBoxByColorDiffer | ( | detection_size, | |
color_differ | |||
) |
Detect the bounding box of content according to the given color difference between content and margin.
This function can support the following formats:
FoxitPDFSDKPython2.Bitmap.e_DIB8bppMask , FoxitPDFSDKPython2.Bitmap.e_DIB8bpp , FoxitPDFSDKPython2.Bitmap.e_DIBRgb , FoxitPDFSDKPython2.Bitmap.e_DIBRgb32 , FoxitPDFSDKPython2.Bitmap.e_DIBArgb .
[in] | detection_size | Detection size to analyze background. |
[in] | color_differ | Color difference used to detect margin. The value should be between 0 and 255, and the suggested value is 64. |
def FoxitPDFSDKPython2.Bitmap.FillRect | ( | color, | |
rect | |||
) |
Fill current bitmap with a specified color.
This function can not support the following format:
FoxitPDFSDKPython2.Bitmap.e_DIBCmyk .
[in] | color | A color value which is used to fill bitmap. Format: 0xAARRGGBB |
[in] | rect | A rectangle that represents a region in bitmap to specify where the color will be filled. This can be null, which means to fill the whole bitmap. |
def FoxitPDFSDKPython2.Bitmap.Flip | ( | is_flip_horz, | |
is_flip_vert | |||
) |
Flip bitmap.
This function can support following formats:
FoxitPDFSDKPython2.Bitmap.e_DIB8bppMask , FoxitPDFSDKPython2.Bitmap.e_DIB8bpp , FoxitPDFSDKPython2.Bitmap.e_DIBRgb , FoxitPDFSDKPython2.Bitmap.e_DIBRgb32 , FoxitPDFSDKPython2.Bitmap.e_DIBArgb .
[in] | is_flip_horz | A boolean value to indicate whether to flip bitmap in horizontal direction: true means a bitmap will be flipped in horizontal direction, and false means not. |
[in] | is_flip_vert | A boolean value to indicate whether to flip bitmap in vertical direction. true means a bitmap will be flipped in vertical direction, and false means not. |
def FoxitPDFSDKPython2.Bitmap.GetBpp | ( | ) |
Get bitmap bits-per-pixel.
def FoxitPDFSDKPython2.Bitmap.GetBuffer | ( | ) |
Get bitmap buffer.
Bitmap data are organized in scan-lines, from top to down.
def FoxitPDFSDKPython2.Bitmap.GetFormat | ( | ) |
Get bitmap format.
def FoxitPDFSDKPython2.Bitmap.GetHeight | ( | ) |
Get bitmap height.
def FoxitPDFSDKPython2.Bitmap.GetMask | ( | clip_rect | ) |
Get the mask if bitmap has mask.
[in] | clip_rect | The clipping region of current bitmap (as source bitmap). It can be null. |
def FoxitPDFSDKPython2.Bitmap.GetPitch | ( | ) |
Get bitmap pitch.
def FoxitPDFSDKPython2.Bitmap.GetWidth | ( | ) |
Get bitmap width.
def FoxitPDFSDKPython2.Bitmap.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
def FoxitPDFSDKPython2.Bitmap.StretchTo | ( | dest_width, | |
dest_height, | |||
flag, | |||
clip_rect | |||
) |
Stretch with different size.
If parameter dest_width or parameter dest_height is negative, the bitmap will be flipped. If the stretching is to be done in down-sample mode, that would be much faster than not to be done in down-sample mode, especially when stretching big bitmaps into small ones. Optionally a clipping region in result bitmap coordinate can be specified to limit the size of result bitmap. This function can not support the following format:
FoxitPDFSDKPython2.Bitmap.e_DIBCmyk .
[in] | dest_width | The width of the destination bitmap. |
[in] | dest_height | The height of the destination bitmap. |
[in] | flag | Stretch flag, It should be value FoxitPDFSDKPython2.Bitmap.e_Downsample or FoxitPDFSDKPython2.Bitmap.e_Quadratic . |
[in] | clip_rect | The clipping region of destination bitmap. It can be null. |
def FoxitPDFSDKPython2.Bitmap.SwapXY | ( | is_flip_horz, | |
is_flip_vert, | |||
clip_rect | |||
) |
Swap X,Y coordinations of the bitmap. After being swapped, the image can also be flipped at the same time.
This function can support following formats:
FoxitPDFSDKPython2.Bitmap.e_DIB8bppMask , FoxitPDFSDKPython2.Bitmap.e_DIB8bpp , FoxitPDFSDKPython2.Bitmap.e_DIBRgb , FoxitPDFSDKPython2.Bitmap.e_DIBRgb32 , FoxitPDFSDKPython2.Bitmap.e_DIBArgb . Optionally a clipping region (in destination bitmap coordinate) can be specified to limit the size of result.
Suppose the original image has the following 4 pixels:
+---+---+ | 1 | 2 | +---+---+ | 3 | 4 | +---+---+
Then, depends on parameter is_flip_horz and is_flip_vert, the result would look like: if parameter is_flip_horz = false, parameter is_flip_vert = false:
+---+---+ | 1 | 3 | +---+---+ | 2 | 4 | +---+---+
if parameter is_flip_horz = true, parameter is_flip_vert = false:
+---+---+ | 3 | 1 | +---+---+ | 4 | 2 | +---+---+
if parameter is_flip_horz = false, parameter is_flip_vert = true:
+---+---+ | 2 | 4 | +---+---+ | 1 | 3 | +---+---+
if parameter is_flip_horz = true, parameter is_flip_vert = true:
+---+---+ | 4 | 2 | +---+---+ | 3 | 1 | +---+---+
[in] | is_flip_horz | A boolean value to indicate whether to flip bitmap in horizontal direction: true means the bitmap will be flipped in horizontal direction, and false means not. |
[in] | is_flip_vert | A boolean value to indicate whether to flip bitmap in vertical direction: true means the bitmap will be flipped in vertical direction, and false means not. |
[in] | clip_rect | The clipping region of destination bitmap. This can be null, which means the whole bitmap. |
def FoxitPDFSDKPython2.Bitmap.TransformTo | ( | matrix, | |
flag, | |||
out_left, | |||
out_top, | |||
clip_rect | |||
) |
Transform current bitmap (as source bitmap) into destination one.
The dimension of returned bitmap always match the dimension of the matrix. If the transformation is to be done in down- sample mode, that would be much faster than not to be done in down-sample mode, especially when transforming big images into small ones. Optionally a clipping region in result bitmap coordinate can be specified to limit the size of result bitmap. The position of left-top corner (in destination coordinate) of the result bitmap would be returned as well. This function can not support the following format:
FoxitPDFSDKPython2.Bitmap.e_DIBCmyk .
[in] | matrix | The transformation matrix. |
[in] | flag | Transform flag. It should be value FoxitPDFSDKPython2.Bitmap.e_Downsample or FoxitPDFSDKPython2.Bitmap.e_Quadratic . |
[out] | out_left | Output parameter that receives x-coordinate of the left-top corner of the result bitmap in destination coordinate. |
[out] | out_top | Output parameter that receives y-coordinate of the left-top corner of the result bitmap in destination coordinate. |
[in] | clip_rect | The clipping region of destination bitmap. It can be null. |