Ticket #2458: tex_comments.patch

File tex_comments.patch, 4.2 KB (added by IronNerd, 10 years ago)
  • source/lib/tex/tex.cpp

     
    462462
    463463TIMER_ADD_CLIENT(tc_transform);
    464464
    465 // change <t>'s pixel format by flipping the state of all TEX_* flags
     465// change the pixel format by flipping the state of all TEX_* flags
    466466// that are set in transforms.
    467467Status Tex::transform(size_t transforms)
    468468{
     
    489489}
    490490
    491491
    492 // change <t>'s pixel format to the new format specified by <new_flags>.
    493 // (note: this is equivalent to tex_transform(t, t->flags^new_flags).
     492// change the pixel format to the new format specified by <new_flags>.
     493// (note: this is equivalent to transform(t, t->flags^new_flags).
    494494Status Tex::transform_to(size_t new_flags)
    495495{
    496     // tex_transform takes care of validating <t>
     496    // transform takes care of validating
    497497    const size_t transforms = m_Flags ^ new_flags;
    498498    return transform(transforms);
    499499}
     
    559559//-----------------------------------------------------------------------------
    560560
    561561// indicate if <filename>'s extension is that of a texture format
    562 // supported by tex_load. case-insensitive.
     562// supported by Tex::load. case-insensitive.
    563563//
    564 // rationale: tex_load complains if the given file is of an
     564// rationale: Tex::load complains if the given file is of an
    565565// unsupported type. this API allows users to preempt that warning
    566566// (by checking the filename themselves), and also provides for e.g.
    567567// enumerating only images in a file picker.
     
    580580
    581581
    582582// store the given image data into a Tex object; this will be as if
    583 // it had been loaded via tex_load.
     583// it had been loaded via Tex::load.
    584584//
    585585// rationale: support for in-memory images is necessary for
    586586//   emulation of glCompressedTexImage2D and useful overall.
     
    609609// use of it impossible.
    610610void Tex::free()
    611611{
    612     // do not validate <t> - this is called from tex_load if loading
     612    // do not validate - this is called from Tex::load if loading
    613613    // failed, so not all fields may be valid.
    614614
    615615    m_Data.reset();
     
    756756
    757757    // we could be clever here and avoid the extra alloc if our current
    758758    // memory block ensued from the same kind of texture file. this is
    759     // most likely the case if in_img == tex_get_data() + c->hdr_size(0).
     759    // most likely the case if in_img == get_data() + c->hdr_size(0).
    760760    // this would make for zero-copy IO.
    761761
    762762    const size_t max_out_size = img_size()*4 + 256*KiB;
  • source/lib/tex/tex.h

     
    304304    //
    305305
    306306    /**
    307      * Change \<t\>'s pixel format.
     307     * Change the pixel format.
    308308     *
    309309     * @param transforms TexFlags that are to be flipped.
    310310     * @return Status
     
    312312    Status transform(size_t transforms);
    313313
    314314    /**
    315      * Change \<t\>'s pixel format (2nd version)
    316      * (note: this is equivalent to tex_transform(t, t-\>flags^new_flags).
     315     * Change the pixel format (2nd version)
     316     * (note: this is equivalent to Tex::transform(t, t-\>flags^new_flags).
    317317     *
    318318     * @param new_flags desired new value of TexFlags.
    319319     * @return Status
     
    325325    //
    326326
    327327    /**
    328      * rationale: since Tex is a struct, its fields are accessible to callers.
    329      * this is more for C compatibility than convenience; the following should
    330      * be used instead of direct access to the corresponding fields because
    331      * they take care of some dirty work.
    332      **/
    333 
    334     /**
    335328     * return a pointer to the image data (pixels), taking into account any
    336329     * header(s) that may come before it.
    337330     *
  • source/lib/tex/tex_codec.h

     
    5656     * encode the texture data into the codec's file format (in memory).
    5757     *
    5858     * @param t input texture object. note: non-const because encoding may
    59      * require a tex_transform.
     59     * require a Tex::transform.
    6060     * @param da output data array, allocated by codec.
    6161     * rationale: some codecs cannot calculate the output size beforehand
    6262     * (e.g. PNG output via libpng), so the output memory cannot be allocated