|
blit
|
Binary raster operations. More...

Go to the source code of this file.
Macros | |
| #define | S (fetch) |
| 8-bit source operand. | |
| #define | D (store) |
| 8-bit destination operand. | |
| #define | ROP_REV_POLISH(revPolish, x) |
| Macro to define a raster operation function. | |
Typedefs | |
| typedef blit_scanline_t(* | blit_rop2_func_t) (blit_scanline_t fetch, blit_scanline_t store) |
| Type definition for raster operation function pointer. | |
Functions | |
| ROP_REV_POLISH (0, 0x00U) | |
| Raster operation: 0. | |
| ROP_REV_POLISH (DSon, ~(D|S)) | |
| Raster operation: NOT (D OR S). | |
| ROP_REV_POLISH (DSna, D &~S) | |
| Raster operation: D AND NOT S. | |
| ROP_REV_POLISH (Sn, ~S) | |
| Raster operation: NOT S. | |
| ROP_REV_POLISH (SDna, S &~D) | |
| Raster operation: S AND NOT D. | |
| ROP_REV_POLISH (Dn, ~D) | |
| Raster operation: NOT D. | |
| ROP_REV_POLISH (DSx, D ^ S) | |
| Raster operation: D XOR S. | |
| ROP_REV_POLISH (DSan, ~(D &S)) | |
| Raster operation: NOT (D AND S). | |
| ROP_REV_POLISH (DSa, D &S) | |
| Raster operation: D AND S. | |
| ROP_REV_POLISH (DSxn, ~(D ^ S)) | |
| Raster operation: NOT (D XOR S). | |
| ROP_REV_POLISH (D, D) | |
| Raster operation: D. | |
| ROP_REV_POLISH (DSno, D|~S) | |
| Raster operation: D OR NOT S. | |
| ROP_REV_POLISH (S, S) | |
| Raster operation: S. | |
| ROP_REV_POLISH (SDno, S|~D) | |
| Raster operation: S OR NOT D. | |
| ROP_REV_POLISH (DSo, D|S) | |
| Raster operation: D OR S. | |
| ROP_REV_POLISH (1, 0xffU) | |
| Raster operation: 1. | |
| bool | blit_rgn1_rop2 (struct blit_scan *result, struct blit_rgn1 *x, struct blit_rgn1 *y, const struct blit_scan *source, enum blit_rop2 rop2) |
| Perform raster operation with masking and store the result. | |
| bool | blit_rop2 (struct blit_scan *result, const int x, const int y, const int x_extent, const int y_extent, const struct blit_scan *source, const int x_source, const int y_source, enum blit_rop2 rop2) |
| Convenience inline function for performing raster operations. | |
Binary raster operations.
This source file implements the functions for performing binary raster operations on scan structures, as declared in the blit/rop2.h header file. These operations combine source and destination pixel values using bitwise operations. The implementation includes functions for various raster operations, such as copy, invert, and, or, xor, and others.
Definition in file rop2.c.
| #define ROP_REV_POLISH | ( | revPolish, | |
| x | |||
| ) |
Macro to define a raster operation function.
The macro ROP_REV_POLISH is used to define the raster operation functions below. Each function takes a fetch function to get the source operand (S) and a pointer to the destination operand (D). The operations are defined using standard bitwise operations.
The defined raster operations include:
Each operation is implemented as a static function returning the result of the specified bitwise expression.
| revPolish | The reverse polish notation name of the raster operation. |
| x | The expression defining the raster operation using D and S. |
| typedef blit_scanline_t(* blit_rop2_func_t) (blit_scanline_t fetch, blit_scanline_t store) |
Type definition for raster operation function pointer.
This type defines a function pointer for raster operation functions. Each raster operation function takes two 8-bit operands: the source operand (fetch) and the destination operand (store). The function returns an 8-bit result of the raster operation.
| bool blit_rgn1_rop2 | ( | struct blit_scan * | result, |
| struct blit_rgn1 * | x, | ||
| struct blit_rgn1 * | y, | ||
| const struct blit_scan * | source, | ||
| enum blit_rop2 | rop2 | ||
| ) |
Perform raster operation with masking and store the result.
This function performs a raster operation defined by the rop2 parameter on a specified region of the source and destination scan structures. It uses one-dimensional region structures for both the x and y axes to define the area of operation. The function handles phase alignment of the source data to ensure correct bit alignment during the operation.
| result | Pointer to the destination scan structure. |
| x | Pointer to the one-dimensional region structure for the x-axis. |
| y | Pointer to the one-dimensional region structure for the y-axis. |
| source | Pointer to the source scan structure. |
| rop2 | The raster operation code. |
| bool blit_rop2 | ( | struct blit_scan * | result, |
| const int | x, | ||
| const int | y, | ||
| const int | x_extent, | ||
| const int | y_extent, | ||
| const struct blit_scan * | source, | ||
| const int | x_source, | ||
| const int | y_source, | ||
| enum blit_rop2 | rop2 | ||
| ) |
Convenience inline function for performing raster operations.
This inline function provides a convenient way to perform raster operations on specified regions of the source and destination scan structures. It constructs one-dimensional region structures for both the x and y axes based on the provided parameters and then calls the blit_rgn1_rop2 function to perform the operation.
Use this version when you don't need to inspect the modified region structures that carry the clipped origins and extents. They are created on the stack and passed to the underlying function.
| result | Pointer to the destination scan structure. |
| x | The x-coordinate of the origin of the region in the destination. |
| y | The y-coordinate of the origin of the region in the destination. |
| x_extent | The extent of the region in the x-axis. |
| y_extent | The extent of the region in the y-axis. |
| source | Pointer to the source scan structure. |
| x_source | The x-coordinate of the origin of the region in the source. |
| y_source | The y-coordinate of the origin of the region in the source. |
| rop2 | The raster operation code to apply. |