blit
Loading...
Searching...
No Matches
Enumerations | Functions
rop2.h File Reference

Binary raster operations. More...

#include <blit/rgn1.h>
#include <blit/scan.h>
Include dependency graph for rop2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  blit_rop2 {
  blit_rop2_0 , blit_rop2_DSon , blit_rop2_DSna , blit_rop2_Sn ,
  blit_rop2_SDna , blit_rop2_Dn , blit_rop2_DSx , blit_rop2_DSan ,
  blit_rop2_DSa , blit_rop2_DSxn , blit_rop2_D , blit_rop2_DSno ,
  blit_rop2_S , blit_rop2_SDno , blit_rop2_DSo , blit_rop2_1 ,
  blit_rop2_not_erase = blit_rop2_DSon , blit_rop2_not_copy = blit_rop2_Sn , blit_rop2_erase = blit_rop2_SDna , blit_rop2_xor = blit_rop2_DSx ,
  blit_rop2_and = blit_rop2_DSa , blit_rop2_merge_paint = blit_rop2_DSno , blit_rop2_copy = blit_rop2_S , blit_rop2_paint = blit_rop2_DSo ,
  blit_rop2_blackness = blit_rop2_0 , blit_rop2_invert = blit_rop2_Sn , blit_rop2_whiteness = blit_rop2_1
}
 Enumeration of binary raster operation codes. More...
 

Functions

int 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.
 
int 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.
 

Detailed Description

Binary raster operations.

This header file declares the enumeration of binary raster operation codes used in graphics operations, as well as the function prototype for performing raster operations on scan structures. These operations combine source and destination pixel values using bitwise operations.

Definition in file rop2.h.

Enumeration Type Documentation

◆ blit_rop2

enum blit_rop2

Enumeration of binary raster operation codes.

This enumeration defines various binary raster operation codes used in graphics operations. Each code corresponds to a specific raster operation that combines source and destination pixel values using bitwise operations.

Definition at line 27 of file rop2.h.

Function Documentation

◆ blit_rgn1_rop2()

int 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.

Parameters
resultPointer to the destination scan structure.
xPointer to the one-dimensional region structure for the x-axis.
yPointer to the one-dimensional region structure for the y-axis.
sourcePointer to the source scan structure.
rop2The raster operation code.
Returns
The number of logic operations performed. This includes all operations performed on the destination scan space, including those that may not have resulted in a change to the pixel values (e.g., operations that resulted in the same value being written back to the destination). It includes partial operations on the first and last bytes of each scanline, which may have been masked to only affect certain bits. The count reflects the total number of operations attempted based on the region and raster operation specified, regardless of the actual changes made to the pixel data.

Definition at line 185 of file rop2.c.

◆ blit_rop2()

int 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.

Parameters
resultPointer to the destination scan structure.
xThe x-coordinate of the origin of the region in the destination.
yThe y-coordinate of the origin of the region in the destination.
x_extentThe extent of the region in the x-axis.
y_extentThe extent of the region in the y-axis.
sourcePointer to the source scan structure.
x_sourceThe x-coordinate of the origin of the region in the source.
y_sourceThe y-coordinate of the origin of the region in the source.
rop2The raster operation code to apply.
Returns
The number of logic operations performed.

Definition at line 288 of file rop2.c.