Namespaces

Enumerations

enum Format
Name Value
RAW10_BGGR kRaw10FormatBGGR.id
RAW10_GBRG kRaw10FormatGBRG.id
RAW10_GRBG kRaw10FormatGRBG.id
RAW10_RGGB kRaw10FormatRGGB.id
IPU3_BGGR10 kIpu3FormatBGGR10.id
IPU3_GBRG10 kIpu3FormatGBRG10.id
IPU3_GRBG10 kIpu3FormatGRBG10.id
IPU3_RGGB10 kIpu3FormatRGGB10.id

Human readable format ID tags that can be used in code, though it is suggested to pass a

reference to the actual format struct wherever it is reasonable to do so. This primarily

exists to enable certain optimizations when receiving format objects over the wire.

Defined at line 16 of file ../../src/camera/lib/raw_formats/raw_formats.h

enum ChunkType
Name Value
PADDING 0
PIXEL_PIECE 1
PACKING_BLOCK 2

A chunk may be:

- some number of bits of padding.

- some number of bits (a "piece") of a pixel.

- a packing block containing a list of chunks.

Defined at line 23 of file ../../src/camera/lib/raw_formats/raw_packing.h

enum PixelColor
Name Value
RED 0
GREENr 1
GREENb 2
BLUE 3

Pixel colors that can make up the color filter. The 3 tranditional bayer colors are red, green,

and blue, with green appearing twice. However in some instances it is useful to be able to

distinguish between the two green pixels, so GREENr (for the greens on the same row as RED

pixels) and GREENb (for greens on the same as BLUE pixles) have been added.

There are also camera color filters which have moved away from the bayer patterns/colors and this

library should be able to support them as well. However, other colors will be added to this

enumeration as the actual formats which require them are added. This avoids guessing and adding

things we may never need or that may clash with things we want to add in the future. However some

of those future colors may include GREEN (for formats with only one green value), YELLOW, WHITE

and/or CLEAR, EMERALD, ane NIR (near infra-red).

Defined at line 24 of file ../../src/camera/lib/raw_formats/raw_color_filter.h

enum ChunkRepeatType
Name Value
FINITE 0
FILL_WIDTH 1
FILL_STRIDE 2
FILL_IMAGE 3

A chunk can be tagged to be repeated in certain ways within the context of it's parent.

Defined at line 30 of file ../../src/camera/lib/raw_formats/raw_packing.h

Records

Functions

  • RawFormatInstance CreateFormatInstance (const RawFormat & format, uint32_t width, uint32_t height, std::optional<uint32_t> row_stride)

    Create an instance of a RawFormat given a specified width, height and row stride (if applicable).

    Defined at line 12 of file ../../src/camera/lib/raw_formats/raw.cc

  • uint8_t GetBitDepth (const BitDepthMap & map, uint32_t x, uint32_t y)

    Given a BitDepthMap, return the bit depth of the specified pixel.

    Pixel is specified as an x (width) and y (height) coordinate.

    Defined at line 33 of file ../../src/camera/lib/raw_formats/raw_bit_depth.h

  • const RawFormat & GetFormatById (Format format_id)

    Given a format ID, get the corresponding format.

    A bonus to the existence of this function is that it will fail to compile if there are any hash

    collisions between the formats.

    Defined at line 33 of file ../../src/camera/lib/raw_formats/raw_formats.h

  • uint8_t GetBitDepth (const BitDepthMap & map, uint32_t width, uint32_t , uint32_t pixel_index)

    Given a ColorFilter and the image width/height, return the bit depth of the specified pixel.

    Pixel is specified as an index (0 to (width * height) - 1).

    Defined at line 41 of file ../../src/camera/lib/raw_formats/raw_bit_depth.h

  • PixelColor GetPixelColor (const ColorFilter & filter, uint32_t x, uint32_t y)

    Given a ColorFilter, return the color of the specified pixel.

    Pixel is specified as an x (width) and y (height) coordinate.

    Defined at line 53 of file ../../src/camera/lib/raw_formats/raw_color_filter.h

  • PixelColor GetPixelColor (const ColorFilter & filter, uint32_t width, uint32_t , uint32_t pixel_index)

    Given a ColorFilter and the image width/height, return the color of the specified pixel.

    Pixel is specified as an index (0 to (width * height) - 1).

    Defined at line 61 of file ../../src/camera/lib/raw_formats/raw_color_filter.h

  • uint64_t GetPixel (const RawFormatInstance & format_instance, uint32_t pixel_index, const uint8_t * buffer, size_t buffer_size)

    Given a raw format instance, get the value of the requested pixel in the provided buffer.

    NOTE: This function exists for two reasons:

    1) To provide a reference implementation for pixel lookups using the RawFormat datastructures.

    2) To provide a function which can be used to check the contents of buffers as part of tests.

    This function should not be used "in production" to do pixel value lookups (and especially not

    large numbers of pixel value lookups). Hardware accelerated means of operating on image buffers

    should always be preferred when available. If no hardware specifically designed for the required

    image processing exists, consider implementations which use compiler intrinsics to leverage

    things like SSE or AVX.

    Defined at line 90 of file ../../src/camera/lib/raw_formats/raw_lookups.cc

  • uint64_t SumBits (const PointerList<Chunk> & chunks)

    Sum all of the bits within a list of chunks, provided all of the chunks have a finite repeat

    specification. Returns zero if any are not finite.

    Defined at line 114 of file ../../src/camera/lib/raw_formats/raw_packing.h

  • void SetPixel (const RawFormatInstance & format_instance, uint32_t pixel_index, uint64_t pixel_value, uint8_t * buffer, size_t buffer_size)

    Given a raw format instance, set the value of the requested pixel in the provided buffer.

    NOTE: This function exists for two reasons:

    1) To provide a reference implementation for pixel setting using the RawFormat datastructures.

    2) To provide a function which can be used to set the contents of buffers as part of tests.

    This function should not be used "in production" to do pixel value setting (and especially not

    setting large numbers of pixels). Hardware accelerated means of operating on image buffers

    should always be preferred when available. If no hardware specifically designed for the required

    image processing exists, consider implementations which use compiler intrinsics to leverage

    things like SSE or AVX.

    Defined at line 122 of file ../../src/camera/lib/raw_formats/raw_lookups.cc

  • uint32_t SumPixels (const PointerList<Chunk> & chunks)

    Sum all of the pixels within a list of chunks, provided all of the chunks have a finite repeat

    specification. Returns zero if any are not finite.

    Defined at line 176 of file ../../src/camera/lib/raw_formats/raw_packing.h

Concepts

template <typename T> cloneable std::is_member_function_pointer_v<decltype(&T::clone)> && std::is_same_v<decltype(std::declval<T &>().clone()), T *>

A type is cloneable if it has a clone() method which returns a pointer to that type.

Defined at line 13 of file ../../src/camera/lib/raw_formats/pointer_list.h