<commit_before>#ifndef LINEARIMAGE_H
#define LINEARIMAGE_H

#include <cstddef>
#include <vector>

class LinearImage
{
public:
    LinearImage( const size_t width, const size_t height, const unsigned char* data, const unsigned char* alpha, const float gamma = 2.2f );

    void GetSrgb( std::vector< unsigned char >& color, std::vector< unsigned char >& alpha ) const;
    const float* GetRow( const size_t channel, const size_t row ) const;
    float* GetRow( const size_t channel, const size_t row );
    const size_t GetWidth()     const { return mWidth;  }
    const size_t GetHeight()    const { return mHeight; }
    const size_t GetNumChannels() const { return mChannels.size(); }

private:
    void InitTables( const float gamma );

    size_t mWidth, mHeight;
    typedef std::vector< float > Channel;
    typedef std::vector< Channel > Channels;
    Channels mChannels;
    std::vector< float > mSrgbToLinear;
    std::vector< unsigned char > mLinearToSrgb;
};

#endif
<commit_msg>Clean up some overconst<commit_after>#ifndef LINEARIMAGE_H
#define LINEARIMAGE_H

#include <cstddef>
#include <vector>

class LinearImage
{
public:
    LinearImage( const size_t width, const size_t height, const unsigned char* data, const unsigned char* alpha, const float gamma = 2.2f );

    void GetSrgb( std::vector< unsigned char >& color, std::vector< unsigned char >& alpha ) const;
    const float* GetRow( const size_t channel, const size_t row ) const;
    float* GetRow( const size_t channel, const size_t row );
    size_t GetWidth()     const { return mWidth;  }
    size_t GetHeight()    const { return mHeight; }
    size_t GetNumChannels() const { return mChannels.size(); }

private:
    void InitTables( const float gamma );

    size_t mWidth, mHeight;
    typedef std::vector< float > Channel;
    typedef std::vector< Channel > Channels;
    Channels mChannels;
    std::vector< float > mSrgbToLinear;
    std::vector< unsigned char > mLinearToSrgb;
};

#endif

{'fraction_non_alphanumeric': 0.09448818897637795, 'fraction_numerical': 0.001968503937007874, 'mean_word_length': 3.487858719646799, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7607175', 'n_tokens_mistral': 648, 'n_tokens_neox': 616, 'n_words': 208}