in src/spg_icvfxpatterns/PatternGenerators/dataRange.py [0:0]
def generator(cls, frame, kwargs, results):
""" The method which creates the checkerboard images based on the kwargs provided
:param frame: the frame number we are generating
:param kwargs: a dictionary of the arguments for the generator
:param results: a dictionary to store the results
"""
led_wall = kwargs.get("led_wall", None)
if led_wall is None:
raise ValueError("led_wall not found in kwargs")
frame_num, full_file_path = cls.get_frame_num_and_file_path(frame, led_wall.name)
led_wall_image = cls.create_solid_color_image(
led_wall.resolution_width, led_wall.resolution_height
)
image_bit_depth = cls.spg.project_settings.image_file_bit_depth
minimum_legal, maximum_legal, minimum_extended, maximum_extended = imageUtils.get_legal_and_extended_values(
led_wall.panel.brightness, image_bit_depth,
use_pq_peak_luminance=bool(cls.use_pq_peak_luminance)
)
white_square_outer = cls.create_solid_color_image(
int(led_wall.resolution_width * 0.5), led_wall.resolution_height,
color=[maximum_extended, maximum_extended, maximum_extended]
)
white_square_inner = cls.create_solid_color_image(
int(led_wall.resolution_width * 0.25), int(led_wall.resolution_height * 0.5),
color=[maximum_legal, maximum_legal, maximum_legal]
)
black_square_outer = cls.create_solid_color_image(
int(led_wall.resolution_width * 0.5), int(led_wall.resolution_height * 0.5),
color=[minimum_extended, minimum_extended, minimum_extended]
)
black_square_inner = cls.create_solid_color_image(
int(led_wall.resolution_width * 0.25), int(led_wall.resolution_height * 0.5),
color=[minimum_legal, minimum_legal, minimum_legal]
)
oiio.ImageBufAlgo.paste(
led_wall_image, 0, 0, 0, 0, white_square_outer, roi=oiio.ROI.All
)
oiio.ImageBufAlgo.paste(
led_wall_image, int(led_wall.resolution_width * 0.125), int(led_wall.resolution_height * 0.25), 0, 0,
white_square_inner, roi=oiio.ROI.All
)
oiio.ImageBufAlgo.paste(
led_wall_image, int(led_wall.resolution_width * 0.5), 0, 0, 0, black_square_outer, roi=oiio.ROI.All
)
oiio.ImageBufAlgo.paste(
led_wall_image, int(led_wall.resolution_width * 0.625), int(led_wall.resolution_height * 0.25), 0, 0,
black_square_inner, roi=oiio.ROI.All
)
# We apply the transfer function only so that this gets reversed when the images are created with the colour
# space conversion these values return to their original raw values in the file
led_wall_image = imageUtils.apply_color_conversion(
led_wall_image, led_wall.transfer_function_only_cs_name, led_wall.gamut_only_cs_name,
cls.spg.project_settings.ocio_config_path
)
# Write the image to disk and store the result
cls.write_image_and_store_result(
frame_num, full_file_path, led_wall.name, led_wall_image, results
)